Ejemplo n.º 1
0
 public List <ItemDTO> GetListItem()
 {
     using (db = new MobileEntities())
     {
         return(DALUtilitiesMethod.ItemDTOList(db.ITEMs.ToList()));
     }
 }
Ejemplo n.º 2
0
 public List <UserDTO> GetListUser()
 {
     using (db = new MobileEntities())
     {
         return(DALUtilitiesMethod.UserDTOList(db.USERs.ToList()));
     }
 }
Ejemplo n.º 3
0
 public List <SubCategoryDTO> GetListSubCategoryWhenIdCategory(int _pIdCategory)
 {
     using (db = new MobileEntities())
     {
         return(DALUtilitiesMethod.SubCategoryDTOList(db.SUBCATEGORies.Where(n => n.CategoryId == _pIdCategory).ToList()));
     }
 }
Ejemplo n.º 4
0
 public List <SubCategoryDTO> GetListSubCategory()
 {
     using (db = new MobileEntities())
     {
         return(DALUtilitiesMethod.SubCategoryDTOList(db.SUBCATEGORies.ToList()));
     }
 }
Ejemplo n.º 5
0
 public bool AddItem(ItemDTO pItemDTO)
 {
     using (db = new MobileEntities())
     {
         ITEM item = DALUtilitiesMethod.ToItem(pItemDTO);
         try
         {
             db.ITEMs.Add(item);
             db.SaveChanges();
             return(true);
         }
         catch (Exception)
         {
             return(false);
         }
     }
 }
Ejemplo n.º 6
0
 public bool AddSubCategory(SubCategoryDTO pSubCategoryDTO)
 {
     using (db = new MobileEntities())
     {
         SUBCATEGORY subCategory = DALUtilitiesMethod.ToSubCategory(pSubCategoryDTO);
         try
         {
             db.SUBCATEGORies.Add(subCategory);
             db.SaveChanges();
             return(true);
         }
         catch (Exception)
         {
             return(false);
         }
     }
 }
Ejemplo n.º 7
0
 public bool AddCategory(CategoryDTO pCategoryDTO)
 {
     using (db = new MobileEntities())
     {
         CATEGORY category = DALUtilitiesMethod.ToCategory(pCategoryDTO);
         try
         {
             db.CATEGORies.Add(category);
             db.SaveChanges();
             return(true);
         }
         catch (Exception)
         {
             return(false);
         }
     }
 }