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); }
public DepartmentManagement() { db = new dbDataContext(); _objDepartment = new Department(); }
public VacationManagement() { db = new dbDataContext(); _objVacation = new Vacaion(); }
private DataProvider() { context = new dbDataContext(); }