private static string AttachParams(string q, Const.Labour v) { q = q.Replace("@" + LABOUR.LABOUR_ID + "@", "" + ConvertTO.SqlString(v.Labour_id) + ""); q = q.Replace("@" + LABOUR.UNIQUENO + "@", "" + ConvertTO.SqlString(v.Uniqueno) + ""); q = q.Replace("@" + LABOUR.COMPANY_ID + "@", "" + ConvertTO.SqlString(v.Company_id) + ""); q = q.Replace("@" + LABOUR.ACY_ID + "@", "" + ConvertTO.SqlString(v.Acy_id) + ""); q = q.Replace("@" + LABOUR.ORDER_ID + "@", "" + ConvertTO.SqlString(v.Order_id) + ""); q = q.Replace("@" + LABOUR.LABOUR_NO + "@", "" + ConvertTO.SqlString(v.Labour_no) + ""); q = q.Replace("@" + LABOUR.LABOUR_DATE + "@", "" + ConvertTO.SqlDate(v.Labour_date) + ""); q = q.Replace("@" + LABOUR.TAXTYPE_ID + "@", "" + ConvertTO.SqlString(v.Taxtype_id) + ""); q = q.Replace("@" + LABOUR.SALESTYPE_ID + "@", "" + ConvertTO.SqlString(v.Salestype_id) + ""); q = q.Replace("@" + LABOUR.PARTY_ID + "@", "" + ConvertTO.SqlString(v.Party_id) + ""); q = q.Replace("@" + LABOUR.TRANSPORT_ID + "@", "" + ConvertTO.SqlString(v.Transport_id) + ""); q = q.Replace("@" + LABOUR.DELIVEREDTO_ID + "@", "" + ConvertTO.SqlString(v.Deliveredto_id) + ""); q = q.Replace("@" + LABOUR.BUNDEL + "@", "" + ConvertTO.SqlString(v.Bundel) + ""); q = q.Replace("@" + LABOUR.TOTAL_QTY + "@", "" + ConvertTO.SqlString(v.Total_qty) + ""); q = q.Replace("@" + LABOUR.TOTAL_TAXABLE_AMOUNT + "@", "" + ConvertTO.SqlDecimal(v.Total_taxable_amount) + ""); q = q.Replace("@" + LABOUR.TOTAL_CGST + "@", "" + ConvertTO.SqlDecimal(v.Total_cgst) + ""); q = q.Replace("@" + LABOUR.TOTAL_SGST + "@", "" + ConvertTO.SqlDecimal(v.Total_sgst) + ""); q = q.Replace("@" + LABOUR.TOTAL_IGST + "@", "" + ConvertTO.SqlDecimal(v.Total_igst) + ""); q = q.Replace("@" + LABOUR.GSTTOTAL + "@", "" + ConvertTO.SqlDecimal(v.Gsttotal) + ""); q = q.Replace("@" + LABOUR.LEDGER_ID + "@", "" + ConvertTO.SqlString(v.Ledger_id) + ""); q = q.Replace("@" + LABOUR.ADDITIONAL + "@", "" + ConvertTO.SqlDecimal(v.Additional) + ""); q = q.Replace("@" + LABOUR.ROUNDS + "@", "" + ConvertTO.SqlDecimal(v.Rounds) + ""); q = q.Replace("@" + LABOUR.GRANDTOTAL + "@", "" + ConvertTO.SqlDecimal(v.Grandtotal) + ""); q = q.Replace("@" + LABOUR.REFERED_AMT + "@", "" + ConvertTO.SqlDecimal(v.Refered_amt) + ""); q = q.Replace("@" + LABOUR.LOCKED + "@", "" + ConvertTO.SqlString(v.Locked) + ""); q = q.Replace("@" + LABOUR.NOTES + "@", "" + ConvertTO.SqlString(v.Notes) + ""); q = q.Replace("@" + LABOUR.ACTIVE_ID + "@", "" + ConvertTO.SqlString(v.Active_id) + ""); q = q.Replace("@" + LABOUR.USER_ID + "@", "" + ConvertTO.SqlString(v.User_id) + ""); return(q); }
public static void Update(Const.Labour v, DAL dalsession) { string q = "UPDATE " + LABOUR.LABOUR_TBL + " SET"; q += " " + LABOUR.UNIQUENO + " = @" + LABOUR.UNIQUENO + "@ \r\n "; q += "," + LABOUR.COMPANY_ID + " = @" + LABOUR.COMPANY_ID + "@ \r\n "; q += "," + LABOUR.ACY_ID + " = @" + LABOUR.ACY_ID + "@ \r\n "; q += "," + LABOUR.ORDER_ID + " = @" + LABOUR.ORDER_ID + "@ \r\n "; q += "," + LABOUR.LABOUR_NO + " = @" + LABOUR.LABOUR_NO + "@ \r\n "; q += "," + LABOUR.LABOUR_DATE + " = @" + LABOUR.LABOUR_DATE + "@ \r\n "; q += "," + LABOUR.TAXTYPE_ID + " = @" + LABOUR.TAXTYPE_ID + "@ \r\n "; q += "," + LABOUR.SALESTYPE_ID + " = @" + LABOUR.SALESTYPE_ID + "@ \r\n "; q += "," + LABOUR.PARTY_ID + " = @" + LABOUR.PARTY_ID + "@ \r\n "; q += "," + LABOUR.TRANSPORT_ID + " = @" + LABOUR.TRANSPORT_ID + "@ \r\n "; q += "," + LABOUR.DELIVEREDTO_ID + " = @" + LABOUR.DELIVEREDTO_ID + "@ \r\n "; q += "," + LABOUR.BUNDEL + " = @" + LABOUR.BUNDEL + "@ \r\n "; q += "," + LABOUR.TOTAL_QTY + " = @" + LABOUR.TOTAL_QTY + "@ \r\n "; q += "," + LABOUR.TOTAL_TAXABLE_AMOUNT + " = @" + LABOUR.TOTAL_TAXABLE_AMOUNT + "@ \r\n "; q += "," + LABOUR.TOTAL_CGST + " = @" + LABOUR.TOTAL_CGST + "@ \r\n "; q += "," + LABOUR.TOTAL_SGST + " = @" + LABOUR.TOTAL_SGST + "@ \r\n "; q += "," + LABOUR.TOTAL_IGST + " = @" + LABOUR.TOTAL_IGST + "@ \r\n "; q += "," + LABOUR.GSTTOTAL + " = @" + LABOUR.GSTTOTAL + "@ \r\n "; q += "," + LABOUR.LEDGER_ID + " = @" + LABOUR.LEDGER_ID + "@ \r\n "; q += "," + LABOUR.ADDITIONAL + " = @" + LABOUR.ADDITIONAL + "@ \r\n "; q += "," + LABOUR.ROUNDS + " = @" + LABOUR.ROUNDS + "@ \r\n "; q += "," + LABOUR.GRANDTOTAL + " = @" + LABOUR.GRANDTOTAL + "@ \r\n "; q += "," + LABOUR.REFERED_AMT + " = @" + LABOUR.REFERED_AMT + "@ \r\n "; q += "," + LABOUR.LOCKED + " = @" + LABOUR.LOCKED + "@ \r\n "; q += "," + LABOUR.NOTES + " = @" + LABOUR.NOTES + "@ \r\n "; q += "," + LABOUR.ACTIVE_ID + " = @" + LABOUR.ACTIVE_ID + "@ \r\n "; q += "," + LABOUR.USER_ID + " = @" + LABOUR.USER_ID + "@ \r\n "; q += " WHERE " + LABOUR.LABOUR_ID + " = @" + LABOUR.LABOUR_ID + "@ "; q = AttachParams(q, v); dalsession.Execute(q); }
public static string GetName_Id(string Id) { Const.Labour obj = PKId(Id); if (obj != null) { return(obj.Labour_no.ToString()); } return(""); }
public static bool LockStatus(string pkValue) { if (pkValue != null) { Const.Labour obj = PKId(pkValue); if (obj.Locked == Core.Unlocked) { return(false); } } return(true); }
private static List <Const.Labour> EntityList(string q) { List <Const.Labour> list = new List <Const.Labour>(); using (IDataReader redr = new DAL().Listreader(q)) { while (redr.Read() == true) { Const.Labour obj = new Const.Labour() { Labour_id = redr[LABOUR.LABOUR_ID].ToString(), Uniqueno = redr[LABOUR.UNIQUENO].ToString(), Company_id = redr[LABOUR.COMPANY_ID].ToString(), Acy_id = redr[LABOUR.ACY_ID].ToString(), Order_id = redr[ORDER.ORDER_NO].ToString(), Labour_no = redr[LABOUR.LABOUR_NO].ToString(), Labour_date = redr[LABOUR.LABOUR_DATE].ToString(), Party_id = redr[PARTY.PARTY_NAME].ToString(), Taxtype_id = redr[TAXTYPE.TAXTYPE_NAME].ToString(), Salestype_id = redr[SALESTYPE.SALESTYPE_NAME].ToString(), Transport_id = redr[TRANSPORT.TRANSPORT_NAME].ToString(), Deliveredto_id = redr[DELIVEREDTO.DELIVEREDTO_NAME].ToString(), Bundel = redr[LABOUR.BUNDEL].ToString(), Total_qty = redr[LABOUR.TOTAL_QTY].ToString(), Total_taxable_amount = ConvertTO.Decimal(redr[LABOUR.TOTAL_TAXABLE_AMOUNT].ToString()), Total_cgst = ConvertTO.Decimal(redr[LABOUR.TOTAL_CGST].ToString()), Total_sgst = ConvertTO.Decimal(redr[LABOUR.TOTAL_SGST].ToString()), Total_igst = ConvertTO.Decimal(redr[LABOUR.TOTAL_IGST].ToString()), Gsttotal = ConvertTO.Decimal(redr[LABOUR.GSTTOTAL].ToString()), Ledger_id = redr[LABOUR.LEDGER_ID].ToString(), Additional = ConvertTO.Decimal(redr[LABOUR.ADDITIONAL].ToString()), Rounds = ConvertTO.Decimal(redr[LABOUR.ROUNDS].ToString()), Grandtotal = ConvertTO.Decimal(redr[LABOUR.GRANDTOTAL].ToString()), Refered_amt = ConvertTO.Decimal(redr[LABOUR.REFERED_AMT].ToString()), Locked = redr[LABOUR.LOCKED].ToString(), Notes = redr[LABOUR.NOTES].ToString(), Active_id = redr[LABOUR.ACTIVE_ID].ToString(), User_id = redr[USER.USER_NAME].ToString() }; list.Add(obj); } redr.Close(); } return(list); }
public void SetAction(BtnEvent pAction, string pPkValue) { fAction = pAction; switch (fAction) { case BtnEvent.Open: btn_save.Text = "&CLOSE"; obj = CLabour_exten.PKId(pPkValue); list = CLabouritems_exten.FKId(pPkValue); this.EnableControls(false); break; case BtnEvent.New: btn_save.Text = "&SAVE"; obj = CLabour.GetNew; list = CLabouritems.GetNew; this.EnableControls(true); break; case BtnEvent.Edit: btn_save.Text = "&UPDATE"; obj = CLabour_exten.PKId(pPkValue); list = CLabouritems_exten.FKId(pPkValue); this.EnableControls(true); break; case BtnEvent.Delete: btn_save.Text = "CONFIRM\r\n&DELETE"; obj = CLabour_exten.PKId(pPkValue); list = CLabouritems_exten.FKId(pPkValue); this.EnableControls(false); break; case BtnEvent.Print: btn_save.Text = "&PRINT"; obj = CLabour_exten.PKId(pPkValue); list = CLabouritems_exten.FKId(pPkValue); this.EnableControls(false); print_panel.Show(); break; } LoadData(obj); Loaditems(list); }
private Const.Labour CollectData() { Const.Labour fobj = new Const.Labour() { Labour_id = vId, Uniqueno = Current.Acy_id + "~" + Current.Company_id + "~" + txt_invoice_no.Text, Company_id = Current.Company_id, //Div_id = Current.Div_id, Acy_id = Current.Acy_id, Order_id = COrder_exten.GetId_Name(txt_order_id.Text, "", "", ""), Labour_no = txt_invoice_no.Text, Labour_date = txt_invoice_date.Text, Party_id = CParty_exten.GetId_Name(txt_party_id.Text), Taxtype_id = CTaxtype_exten.GetId_Name(txt_taxtype_id.Text), Salestype_id = CSalestype_exten.GetId_Name(txt_salestype_id.Text), Transport_id = CTransport_exten.GetId_Name(txt_transport_id.Text), Deliveredto_id = CDeliveredto_exten.GetId_Name(txt_deliveredto_id.Text), Bundel = txt_bundel.Text, Total_qty = txt_total_qty.Text, Total_taxable_amount = ConvertTO.Decimal(vTotTaxable.ToString()), Total_cgst = ConvertTO.Decimal(vTotCgst.ToString()), Total_sgst = ConvertTO.Decimal(vTotSgst.ToString()), Total_igst = ConvertTO.Decimal(vTotIgst.ToString()), Gsttotal = ConvertTO.Decimal(txt_gsttotal.Text), Ledger_id = CLedger_exten.GetId_Name(txt_ledger_id.Text), Additional = ConvertTO.Decimal(txt_additional.Text), Rounds = ConvertTO.Decimal(vRoundoff.ToString()), Grandtotal = ConvertTO.Decimal(txt_grandtotal.Text), Refered_amt = ConvertTO.Decimal(txt_grandtotal.Text), Locked = Core.Unlocked, Active_id = Core.Stative, Notes = txt_notes.Text, User_id = Current.User }; return(fobj); }
private void LoadData(Const.Labour obj) { vId = obj.Labour_id; txt_order_id.Text = obj.Order_id; txt_invoice_no.Text = obj.Labour_no.ToString(); txt_invoice_date.Text = obj.Labour_date; txt_party_id.Text = obj.Party_id; txt_taxtype_id.Text = obj.Taxtype_id; SetTaxtype(); txt_salestype_id.Text = obj.Salestype_id; txt_transport_id.Text = obj.Transport_id; txt_deliveredto_id.Text = obj.Deliveredto_id; txt_bundel.Text = obj.Bundel; txt_total_qty.Text = obj.Total_qty.ToString(); //txt_total_taxable_amount.Text = obj.Total_taxable_amount; txt_gsttotal.Text = obj.Gsttotal.ToString(); txt_ledger_id.Text = CLedger_exten.GetName_Id(obj.Ledger_id); txt_additional.Text = obj.Additional.ToString(); txt_grandtotal.Text = obj.Grandtotal.ToString(); txt_balance.Text = CLabour_exten.GetBalance(CParty_exten.GetId_Name(txt_party_id.Text)).ToString(); txt_notes.Text = obj.Notes; Core.Stative = obj.Active_id; Setactives(); }
private static Print_LabourList ReturnLabour(string Id, List <PrintCopies> printcopies) { Const.Labour invoice = CLabour_exten.PKId(Id); List <Labouritems> invoiceitems = CLabouritems_exten.FKId(Id); Company company = CCompany_exten.PKId(Current.Company_id); Party party = CParty_exten.SearchName(invoice.Party_id, new DAL()); Company_bank cmpbank = CCompany_bank_exten.PKId("1"); Print_LabourList list = new Print_LabourList(); for (int i = 0; i < printcopies.Count; i++) { Print_Labour row = new Print_Labour(); row.COPY_NAME = printcopies[i].Copies; row.SALES_TYPE = invoice.Salestype_id; row.TAX_TYPE = invoice.Taxtype_id; row.COMPANY_NAME = company.Display_name; row.COMPANY_ADDRESS_1 = company.Street1 + ", " + company.Street2; row.COMPANY_ADDRESS_2 = company.City_id + "- " + company.Pincode_id + ", " + company.State_id + " - (" + Ccoreplus.GetStateCode(company.State_id) + ") . Email :- " + company.Email; row.COMPANY_PHONE = company.Phone; row.COMPANY_CELL1 = company.Cell1; row.COMPANY_CELL2 = company.Cell2; row.COMPANY_EMAIL = company.Email; row.COMPANY_WEBSITE = company.Website; if (company.Gstin.Trim().Length != 0) { row.COMPANY_GSTIN = "GSTIN : " + company.Gstin; if (company.Cell1.Trim().Length != 0) { row.COMPANY_GSTIN = "GSTIN : " + company.Gstin + " , Mobile : " + company.Cell1; if (company.Cell2.Trim().Length != 0) { row.COMPANY_GSTIN = "GSTIN : " + company.Gstin + " , Mobile : " + company.Cell1 + ", " + company.Cell2; } } } else { row.COMPANY_GSTIN = ""; } row.LABOUR_ID = invoice.Labour_id; row.LABOUR_NO = ":. " + invoice.Labour_no; row.LABOUR_DATE = ": " + ConvertTO.Date2S(invoice.Labour_date); row.TRANSPORT = ": " + invoice.Transport_id; row.DELIVERYTO = ": " + invoice.Deliveredto_id; row.BUNDEL = ": " + invoice.Bundel; row.PARTY_NAME = party.Party_name; row.PARTY_STREET_1 = party.Street_1 + ","; if (party.Street_2.Trim().Length != 0) { row.PARTY_STREET_2 = party.Street_2 + ","; } if (party.Pincode_id.Trim().Length == 6) { row.PARTY_CITY = party.City_id + " - :" + party.Pincode_id + ","; } else { row.PARTY_CITY = party.City_id + ","; } row.PARTY_STATE = party.State_id + " - (" + Ccoreplus.GetStateCode(party.State_id) + ")."; row.PARTY_STATE_CODE = ""; row.PARTY_COUNTRY = party.Country_id; row.PARTY_PINCODE = party.Pincode_id; if (party.Gstin.Trim().Length != 0) { row.PARTY_GSTIN = "GSTIN :" + party.Gstin; } row.TOTAL_QTY = invoice.Total_qty.ToString(); row.TAXABLE_VALUE = invoice.Total_taxable_amount.ToString(); if (Customised.TaxType == Core.SGST) { row.CGST_PERCENT = " Add CGST " + (invoiceitems[0].Cgst_percent.ToString()) + " %"; row.SGST_PERCENT = " Add SGST " + (invoiceitems[0].Sgst_percent.ToString()) + " %"; row.TOTAL_CGST = invoice.Total_cgst.ToString(); row.TOTAL_SGST = invoice.Total_sgst.ToString(); } else if (Customised.TaxType == Core.IGST) { row.CGST_PERCENT = ""; row.SGST_PERCENT = " Add IGST " + (invoiceitems[0].Igst_percent.ToString()) + " %"; row.TOTAL_CGST = ""; row.TOTAL_SGST = invoice.Total_igst.ToString(); } row.TOTAL_SUB = invoice.Grandtotal.ToString(); row.LEDGER = CLedger_exten.GetName_Id(invoice.Ledger_id); if (invoice.Additional != 0) { row.ADDITIONAL = invoice.Additional.ToString(); } else { row.ADDITIONAL = ""; } row.ROUNDS = invoice.Rounds.ToString(); row.GSTTOTAL = invoice.Gsttotal.ToString(); row.GRANDTOTAL = invoice.Grandtotal.ToString(); row.AMOUNT_IN_WORDS = "Rupees : " + Global.AmountInWords(invoice.Grandtotal); row.NOTES = invoice.Notes; row.ENTRY_BY = invoice.User_id; row.FORSIGN = company.Display_name; if (Customised.InvoiceWithBankDetails) { row.ACCOUNT_NO = "A/C NO : " + cmpbank.Account_number; row.IFSC_CODE = "IFSC CODE : " + cmpbank.Ifsc_code; row.BANK_NAME = "BANK NAME : " + cmpbank.Company_bank_name; row.BRANCH = "BRANCH : " + cmpbank.Branch_name; } else { row.ACCOUNT_NO = ""; row.IFSC_CODE = ""; row.BANK_NAME = ""; row.BRANCH = ""; } row.TERMS_1 = Message.TERMS_1; row.TERMS_2 = Message.TERMS_2; row.TERMS_3 = Message.TERMS_3; row.TERMS_4 = Customised.Terms_4; list.Add(row); } return(list); }