private static List <QReceipt> EntityList(string q) { List <QReceipt> list = new List <QReceipt>(); using (IDataReader redr = new DAL().Listreader(q)) { while (redr.Read() == true) { QReceipt obj = new QReceipt() { Qreceipt_id = redr[QRECEIPT.QRECEIPT_ID].ToString(), Qreceipt_no = redr[QRECEIPT.QRECEIPT_NO].ToString(), Qreceipt_date = redr[QRECEIPT.QRECEIPT_DATE].ToString(), Party_id = redr[PARTY.PARTY_NAME].ToString(), Receipttype_id = redr[RECEIPTTYPE.RECEIPTTYPE_NAME].ToString(), Cheq_no = redr[QRECEIPT.CHEQ_NO].ToString(), Qreceipt_amount = redr[QRECEIPT.QRECEIPT_AMOUNT].ToString(), Cheq_date = redr[QRECEIPT.CHEQ_DATE].ToString(), Bank_id = redr[QRECEIPT.BANK_ID].ToString(), Total_amount = redr[QRECEIPT.TOTAL_AMOUNT].ToString(), Notes = redr[QRECEIPT.NOTES].ToString(), Active_id = redr[QRECEIPT.ACTIVE_ID].ToString(), User_id = redr[USER.USER_NAME].ToString() }; list.Add(obj); } redr.Close(); } return(list); }
//#region[Lock Status] //public static bool LockStatus(string pkValue) //{ // if (pkValue != null) // { // Receipt obj = PKId(pkValue, new DAL()); // if (obj.Locked == Core.Unlocked) // { // return false; // } // } // return true; //} //#endregion[Lock Status] #region [Get id - No] public static string GetName_Id(string Id) { QReceipt obj = PKId(Id, new DAL()); if (obj != null) { return(obj.Qreceipt_no); } return(""); }
private void LoadData(QReceipt obj) { vId = obj.Qreceipt_id; txt_qreceipt_no.Text = obj.Qreceipt_no; txt_qreceipt_date.Text = obj.Qreceipt_date; txt_party_id.Text = obj.Party_id; txt_receipttype_id.Text = obj.Receipttype_id; txt_cheq_no.Text = obj.Cheq_no; txt_qreceipt_amount.Text = obj.Qreceipt_amount; txt_cheq_date.Text = obj.Cheq_date; txt_bank_id.Text = obj.Bank_id; txt_total_amount.Text = obj.Total_amount; txt_notes.Text = obj.Notes; Core.Stative = obj.Active_id; Setactives(); }
public void SetAction(BtnEvent pAction, string pPkValue) { fAction = pAction; switch (fAction) { case BtnEvent.Open: btn_save.Text = "&CLOSE"; obj = CQreceipt_exten.PKId(pPkValue, new DAL()); list = CQreceiptitems_exten.FKId(pPkValue, new DAL()); this.EnableControls(false); break; case BtnEvent.New: btn_save.Text = "&SAVE"; obj = CQreceipt.GetNew; list = CQreceiptitems.GetNew; this.EnableControls(true); break; case BtnEvent.Edit: btn_save.Text = "&UPDATE"; obj = CQreceipt_exten.PKId(pPkValue, new DAL()); list = CQreceiptitems_exten.FKId(pPkValue, new DAL()); this.EnableControls(true); break; case BtnEvent.Delete: btn_save.Text = "CONFIRM\r\n&DELETE"; obj = CQreceipt_exten.PKId(pPkValue, new DAL()); list = CQreceiptitems_exten.FKId(pPkValue, new DAL()); this.EnableControls(false); break; case BtnEvent.Print: btn_save.Text = "&PRINT"; obj = CQreceipt_exten.PKId(pPkValue, new DAL()); list = CQreceiptitems_exten.FKId(pPkValue, new DAL()); this.EnableControls(false); // print_panel.Show(); break; } LoadData(obj); Loaditems(list); }
private static string AttachParams(string q, QReceipt v) { q = q.Replace("@" + QRECEIPT.QRECEIPT_ID + "@", "" + ConvertTO.SqlString(v.Qreceipt_id) + ""); q = q.Replace("@" + QRECEIPT.UNIQUENO + "@", "" + ConvertTO.SqlString(v.Uniqueno) + ""); q = q.Replace("@" + QRECEIPT.COMPANY_ID + "@", "" + ConvertTO.SqlString(v.Company_id) + ""); q = q.Replace("@" + QRECEIPT.ACY_ID + "@", "" + ConvertTO.SqlString(v.Acy_id) + ""); q = q.Replace("@" + QRECEIPT.QRECEIPT_NO + "@", "" + ConvertTO.SqlString(v.Qreceipt_no) + ""); q = q.Replace("@" + QRECEIPT.QRECEIPT_DATE + "@", "" + ConvertTO.SqlDate(v.Qreceipt_date) + ""); q = q.Replace("@" + QRECEIPT.PARTY_ID + "@", "" + ConvertTO.SqlString(v.Party_id) + ""); q = q.Replace("@" + QRECEIPT.RECEIPTTYPE_ID + "@", "" + ConvertTO.SqlString(v.Receipttype_id) + ""); q = q.Replace("@" + QRECEIPT.CHEQ_NO + "@", "" + ConvertTO.SqlString(v.Cheq_no) + ""); q = q.Replace("@" + QRECEIPT.QRECEIPT_AMOUNT + "@", "" + ConvertTO.SqlString(v.Qreceipt_amount) + ""); q = q.Replace("@" + QRECEIPT.CHEQ_DATE + "@", "" + ConvertTO.SqlString(v.Cheq_date) + ""); q = q.Replace("@" + QRECEIPT.BANK_ID + "@", "" + ConvertTO.SqlString(v.Bank_id) + ""); q = q.Replace("@" + QRECEIPT.TOTAL_AMOUNT + "@", "" + ConvertTO.SqlString(v.Total_amount) + ""); q = q.Replace("@" + QRECEIPT.NOTES + "@", "" + ConvertTO.SqlString(v.Notes) + ""); q = q.Replace("@" + QRECEIPT.ACTIVE_ID + "@", "" + ConvertTO.SqlString(v.Active_id) + ""); q = q.Replace("@" + QRECEIPT.USER_ID + "@", "" + ConvertTO.SqlString(v.User_id) + ""); return(q); }
public static void Insert(QReceipt v, DAL dalsession) { string q = " INSERT INTO " + QRECEIPT.QRECEIPT_TBL + " ( "; q += " " + QRECEIPT.UNIQUENO + " \r\n "; q += "," + QRECEIPT.COMPANY_ID + " \r\n "; q += "," + QRECEIPT.ACY_ID + " \r\n "; q += "," + QRECEIPT.QRECEIPT_NO + " \r\n "; q += "," + QRECEIPT.QRECEIPT_DATE + " \r\n "; q += "," + QRECEIPT.PARTY_ID + " \r\n "; q += "," + QRECEIPT.RECEIPTTYPE_ID + " \r\n "; q += "," + QRECEIPT.CHEQ_NO + " \r\n "; q += "," + QRECEIPT.QRECEIPT_AMOUNT + " \r\n "; q += "," + QRECEIPT.CHEQ_DATE + " \r\n "; q += "," + QRECEIPT.BANK_ID + " \r\n "; q += "," + QRECEIPT.TOTAL_AMOUNT + " \r\n "; q += "," + QRECEIPT.NOTES + " \r\n "; q += "," + QRECEIPT.ACTIVE_ID + " \r\n "; q += "," + QRECEIPT.USER_ID + " \r\n "; q += " ) VALUES ( "; q += " @" + QRECEIPT.UNIQUENO + "@ \r\n "; q += ", @" + QRECEIPT.COMPANY_ID + "@ \r\n "; q += ", @" + QRECEIPT.ACY_ID + "@ \r\n "; q += ", @" + QRECEIPT.QRECEIPT_NO + "@ \r\n "; q += ", @" + QRECEIPT.QRECEIPT_DATE + "@ \r\n "; q += ", @" + QRECEIPT.PARTY_ID + "@ \r\n "; q += ", @" + QRECEIPT.RECEIPTTYPE_ID + "@ \r\n "; q += ", @" + QRECEIPT.CHEQ_NO + "@ \r\n "; q += ", @" + QRECEIPT.QRECEIPT_AMOUNT + "@ \r\n "; q += ", @" + QRECEIPT.CHEQ_DATE + "@ \r\n "; q += ", @" + QRECEIPT.BANK_ID + "@ \r\n "; q += ", @" + QRECEIPT.TOTAL_AMOUNT + "@ \r\n "; q += ", @" + QRECEIPT.NOTES + "@ \r\n "; q += ", @" + QRECEIPT.ACTIVE_ID + "@ \r\n "; q += ", @" + QRECEIPT.USER_ID + "@ \r\n "; q += " ) \r\n "; q = AttachParams(q, v); dalsession.Execute(q); }
public static void Update(QReceipt v, DAL dalsession) { string q = "UPDATE " + QRECEIPT.QRECEIPT_TBL + " SET"; q += " " + QRECEIPT.UNIQUENO + " = @" + QRECEIPT.UNIQUENO + "@ \r\n "; q += "," + QRECEIPT.COMPANY_ID + " = @" + QRECEIPT.COMPANY_ID + "@ \r\n "; q += "," + QRECEIPT.ACY_ID + " = @" + QRECEIPT.ACY_ID + "@ \r\n "; q += "," + QRECEIPT.QRECEIPT_NO + " = @" + QRECEIPT.QRECEIPT_NO + "@ \r\n "; q += "," + QRECEIPT.QRECEIPT_DATE + " = @" + QRECEIPT.QRECEIPT_DATE + "@ \r\n "; q += "," + QRECEIPT.PARTY_ID + " = @" + QRECEIPT.PARTY_ID + "@ \r\n "; q += "," + QRECEIPT.RECEIPTTYPE_ID + " = @" + QRECEIPT.RECEIPTTYPE_ID + "@ \r\n "; q += "," + QRECEIPT.CHEQ_NO + " = @" + QRECEIPT.CHEQ_NO + "@ \r\n "; q += "," + QRECEIPT.QRECEIPT_AMOUNT + " = @" + QRECEIPT.QRECEIPT_AMOUNT + "@ \r\n "; q += "," + QRECEIPT.CHEQ_DATE + " = @" + QRECEIPT.CHEQ_DATE + "@ \r\n "; q += "," + QRECEIPT.BANK_ID + " = @" + QRECEIPT.BANK_ID + "@ \r\n "; q += "," + QRECEIPT.TOTAL_AMOUNT + " = @" + QRECEIPT.TOTAL_AMOUNT + "@ \r\n "; q += "," + QRECEIPT.NOTES + " = @" + QRECEIPT.NOTES + "@ \r\n "; q += "," + QRECEIPT.ACTIVE_ID + " = @" + QRECEIPT.ACTIVE_ID + "@ \r\n "; q += "," + QRECEIPT.USER_ID + " = @" + QRECEIPT.USER_ID + "@ \r\n "; q += " WHERE " + QRECEIPT.QRECEIPT_ID + " = @" + QRECEIPT.QRECEIPT_ID + "@ "; q = AttachParams(q, v); dalsession.Execute(q); }
private QReceipt CollectData() { QReceipt fobj = new QReceipt() { Qreceipt_id = vId, Uniqueno = Current.Acy_id + "~" + Current.Company_id + "~" + txt_qreceipt_no.Text, Company_id = Current.Company_id, Acy_id = Current.Acy_id, Qreceipt_no = txt_qreceipt_no.Text, Qreceipt_date = txt_qreceipt_date.Text, Party_id = CParty_exten.GetId_Name(txt_party_id.Text), Receipttype_id = CReceipttype_exten.GetId_Name(txt_receipttype_id.Text), Cheq_no = txt_cheq_no.Text, Qreceipt_amount = txt_qreceipt_amount.Text, Cheq_date = txt_cheq_date.Text, Bank_id = GetBankid, Total_amount = txt_total_amount.Text, Active_id = Core.Stative, Notes = txt_notes.Text, User_id = Current.User }; return(fobj); }