示例#1
0
 //=====================================================================
 #region Ledgers
 public static int CreateLedger(EXPENSESHEAD ledger)
 {
     using (VedantaEntities deo = new VedantaEntities())
     {
         EXPENSESHEAD oldLedger = deo.EXPENSESHEAD.FirstOrDefault(exp => exp.ClientId == ledger.ClientId && ledger.CODE.Equals(exp.CODE, StringComparison.OrdinalIgnoreCase));
         if (oldLedger != null)
         {
             return(0);
         }
         else
         {
             if (ledger != null)
             {
                 deo.AddToEXPENSESHEAD(ledger);
                 return(deo.SaveChanges());
             }
         }
     }
     return(0);
 }