Example #1
0
 public bool editUserScan(UserScan objUserScan)
 {
     using (EmarketEntities mdeEmarket = new EmarketEntities())
     {
         try
         {
             UserScanEntity userscan = mdeEmarket.UserScanEntities.Single(p => p.idScan == objUserScan.idScan &&
                                                                          p.idProduct == objUserScan.idProduct &&
                                                                          p.idUser == objUserScan.idUser);
             userscan.idScan    = objUserScan.idScan;
             userscan.idUser    = objUserScan.idUser;
             userscan.idNF      = objUserScan.idNF;
             userscan.idProduct = objUserScan.idProduct;
             userscan.idStore   = objUserScan.idStore;
             userscan.Status    = objUserScan.Status;
             userscan.Type      = objUserScan.Type;
             mdeEmarket.SaveChanges();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }
Example #2
0
 public bool deleteUserScan(UserScan objUserScan)
 {
     using (EmarketEntities mdeEmarket = new EmarketEntities())
     {
         try
         {
             UserScanEntity userscan = mdeEmarket.UserScanEntities.Single(p => p.idScan == objUserScan.idScan &&
                                                                          p.idProduct == objUserScan.idProduct &&
                                                                          p.idUser == objUserScan.idUser);
             mdeEmarket.UserScanEntities.Remove(userscan);
             mdeEmarket.SaveChanges();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }
Example #3
0
 public bool createUserScan(UserScan objUserScan)
 {
     using (EmarketEntities mdeEmarket = new EmarketEntities())
     {
         try
         {
             UserScanEntity userscan = new UserScanEntity();
             userscan.idScan    = objUserScan.idScan;
             userscan.idUser    = objUserScan.idUser;
             userscan.idNF      = objUserScan.idNF;
             userscan.idProduct = objUserScan.idProduct;
             userscan.idStore   = objUserScan.idStore;
             userscan.Status    = objUserScan.Status;
             userscan.Type      = objUserScan.Type;
             mdeEmarket.UserScanEntities.Add(userscan);
             mdeEmarket.SaveChanges();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }