Пример #1
0
        //--------------------  Update Payment Information ----------------------------------------------


        public void UpdatePaymentInformation(DBSite site, SalePurchaseEntity salePurchase, string ledgerIdNumber)
        {
            string ledger_id     = util.GetLedgerId(ledgerIdNumber);
            string ledger_number = util.GetLedgerNumber(ledgerIdNumber);

            // 444
            int party = Int32.Parse(util.GetLOVId(salePurchase.party));
            int mode  = Int32.Parse(util.GetLOVId(salePurchase.mode));


            if (salePurchase.transactionType == TransactionType.PaymentMade)
            {
                int tmp;
                tmp   = Int32.Parse(util.GetLOVId(salePurchase.mode));
                mode  = Int32.Parse(util.GetLOVId(salePurchase.party));
                party = tmp;
            }



            // sales - party
            string party_qry = " UPDATE tblLedger SET "
                               + " LDate = '" + salePurchase.BillDate + "' "
                               + ", AccountMasterId= " + mode
                               + ", modeid= " + party
                               + ", BillNumber= '" + util.GetLOVName(salePurchase.BillNumber) + "' "
                               + ", Particulars= '" + salePurchase.particulars + "' "
                               + ", debit = " + salePurchase.SalePurchaseAmount
                               + ", CheckNumber= '" + salePurchase.CheckNumber + "'  "
                               + ", subUserId = " + Util_BLL.User.Subusers[0].SubuserId
                               + Util_BLL.GetUserWhereCondition(Util_BLL.User)
                               // + " AND LedgerId=" + ledger_id
                               + " AND LedgerNumber=" + ledger_number
                               + " AND drcr = 'D'";



            // sales - mode
            string mode_qry = " UPDATE tblLedger SET "
                              + " LDate = '" + salePurchase.BillDate + "' "
                              + ", AccountMasterId= " + party
                              + ", modeId = " + mode
                              + ", BillNumber= '" + util.GetLOVName(salePurchase.BillNumber) + "' "
                              + ", Particulars= '" + salePurchase.particulars + "' "
                              + ", credit = " + salePurchase.SalePurchaseAmount
                              + ", CheckNumber= '" + salePurchase.CheckNumber + "' "
                              + ", subUserId = " + Util_BLL.User.Subusers[0].SubuserId
                              + Util_BLL.GetUserWhereCondition(Util_BLL.User)
                              + " AND LedgerNumber=" + ledger_number
                              + " AND drcr = 'C'";



            site.Execute(party_qry);
            site.Execute(mode_qry);
        }