Пример #1
0
            public static ProductViewClass GetProduct(int id)
            {
                ProductViewClass obj;

                using (var db = new DAL.dbDataContext())
                {
                    var data = from pr in Session.Products
                               where pr.ID == id
                               join cg in db.ProductCategories on pr.CategoryID equals cg.ID
                               select new ProductViewClass
                    {
                        ID           = pr.ID,
                        Code         = pr.Code,
                        Name         = pr.Name,
                        CategoryName = cg.Name,
                        Descreption  = pr.Descreption,
                        IsActive     = pr.IsActive,
                        Type         = pr.Type,
                        Units        = (from u in db.ProductUnits
                                        where u.ProductID == pr.ID
                                        join un in db.UnitNames on u.UnitID equals un.ID
                                        select new ProductViewClass.ProductUOMView
                        {
                            UnitID = u.UnitID,
                            UnitName = un.Name,
                            Factor = u.factor,
                            SellPrice = u.SellPrice,
                            BuyPrice = u.BuyPrice,
                            Barcode = u.Barcode,
                        }).ToList()
                    };
                    obj = data.First();
                };
                return(obj);
            }
Пример #2
0
 public DepartmentManagement()
 {
     db             = new dbDataContext();
     _objDepartment = new Department();
 }
Пример #3
0
 public VacationManagement()
 {
     db           = new dbDataContext();
     _objVacation = new Vacaion();
 }
Пример #4
0
 private DataProvider()
 {
     context = new dbDataContext();
 }