Example #1
0
        public void SaveAdvance(AdvanceMaster advmaster, LedgerTrnMaster master)
        {
            strsql = " INSERT INTO Advance_File( trDate,trMonth,PayMode,crAcc,drAcc,trRoute)" +
                     " Values (CONVERT(DateTime,'" + String.Format("{0:yyyy-{0:mm}-{0:dd}", advmaster.trDate) + "',102 '" + String.Format("{0:MMM}- {0:yyyy}", advmaster.trDate) + "'," +
                     "'" + advmaster.PayMode + "','" + advmaster.crAcc + "','" + advmaster.drAcc + "','" + advmaster.trRoute + "')";
            db = new DBAccess();
            db.ExecuteQuery(strsql, DBAccess.BoughtLeaf);

            SaveLedger(master);
        }
Example #2
0
 /// <summary>
 /// Saving Accounts Ledger
 /// </summary>
 /// <param name="trnMaster"></param>
 public void SaveLedger(LedgerTrnMaster trnMaster)
 {
     strsql = "Insert Into Ac_TrMain (  [TrID],[trType],[trDate],[Description],[PayeName],[ChequeNo],[PresentDate], " +
              " [CreditAcc],[DebitAcc],[Amount] ,[FormName],[RegNo],[CrMonth] ,[Route], " +
              " [myModule],[UserLog],[ListID] Values ('" + trnMaster.TrID + "','" + trnMaster.trType + "'," +
              " CONVERT( DateTime,'" + String.Format("{0:yyyy-{0:mm}-{0:dd}", trnMaster.trDate) + "',23)," +
              "'" + trnMaster.Description + "','" + trnMaster.PayeName + "','" + trnMaster.ChequeNo + "',NULL," +
              "'" + trnMaster.CreditAcc + "','" + trnMaster.DebitAcc + "'," + trnMaster.Amount + ",'" + trnMaster.FormName + "'," +
              trnMaster.RegNo + ",'" + trnMaster.CrMonth + "','" + trnMaster.Route + "','" + trnMaster.myModule + "','" +
              trnMaster.UserLog + "','" + trnMaster.ListID + "')";
     db = new DBAccess();
     db.ExecuteQuery(strsql, DBAccess.BoughtLeaf);
     foreach (LedgerTransaction ledger in trnMaster.ledgerTransactions)
     {
         SaveLedgerDetails(ledger);
     }
 }