65.9K
CodeProject is changing. Read more.
Home

Working with Doodads Mygeneration Architecture For ASP.NET

starIconstarIconstarIconstarIconemptyStarIcon

4.00/5 (7 votes)

Apr 13, 2011

CPOL
viewsIcon

27401

Doodads Mygeneration Architecture For ASP.NET

I have been searching in CodeProject for an article about MyGeneration Doodads architecture and couldn't find something exactly about this, so I hope this could help anyone. Doodads is a powerful freely distributed .NET architecture. Using that, anybody can perform .NET. It's easy to use. The thing which is needed is a good tutorial. Using this tutorial, I want to elaborate the concept and the technique to use Doodads architecture. It supports most of the databases. Firstly, you need to download MyGeneration tool. And install it in your Machine. With that, you will get the code to create the DLL. Not only that, you can create a DLL with your desired name. After creating the DLL, paste it in your Bin folder.
  1. Generate Stored Procedure using MyGeneration Tools.
  2. Generate DAL (which consists of the table name with underscore file) using MyGeneration Tools.
  3. By inheriting the DAL, make BL class like:
    public class Employees : _Employees
    {
      public Employees()
      {
      }
    }
  4. Create Object of BL class and do your desired thing like:
      Employees emps = new Employees();
      // Insert row 
      Employees emps = new Employees();
      emps.AddNew();
      emps.LastName = "Smith";
      emps.HireDate = DateTime.Now;
      emps.Save();
      // Delete row
      emps.MarkAsDeleted();
      emps.Save();
    
      // For Edit
      
      emps.LoadByPrimaryKey(PK_ID);
      emps.LastName="lastName";
      emps.FirstName="FirstName";
    
      emps.Save();
    
    // For Select Query
    emps.Where.LastName.Value = "%A%";
    emps.Where.LastName.Operator = WhereParameter.Operand.Like;
    //Note: Conjuction not Conjunction
    emps.Where.HireDate.Conjuction = WhereParameter.Conj.Or;
    emps.Where.HireDate.BetweenBeginValue = "2001-01-01 00:00:00.0";
    emps.Where.HireDate.BetweenEndValue = "2001-12-31 23:59:59.9";
    emps.Where.HireDate.Operator = WhereParameter.Operand.Between;
    emps.Query.Load();
This is very easy to implement.