Beispiel #1
0
        public bool AddUser()
        {
            bool bretval = false;

            strsql = "Insert into SystemUser (UserName,UserPassword,UserFullName,CreatedBy, Createddate)" +
                     " Values ('" + UserName + "','" + Password + "','" + FullName + "'," + CreatedBy + ",GETDATE()";
            try
            {
                db.ExecuteQuery(strsql, DBAccess.AUDIT);
                bretval = true;
            }
            catch (Exception ex)
            {
                bretval = false;
            }
            return(bretval);
        }
Beispiel #2
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);
        }
Beispiel #3
0
 /// <summary>
 /// Saving details of the ledger as accounts transactions
 /// </summary>
 /// <param name="transaction"></param>
 public void SaveLedgerDetails(LedgerTransaction transaction)
 {
     strsql = " Insert Into Ac_Trans ( [trDate],[trNo],[trCode] ,[trCdeNo],[AcCode],[Debit],[Credit],[trMode], " +
              " [sTime], [ItemType],[ItemName],[ItemCode],[qtIn],[qtOut],[Rate] ,[ExpCode], " +
              " [CopCode],[LabourCR],[LabourCW] ,[InvNo],[TxVal],[CostID],[ExpSubCode],[CopMainCode],[ZynkeD]) " +
              " Values ( CONVERT(DateTime,'," + String.Format("{0:yyyy-{0:mm}-{0:dd}", transaction.trDate) + ",23)," +
              transaction.trNo + ",'" + transaction.trCode + "','" + transaction.trCdeNo + "','" + transaction.AcCode + "'," +
              transaction.Debit + "," + transaction.Credit + ",'" + transaction.trMode + "',GETDATE(),'" + transaction.ItemType + "'," +
              "'" + transaction.ItemName + "','" + transaction.ItemCode + "'," + transaction.qtIn + "," + transaction.qtOut + "," +
              transaction.Rate + "," + transaction.ExpCode + "," + transaction.CopCode + "," + transaction.LabourCR + "," + transaction.LabourCW +
              ",'" + transaction.InvNo + "'," + transaction.TxVal + ",'" + transaction.CostID + "'," + transaction.CopMainCode + "," +
              transaction.ZynkeD + ")";
     db = new DBAccess();
     db.ExecuteQuery(strsql, DBAccess.BoughtLeaf);
 }
        //public void CommitSavingPayment(DataTable table)
        //{
        //    if (!TableExisits("SavingLedger"))
        //    {
        //        CreateSavingLedgerTable();

        //    }
        //    Task task = DBAccess.ExecuteSavingTransaction(0, table);
        //    task.Wait();
        //    //task.
        //}

        public void CreateSavingLedgerTable()
        {
            string sql = " CREATE TABLE SavingLedger (" +
                         " RegNo int, RegName nchar(50), Route nchar(30),ItemName nchar(50), Amount money, Unit nchar(10), " +
                         " ItemOrder int, Qty numeric(18,2),Maincategory nchar(10))";

            try
            {
                DBAccess.ExecuteQuery(sql, DBAccess.BoughtLeaf);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            //throw new NotImplementedException();
        }
Beispiel #5
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);
     }
 }
Beispiel #6
0
        /// <summary>
        /// Cash master entry
        /// </summary>
        /// <param name="cashnn"></param>
        /// <returns>Cash master object</returns>
        private CashNN InsertCashMaster(CashNN cashnn)
        {
            cashnn.ws = Environment.MachineName + DateTime.Now.ToShortTimeString().Trim();
            strsql    = "Insert into indCA Values ('" + cashnn.ws + "',GETDATE())";
            db        = new DBAccess();
            db.ExecuteQuery(strsql, DBAccess.GL);

            //strsql = "Select top 1 * from indCA Order by Ind Desc";
            //table = db.GetDataTable(strsql, DBAccess.GL);
            //if (table.Rows.Count == 1)
            //{
            //    cashnn.ind = int.Parse(table.Rows[0]["ind"].ToString());
            //    cashnn.ws = table.Rows[0]["ws"].ToString();
            //    cashnn.st = DateTime.Parse(table.Rows[0]["st"].ToString());
            //}
            cashnn = GetCashLastNo();
            return(cashnn);
            //throw new NotImplementedException();
        }