private void InsertOrUpdateTransection(string tranid, string date, string no, string totalamount, string drledgerid, string crledgerid, string transectiontype, string Mode, string BankName, string ChequeNo, string ChequeDate) { string transectionid = tranid; if (mReceiptNoForEdit.ISNullOrWhiteSpace()) { mquery = "Insert into Transection(TransectionID, Date, No, TransectionType, LedgerIdFrom, " + "LedgerIdTo, Amount_Dr,Mode,BankName, ChequeNo, ChequeDate) values('" + transectionid + "','" + date + "','" + no + "','" + transectiontype + "','" + drledgerid + "','" + crledgerid + "'," + totalamount + "," + Mode + "," + BankName + "," + ChequeNo + "," + ChequeDate + ")"; mlistquery.Add(mquery); transectionid = Guid.NewGuid().ToString(); mquery = "Insert into Transection(TransectionID, Date, No, TransectionType, LedgerIdFrom, " + "LedgerIdTo, Amount_Cr,Mode,BankName, ChequeNo, ChequeDate) values('" + transectionid + "','" + date + "','" + no + "','" + transectiontype + "','" + crledgerid + "','" + drledgerid + "'," + totalamount + "," + Mode + "," + BankName + "," + ChequeNo + "," + ChequeDate + ")"; mlistquery.Add(mquery); } else { TransectionTools.GetTransectionId(no, transectiontype); mquery = "Update Transection Set Date='" + date + "',LedgerIdFrom='" + drledgerid + "', " + "LedgerIdTo='" + crledgerid + "', Amount_Dr=" + totalamount + ",Mode=" + Mode + ",bankname=" + BankName + ",ChequeNo=" + ChequeNo + ",ChequeDate=" + ChequeDate + " where TransectionID='" + TransectionTools._mTransectionIdList[0] + "'"; mlistquery.Add(mquery); mquery = "Update Transection Set Date='" + date + "',LedgerIdFrom='" + crledgerid + "', " + "LedgerIdTo='" + drledgerid + "', Amount_Cr=" + totalamount + ",Mode=" + Mode + ",bankname=" + BankName + ",ChequeNo=" + ChequeNo + ",ChequeDate=" + ChequeDate + " where TransectionID='" + TransectionTools._mTransectionIdList[1] + "'"; mlistquery.Add(mquery); } }
private void InsertOrUpdateTransection(string date, string no, double totalamount, string drledgerid, string crledgerid, string transectiontype, string chequeNo, string chequeDate, string transectionMode, string narration) { string transectionid = Guid.NewGuid().ToString(); string query = ""; if (mSlNoEdit.ISNullOrWhiteSpace()) { query = "Insert into Transection(TransectionID, Date, No, TransectionType, LedgerIdFrom, " + "LedgerIdTo, Amount_Dr, Mode, ChequeNo, ChequeDate,Narration) values('" + transectionid + "','" + date + "','" + no + "','" + transectiontype + "','" + drledgerid + "','" + crledgerid + "'," + totalamount + ",'" + transectionMode + "','" + chequeNo + "','" + chequeDate + "','" + narration + "')"; mLstQuery.Add(query); transectionid = Guid.NewGuid().ToString(); query = "Insert into Transection(TransectionID, Date, No, TransectionType, LedgerIdFrom, " + "LedgerIdTo, Amount_Cr, Mode, ChequeNo, ChequeDate,Narration) values('" + transectionid + "','" + date + "','" + no + "','" + transectiontype + "','" + crledgerid + "','" + drledgerid + "'," + totalamount + ",'" + transectionMode + "','" + chequeNo + "','" + chequeDate + "','" + narration + "')"; mLstQuery.Add(query); } else { TransectionTools.GetTransectionId(mSlNoEdit, transectiontype); query = "Update Transection Set Date='" + date + "',LedgerIdFrom='" + drledgerid + "', " + "LedgerIdTo='" + crledgerid + "', Amount_Dr=" + totalamount + ",Mode='" + transectionMode + "',ChequeNo='" + chequeNo + "',ChequeDate='" + chequeDate + "',Narration='" + narration + "' where TransectionID='" + TransectionTools._mTransectionIdList[0] + "'"; mLstQuery.Add(query); query = "Update Transection Set Date='" + date + "',LedgerIdFrom='" + crledgerid + "', " + "LedgerIdTo='" + drledgerid + "', Amount_Cr=" + totalamount + ",Mode='" + transectionMode + "',ChequeNo='" + chequeNo + "',ChequeDate='" + chequeDate + "',Narration='" + narration + "' where TransectionID='" + TransectionTools._mTransectionIdList[1] + "'"; mLstQuery.Add(query); } }