Web Forms :: Tree Structure For Nodes - Multi Level Marketing Project
Jan 27, 2010
I am developing an ASP.Net web application for my client which is into Multi Level Marketing Business. I need to show him the treeview of the members under any member he chooses. For eg. he selects 'Member A' from the DropDownList, and clicks Submit, he should get a treeview of all the members under 'Member A'
Let's say I have a Visual Studio solution with a Web project, a BLL project, and a DAL project. I'm trying to follow the repository pattern keeping my SQL code in the DAL with an interface that is referenced by the BLL.
I have a handful of common solutions for things such as error handling, usage logging, and other things that can be considered utility functions (i.e. not in the business spec). I'm keeping these in a Common project.
Here are a few ideas I've had with regards to structuring the Common project...
Bundle SQL with logic in a given class
Create a layered solution within the Common project
Discard the Common project and put utility functions in with BLL/DAL
Is one of these ideas better/worse than the other? Does anyone have a better solution?
It's worth noting that these utility functions will be reused in a variety of other applications.
I need to know a way to disable nodes in a tree view when a particular node is checked (the leafs has check boxes), currently I was able to do it but my problem is I have check the check box, then click on the node in order to get it disabled, this not an user friendly at all. I want it to happen when I check the checkbox in the tree node.
MainMenu is the Parent node and Tracker, Reports ... are subodes. I want that if I click the node Tracker the all it's parent nodes(NBD, EOI, Proposal, Project, Sub Contract) should expand the remaining treevew remain same.
i have a tree view with nodes beverages ,condiments,confections,dairy products and am adding a new node by entering the name of the node through a textbox and the position of the node as where to be inserted is given thru a dropdown list.fro ex.if i select beverages from dropdown list the node is added as a child node of beverages..the node being added is temporary i.e when i run the program again ,previously added node does not exist.."how to make the newly added node exist permanently..ie if i add a node to beverages or any node as a childnode it should exist permanently..when i run the prog again i shud see the node which was added... "
Is it possible to create a route, who accepts a random number of Categories/subCategories and is still able to understand /ProductID/ProductName where Product ID is an int and ProductName is a string.
When installing an Umbraco site, I changed my umbraco admin url from '/umbraco/' to '/myadminurl/', even before I went through the install process.
Just like it's documented, I changed in the web.config the keys 'umbracoReservedPaths' and 'umbracoPath' to match my new admin url.
Installed and everything is working fine, except for one thing: All the nodes in the trees in all sections aren't showing any thumbnails. There used to be a win folder thumb before each tree node, but now it's just empty, except for the 'packages' node in the developer section, and for the recycle bin thumb.
Is it possible to make the tree in a "collapsed" state where all the Leaf nodes and ONLY leaf nodes are hidden from view until its parent node is expanded? The ideal solution would be to do this without a postback, but any solution at this time would be helpful. The "collapsed" view would look like this:
Root |-Parent |--Child |--Child
Expanding the Root, Parent or Child nodes should show their Leaf nodes. Collapsing the node should re-hide its leaf nodes, but leave the child nodes visible.
I have been trying to delete nodes from a tree view that is being generated from a database. I have the code written and it works, but only on the root Nodes. It will not delete Parents/Childs/Leaf, it will if I delete the root, but I also want to be able to delete parent nodes and such.
Right now i have this code so far
Dim tn As TreeNode = treeView.SelectedNode treeView.Nodes.Remove(tn)
I know that I can just use treeView.Nodes.Remove(treeView.SelectedNode) but was doing some error checking to see if I could firgue out what was going on. I am using VB6, I am not so worried about the database deleting at the moment. I would prefer not to use the Clear() method as this will remove all the nodes I only want to remove certain ones and keep the rest.
I am playing with Asp.net MVC 3, I was wondering how do you acheive a collection rendering in the view when the collection is made of 'real world' objects. Let's say I have a collection of client, each client may have an address and an adress may have a country.
When I write the following code it crashs if one of the client has a null address (or a null country). Object reference not set to an instance of an object.
I am looking for multi-level accordion menu (drill down to few levels deeper) (expand and collapsible) for my website. Is there a sample anywhere I can use? it will be nice if I can dock it to the left by clicking on an icon and slide back when I click on the icon again.
Since I can search any of those categories, I'm looking for a more user-friendly way of displaying it as is without using a combobox and with no javascript. With the combobox, the deeper the menu, the more leading spaces it'll have. As seen above, that's exactly how it'd look like in a combobox.
Ques 1. I am pasting only excerpts of my panel code (limited length here) within which I have 3 levels. The collapsible panel works fine till level 2 but when I am clicking on level 3 it shows for a second and collapses back to level 2. The collapsible doesnt work on panel pnlUserAccess below.
Ques 2. Can I make collapsible panel work on particular button click or image click?. As when I just put to to 2 levels I have to edit within the gridview and as soon as I click on the checkbox to edit the panel collapses.. I need to just give it a tree view style of appearance.
Ques 3. Can I also make the collapsible panel enable on read mode and disable on edit mode (if there is no possiblity for Ques 2)how to make it work. Just to be more specific on the code.
This is just a glimpse at the object model, but it's focused on the complexity of the relationships and lists. What I can't really get is what's the best way to factor my repository interfaces, given the requirements to do a unit of work. For example, to create a game, you'll need a venuedate and two participants. Does that mean the GamesController should require an IGameRepository, an IVenueDateRepository, and an IParticipant repository? Should they be rolled into one repository?
Also, what about in the consumption cases? For example, to display a signle team's schedule, you'll need all of the Participants for that Team, all of the Games for that participant, and all of the GameSegments for the participant. If those are factored into individual repositories I can't see how you can do efficient queries. Does that mean you have Repositories specifically focused on different cases? for example:
public interface IScheduleRepository { public ICollection<Game> GetScheduleForTeam(Team team); // More consumption methods } public class ScheduleRepositry : IScheduleRepository { public ScheduleRepository (ModelContext context) { // Do stuff with context } public ICollection<Game> GetScheduleForTeam(Team team) { return ( from p in context.Participants where ((p.Game.VenueDate != null) && (p.TeamId == team.Id)) orderby p.Game.VenueDate.StartTime select p.Game).ToList(); } // more consumption methods } public interface IGameRepository { public void AddGame(Game game); // More crud methods } // Not showing games repository public class GamesController : Controller { public GamesController (IGameRepository gamesRepo, IVenueDateRepository venueDateRepo, IParticipantRepository participantRepo) { // do stuff with repos here } [HttpPost] public ActionResult AddGame(Game game) { // Skipping validation logic // this? VenueDate = venueDateRepo.Add(game.VenueDate); foreach (Participant p in Game.Participants) { participantRepo.Add(p); } Game = gamesRepo.AddGame(game); // or this? // how would the game repo know to persist // the children elements? is that tight coupling? Game = gamesRepo.AddGame(game); } // more consumption methods }
My question is I don't yet understand to what degree factoring your repositories make sense based on a connected object model. I'd love to get some advice here.
I have a problem with exporting three gridviews (main and nested gridview and sub nested gridview) to Excel fromat using ClosedXML (XLWorkbook). I read tutorial onĀ aspsnippetsĀ and it works fine for main gridview. i refered in link [URL] ....
But its only for two gridview but i need three nested gridviews export to excel ....
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { gvCustomers.DataSource = GetData("select top 10 * from Customers"); gvCustomers.DataBind();
I want to structure my ASP.NET MVC 2 web application sensibly using Areas. The application consists of the two main parts Website which is the default part and Dashboard which administrates the site using a CMS. (Probably, more Areas will follow later on.)
How do I structure my project best? Should I ...
create the Area Dashboard and put the stuff belonging to the Website part into the main application folder or should I create both Areas Website and Dashboard?
Additionally, where should I place my Entity Data Model and the corresponding Repository classes that have to be accessed by both Areas?
I am using asp.net 3.5 and I am trying to create a project structure (asp.net web solution with UI/Business/Data access) which would be like a base and ready for any new projects in my team and all could use this standard structure only as a base(outer boundary) and they can expand the structure. Also adding on to it I wanted to include certain features like adding libraries of reusable code/functions, so that every team member could use functions from my library within this base structure. To summarize the above, I need to create standard .net project structure/framework/architecture with resusable code library included in it. How can I do this..
I am not new to ASP.Net application development but I haven't used some of the new frameworks or features that are used in applications these days.
For cross-cutting concerns, things like: Logging, Caching and DAAB are used in projects these days to implement proven and efficient source code from either Microsoft or other third party vendors such as Log4Net for logging purposes.