Esempio n. 1
0
 public Boolean Update(Request model)
 {
     if (model != null)
     {
         using (AuthenticationDB db = new AuthenticationDB())
         {
             db.Requests.Attach(model);
             db.Entry(model).Property(ob => ob.REQ_DES_TYPE_GASTO).IsModified   = true;
             db.Entry(model).Property(ob => ob.REQ_DES_CONCEPT).IsModified      = true;
             db.Entry(model).Property(ob => ob.REQ_DES_QUANTITY).IsModified     = true;
             db.Entry(model).Property(ob => ob.REQ_DES_OBSERVATIONS).IsModified = true;
             return((db.SaveChanges() > 0) ? true : false);
         }
     }
     return(false);
 }
 public Boolean Update(Budget model)
 {
     if (model != null)
     {
         using (AuthenticationDB db = new AuthenticationDB())
         {
             db.Budgets.Attach(model);
             db.Entry(model).Property(ob => ob.BUD_IDE_ACCOUNT).IsModified  = true;
             db.Entry(model).Property(ob => ob.BUD_IDE_AREA).IsModified     = true;
             db.Entry(model).Property(ob => ob.BUD_DES_QUANTITY).IsModified = true;
             db.Entry(model).Property(ob => ob.BUD_DES_PERIOD).IsModified   = true;
             return((db.SaveChanges() > 0) ? true : false);
         }
     }
     return(false);
 }
 public ActionResult Edit([Bind(Include = "ARE_IDE_AREA,ARE_DES_NAME,ARE_FH_CREATED")] Area area)
 {
     if (ModelState.IsValid)
     {
         db.Entry(area).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(area));
 }
Esempio n. 4
0
 public Boolean Update(Role Role)
 {
     if (Role != null)
     {
         using (AuthenticationDB db = new AuthenticationDB())
         {
             db.Roles.Attach(Role);
             db.Entry(Role).Property(ob => ob.TUSR_DES_TYPE).IsModified = true;
             return((db.SaveChanges() > 0) ? true : false);
         }
     }
     return(false);
 }
Esempio n. 5
0
 public Boolean Update(Area area)
 {
     if (area != null)
     {
         using (AuthenticationDB db = new AuthenticationDB())
         {
             db.Areas.Attach(area);
             db.Entry(area).Property(ob => ob.ARE_DES_NAME).IsModified = true;
             return((db.SaveChanges() > 0) ? true : false);
         }
     }
     return(false);
 }
 public Boolean Update(User User)
 {
     if (User != null)
     {
         using (AuthenticationDB db = new AuthenticationDB())
         {
             db.Entry(User).State = EntityState.Modified;
             db.SaveChanges();
         }
         return(true);
     }
     return(false);
 }
Esempio n. 7
0
 public Boolean Update(AccountingAccount accountingAccount)
 {
     if (accountingAccount != null)
     {
         using (AuthenticationDB db = new AuthenticationDB())
         {
             db.AccountingAccounts.Attach(accountingAccount);
             db.Entry(accountingAccount).Property(ob => ob.ACC_DES_ACCOUNT).IsModified = true;
             return((db.SaveChanges() > 0) ? true : false);
         }
     }
     return(false);
 }
 public Boolean Update(StatusAprov StatusAprov)
 {
     if (StatusAprov != null)
     {
         using (AuthenticationDB db = new AuthenticationDB())
         {
             db.StatusAprovs.Attach(StatusAprov);
             db.Entry(StatusAprov).Property(ob => ob.STA_DES_STATUS).IsModified = true;
             return((db.SaveChanges() > 0) ? true : false);
         }
     }
     return(false);
 }
Esempio n. 9
0
 public Boolean Delete(string id)
 {
     if (id != null)
     {
         Invoice model = GetOne(id);
         if (model != null)
         {
             using (AuthenticationDB db = new AuthenticationDB())
             {
                 db.Invoices.Attach(model);
                 db.Entry(model).State = System.Data.Entity.EntityState.Deleted;
                 return((db.SaveChanges() > 0) ? true : false);;
             }
         }
     }
     return(false);
 }
Esempio n. 10
0
 public Boolean Delete(int?id)
 {
     if (id != null)
     {
         Role Role = GetOne(id);
         if (Role != null)
         {
             using (AuthenticationDB db = new AuthenticationDB())
             {
                 db.Roles.Attach(Role);
                 db.Entry(Role).State = System.Data.Entity.EntityState.Deleted;
                 return((db.SaveChanges() > 0) ? true : false);;
             }
         }
     }
     return(false);
 }
Esempio n. 11
0
 public Boolean Delete(string id)
 {
     if (id != null)
     {
         Area area = GetOne(id);
         if (area != null)
         {
             using (AuthenticationDB db = new AuthenticationDB())
             {
                 db.Areas.Attach(area);
                 db.Entry(area).State = System.Data.Entity.EntityState.Deleted;
                 return((db.SaveChanges() > 0) ? true : false);;
             }
         }
     }
     return(false);
 }
Esempio n. 12
0
 public Boolean Delete(string id)
 {
     if (id != null)
     {
         AccountingAccount accountingAccount = GetOne(id);
         if (accountingAccount != null)
         {
             using (AuthenticationDB db = new AuthenticationDB())
             {
                 db.AccountingAccounts.Attach(accountingAccount);
                 //db.AccountingAccounts.DeleteObject(accountingAccount);
                 db.Entry(accountingAccount).State = System.Data.Entity.EntityState.Deleted;
                 return((db.SaveChanges() > 0) ? true : false);
             }
         }
     }
     return(false);
 }
 public Boolean Update(User User)
 {
     if (User != null)
     {
         using (AuthenticationDB db = new AuthenticationDB())
         {
             db.Users.Attach(User);
             db.Entry(User).Property(ob => ob.USR_IDE_AREA).IsModified       = true;
             db.Entry(User).Property(ob => ob.USR_DES_POSITION).IsModified   = true;
             db.Entry(User).Property(ob => ob.USR_DES_NAME).IsModified       = true;
             db.Entry(User).Property(ob => ob.USR_DES_FIRST_NAME).IsModified = true;
             db.Entry(User).Property(ob => ob.USR_DES_LAST_NAME).IsModified  = true;
             db.Entry(User).Property(ob => ob.USR_DES_PASSWORD).IsModified   = true;
             db.Entry(User).Property(ob => ob.USR_DES_PHONE).IsModified      = true;
             db.Entry(User).Property(ob => ob.USR_DES_EMAIL).IsModified      = true;
             return((db.SaveChanges() > 0) ? true : false);
         }
     }
     return(false);
 }