コード例 #1
0
ファイル: CommonBLL.cs プロジェクト: wolay/BudgetCaptureNgc
 public static bool AddCapexExpense(CapexBudget astBud)
 {
     try
     {
         using (BudgetCaptureDBEntities db = new BudgetCaptureDBEntities())
         {
             db.CapexBudgets.Add(astBud);
             db.SaveChanges();
             return(true);
         }
     }
     catch (Exception ex)
     {
         // Utility.WriteError("Error Msg: " + ex.Message);
         throw ex;
     }
 }
コード例 #2
0
ファイル: CommonBLL.cs プロジェクト: wolay/BudgetCaptureNgc
 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;
     }
 }
コード例 #3
0
ファイル: CommonBLL.cs プロジェクト: wolay/BudgetCaptureNgc
 public static bool UpdateCapexExpense(CapexBudget astBud)
 {
     try
     {
         bool rst = false;
         using (var db = new BudgetCaptureDBEntities())
         {
             db.CapexBudgets.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;
     }
 }