Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
G

giddy_guitarist

@giddy_guitarist
About
Posts
100
Topics
28
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • decode XmlDocument.OuterText
    G giddy_guitarist

    nope, both solutions have encoded text!

    C# xml question

  • decode XmlDocument.OuterText
    G giddy_guitarist

    hi, Simple question. I'm trying to get the xml in an XmlDocument variable into a string. Seems like its a tough thing and I tried the OuterText property but it gives me encoded text like : >< So, does anybody have a decent solution to this. Thanks Gideon

    C# xml question

  • in search of a better printing/reporting mechanism
    G giddy_guitarist

    thanks so much for replying, but someone on the Microsoft newsgroups gave me a work around with CR. I make a new typed dataset for each report that I want to create, I have seperate tables for each chunk of data I need printed.Then I design a new report, when I need the data printed I set the datasource to a new instance of the typed dataset with all my data in it! It works like a charm, also for situations where I've needed Multiple bunches of information all over the place, I use subreports, somehow the dataset passed to the first report is automatically passed to the subreports too, so it works pretty well. Thanks!

    Design and Architecture question csharp database design business

  • designing a good way enable/disable controls [modified]
    G giddy_guitarist

    I kinda understood what your saying better after looking at paint.net source code lol! I've been looking at a lot of programs like that for inspiration. So the Main form code itself should decide what menus and toolbars need to be enabled/disabled by querying/using business objects itself? That would be a correct design? (Atleast thats how it is in Paint.NET) (I'm sorry if i sound daft from time to time, I'm young and not formally computer educated!)

    Design and Architecture design sales

  • designing a good way enable/disable controls [modified]
    G giddy_guitarist

    Interesting, I've been quiet for sometime because I was doing a little more thinking, I decided to use the MVP pattern for each UserControl(View) that I make, however what I was talking about was Enabling/Disabling a control in the MainForm from a UserControl, I would end up having a reference to the MainForm from the UserControl then, which glues the UserControl to the MainForm! MainForm --------------------- CustomerView(UserControl): A customer is selected, something needs to be disabled in the MainForm. BillView(UserControl) --------------------- But now, It seems I will only have a MenuBar and a ToolBar on the MainForm, there will also be a TabControl and inside these TabControls will reside different views. So I just have to bother about diabling/enabling menus and toolstripitems. Now, I thought of encapsulating the Toolbar and MenuBar and have themselves decide what needs to be enabled and disabled instead. Like class HmsMenuBar : MenuStrip { //during the OnDropDownOpening.. i can check if items should be enabled/disabled.?? } Same thing for the ToolBar, does this sound ok? Thanks so much Gideon

    Design and Architecture design sales

  • designing a good way enable/disable controls [modified]
    G giddy_guitarist

    hi, Thanks you guys, but un fortunately UI needs to be disabled based on more complicated situations. Like User permissions, and things like say if its a customer's last day of stay, stuff like that. I will have a customer grid, so if a certain customer is on his last day, in the user control I would do this: //on selected reservation changed. if(selectedReservation.EndDate == DateTime.Today) { //must enable the CheckOut Reservation menu item. } else { //must disable the CheckOut Reservation menu item. } I can't put all possibilities into an Enum, and I think databinding would be a little convoluted since some situations are more complex. Is my design stupid? that I'm looping through the controls? Thanks so much.

    Design and Architecture design sales

  • designing a good way enable/disable controls [modified]
    G giddy_guitarist

    hi, I've finished all the base code to my App. Tested it and everything, now I need to make a UI. Its not going to be overly complex but it could get complex later on, so I want to design it well. I want a proper way to enable/disable UI but later being able to change maybe the real control, so far i've come up with.

    interface IMainForm//implement this in the main form.
    {
    IUIController GetUIController(string name);
    }
    interface IUIController
    {
    bool Enabled
    { get;set;}
    }

    The default implementation would be:

    class DefUIController : IUIController
    {
    DefUIController(Control cntrl);
    {
    }
    //encapsulate Controls.Enabled
    }

    And then in the main form I could search for the control and create a new UIController and return it, like this:

    IUIController GetUIController(string name)
    {
    foreach(Control crt in this.Controls)
    {
    if(crt.Name== name)
    {
    return DefUIController(crt);
    }
    return null;
    }
    }

    I would need to change the state of a control from a sub UserControl which has a reference via a property to IMainForm. Like, if the selected Customer in the CustomerGridView UserControl doesn't have a bill yet, _within_ the usercontrol i could do this:

    IUIController ui = _mainform.GetUIController("mnuPrintBill");//Menu
    ui.Enabled = false;

    Is this design good enough or is there a method out there, I don't need something complex like CAB or something, its not such a big app. Thanks so much. Gideon

    modified on Thursday, November 13, 2008 12:07 AM

    Design and Architecture design sales

  • in search of a better printing/reporting mechanism
    G giddy_guitarist

    hi, This should hopefully be my last question about my future hotel app. The first time i built it, i made an insane amount of classes to encapsulate printing, and even then printing was messy. I thought I could use crystal reports, but did a few tests and ran into some problems. It seems like its a nice thing when you want to just pull information straight from your database and print it but turns out pretty cumbersome when I want to use my own business objects as data for a report. I know I can add a .NET object to the report via the database expert.But, there are problems when I need data from more than one object on a report. Also, I'm not quite sure how I could feed my own data to a chart in a report. Is there any other printing/reporting scheme I can use? Or is there a particular design used with crystal reports, Printing is a very essential part of my app. Thanks so much Gideon

    Design and Architecture question csharp database design business

  • implementing effective searching in business code(maybe with linq?)
    G giddy_guitarist

    Thanks so much Mark, it all looks good on paper so far!

    Design and Architecture database csharp linq algorithms business

  • implementing effective searching in business code(maybe with linq?)
    G giddy_guitarist

    hi mark, Thanks for your reply, I like your solution, could you please elaborate on the Expression objects Is it something like:

    class Expression{
    //represents an expression
    }

    Person[] p = Person.FindByExpression(Expression.And("Age>20","Country='Australia'"));

    Person[] FindByExpression(Expression exp)
    {
    _personDataAccess.GetByQuery("SELECT * FROM Persons WHERE " + exp.ToString());
    //exp.ToString would return something like (Age>20 AND Country='Australia")
    }

    Could you correct me if I'm wrong please. Thanks so much Gideon

    Design and Architecture database csharp linq algorithms business

  • implementing effective searching in business code(maybe with linq?)
    G giddy_guitarist

    Yes! I already did this whole app(Hotel Management Studio) with sql server 2k5 express. Turned into a 15,000 line mess, mostly because I didn't design it well(or didn't design it all!). I'm doing the whole thing again and this time building use cases and going through everything right(I think) Part of my failure was because Access was the perfect solution and when i did it with sqlservr it raised the complexity and especially the networking stuff got crazy, I have to use TCP/IP to open the data base over LAN, with access I can just open the file over a UNC path. Sweet and simple. Just like the app should be, I dont think its such a big app anyway. If you are wondering what kind of computer programming, I'm one that turned 18 last week :^) , I dont know hardly anything when it comes to good design but I know quite a bit about technology and API(I'm an MCTS :WinDev and I've even done Win32 API) It would be very helpful if you could comment on Mark's Solution? Thanks so much. Gideon

    Design and Architecture database csharp linq algorithms business

  • implementing effective searching in business code(maybe with linq?)
    G giddy_guitarist

    ah! You mean take a lambda expression in my function parameter? I would have never thought of that? Also, are you saying loading all objects in memory and then searching them would be more efficient than searching a data base? Because I cant use Linq to SQL, I'm using an Access database. But I'm curious, searching data like this is a common thing in a lot of apps, how do they implement it? Thanks so much Gideon

    Design and Architecture database csharp linq algorithms business

  • creating a _simple_ fine grained user based security system
    G giddy_guitarist

    Cool.Thanks so much.

    Design and Architecture csharp database design security business

  • implementing effective searching in business code(maybe with linq?)
    G giddy_guitarist

    hi, If I have something like:

    class Person
    {
    //functions:
    static Person[] GetAllPersons();
    static Person[] Search(string field,string value);
    }

    In the second function I would do something like build an sql query like this: SELECT ........... WHERE field = value and send it through another data class to retrieve the right Persons. eg: Person[] teens = Person.Search("Age",18); Firstly the biggest problem searching with AND, >,<, OR, Between etc.? Which terribly limits the search.I could make more functions for that, but its turns into a little bit of a mess. Is there a better/more generic way to build a query on the fly? Would I benefit by using Linq instead/would it be more efficient to load all persons in memory and then search them with linq? If I were to use linq how again would I write a function to build a query on the fly? Thanks so much Gideon

    Design and Architecture database csharp linq algorithms business

  • creating a _simple_ fine grained user based security system
    G giddy_guitarist

    aren't those classes for ASP.NET? I'm doing a Windows Desktop application.

    Design and Architecture csharp database design security business

  • creating a _simple_ fine grained user based security system
    G giddy_guitarist

    hi, (I want someone to check if my idea is utterly stupid or ok??) I have a mid complex app for a hotel that needs a fine grained user security system. In other words an admin should be able to deny/grant specific access to users like Ability to make a Reservation or the ability to print reports. Now, I'm thinking the business objects could take something like: enum UserPrivileges { various privileges....... }; IPrivilegedUser { public UserPrivileges Privileges { get; } } The user class inherits from this interface, the business objects could take this user in a function and return true/false as per the needed privileges, or maybe throw an exception: User user1 = new User(); //class User inherits from IPrivilegedUser and loads the right privileges from the DB Reservations.LoadPrivileges(user1);//check the returned value..?? Reservations.EditReservation() // calling this should fail if the privileges are not enough!? Is this a good enough design, will it break apart somewhere or is there a better way to do this? Declarative security like CAS in .NET would be an overkill since its not a very large app, but I do need the design to be flexible enough so that if the app does grow big I'm not in a mess. Thanks Gideon

    Design and Architecture csharp database design security business

  • wasn't there a section on CP for jobs??
    G giddy_guitarist

    Draugnar wrote:

    Kids in high school and junior high? I thought CP was filled with software professionals.

    Oh common, we're not that bad now? Doesn't the fact that i'm MCP count??? You've been on CP only 5 months more than me! And Ravel has made 10 times your posts! JK, obviously your way better than us! :-D Hope that did make you feel better? :)

    The Lounge question

  • wasn't there a section on CP for jobs??
    G giddy_guitarist

    Ravel H. Joyce wrote:

    Oh, no, that's all right. I forgive you.

    Cool!

    Ravel H. Joyce wrote:

    I do find it weird that you didn't look at my picture though...

    Guess i glanced at it quick and probably thought it was more of a random pic! sry!

    The Lounge question

  • wasn't there a section on CP for jobs??
    G giddy_guitarist

    Ravel H. Joyce wrote:

    Girl? Look harder! Must be the androgynous name... I don't...look like a girl, do I? Maybe it's just when the picture is scaled down so much.

    Oh jeez, I'm so sorry! It was more your last name that lead to that conclusion, and something about mother nature ... on your bio. Gosh i hardly noticed your pic.... sry! yea, even i used to try a whole bunch of things earlier! I really like C# and .NET 2.0 now, so thats what I'm focused on, in fact trying to learn some ADO.NET right now!

    The Lounge question

  • wasn't there a section on CP for jobs??
    G giddy_guitarist

    haha! very cool! I did think 8th but i wasn't sure, i know your 13. I'm 17 btw. Ok, did notice you were a girl! I never manage to actually meet smart girls ever! Guess i finally did! Yea a lot of people hated me at school! more people used me as free tech support! :sigh: I'm an ISTJ btw, then again I haven't got a physci take my personality!

    Ravel H. Joyce wrote:

    I've been called many things throughout the ages, most of them involving 'nerd' or 'geek' in some way, often with 'hyper' or 'mega' prefixed onto the beginning.

    heh, i know what you mean, i go by Insane computer geek,I kinda liked 'Computer God' from this geek test i took!!! Oh i play violin, piano and guitar, but beside liking math and science I'm mostly into computers..and i'm an MCP! Oh i wish i could draw too, everyone in my family is an artist except me!! =S I always thought i couldn't sing until I tried one day, i'm not great but hey you should try! Oh i like writing sometimes but i always hate my work!

    Ravel H. Joyce wrote:

    know a lot of people at my school think I'm a cold, emotionless, humourless sociopath, a kind of evil genius,

    again, i know what you're talking about! :)

    Ravel H. Joyce wrote:

    but I wouldn't hurt a fly. Honest.

    lol! i believe you! :-D What about programming? What do you do?

    The Lounge question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups