public static bool DeleteCapexExpense(CapexBudget astBud) { try { bool rst = false; using (var db = new BudgetCaptureDBEntities()) { db.Entry(astBud).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); rst = true; } return(rst); } catch (Exception ex) { throw ex; } }
public static bool DeleteGasSales(GSS_SalesTbl staff) { try { bool rst = false; using (var db = new BudgetCaptureDBEntities()) { db.Entry(staff).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); rst = true; } return(rst); } catch (Exception ex) { throw ex; } }
public static bool DeleteRevenue(RevenueProjection recpro) { try { bool rst = false; using (var db = new BudgetCaptureDBEntities()) { db.Entry(recpro).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); rst = true; } return(rst); } catch (Exception ex) { throw ex; } }
public static bool UpdateSalesData(GSS_SalesTbl byr) { try { bool rst = false; using (var db = new BudgetCaptureDBEntities()) { db.GSS_SalesTbl.Attach(byr); db.Entry(byr).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); rst = true; } return(rst); } catch (Exception ex) { //Utility.WriteError("Error Msg: " + ex.InnerException); throw ex; } }
public static bool UpdateDirectExpenseATC(DirectBudgetATC astBud) { try { bool rst = false; using (var db = new BudgetCaptureDBEntities()) { db.DirectBudgetATCs.Attach(astBud); db.Entry(astBud).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); rst = true; } return(rst); } catch (Exception ex) { // Utility.WriteError("Error Msg: " + ex.Message); throw ex; } }
public static bool UpdateRevenue(RevenueProjection recpro) { try { bool rst = false; using (var db = new BudgetCaptureDBEntities()) { db.RevenueProjections.Attach(recpro); db.Entry(recpro).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); rst = true; } return(rst); } catch (Exception ex) { // Utility.WriteError("Error Msg: " + ex.Message); throw ex; } }
public static bool UpdateUser(AppUser usr) { try { bool retVal = false; using (var db = new BudgetCaptureDBEntities()) { usr.Department = null; db.Entry(usr).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); retVal = true; } return(retVal); } catch (Exception ex) { Utility.WriteError("Error Msg: " + ex.InnerException); throw ex; } }
public static bool Update(Department dept) { try { bool rst = false; using (var db = new BudgetCaptureDBEntities()) { db.Departments.Attach(dept); db.Entry(dept).State = System.Data.Entity.EntityState.Modified; //db.ObjectStateManager.ChangeObjectState(auction, System.Data.EntityState.Modified); db.SaveChanges(); rst = true; } return(rst); } catch (Exception ex) { Utility.WriteError("Error Msg: " + ex.InnerException); throw ex; } }