示例#1
0
 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;
     }
 }
示例#2
0
 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;
     }
 }
示例#3
0
 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;
     }
 }
示例#4
0
 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;
     }
 }
示例#5
0
 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;
     }
 }
示例#6
0
 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;
     }
 }
示例#7
0
 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;
     }
 }
示例#8
0
 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;
     }
 }