public static void Update(Upvc_invoice v, DAL dalsession) { string q = "UPDATE " + UPVC_INVOICE.UPVC_INVOICE_TBL + " SET"; q += " " + UPVC_INVOICE.UNIQUENO + " = @" + UPVC_INVOICE.UNIQUENO + "@ \r\n "; q += "," + UPVC_INVOICE.COMPANY_ID + " = @" + UPVC_INVOICE.COMPANY_ID + "@ \r\n "; q += "," + UPVC_INVOICE.ACY_ID + " = @" + UPVC_INVOICE.ACY_ID + "@ \r\n"; q += "," + UPVC_INVOICE.TAXTYPE_ID + " = @" + UPVC_INVOICE.TAXTYPE_ID + "@ \r\n "; q += "," + UPVC_INVOICE.SALESTYPE_ID + " = @" + UPVC_INVOICE.SALESTYPE_ID + "@ \r\n "; q += "," + UPVC_INVOICE.INVOICE_NO + " = @" + UPVC_INVOICE.INVOICE_NO + "@ \r\n "; q += "," + UPVC_INVOICE.INVOICE_DATE + " = @" + UPVC_INVOICE.INVOICE_DATE + "@ \r\n "; q += "," + UPVC_INVOICE.PARTY_ID + " = @" + UPVC_INVOICE.PARTY_ID + "@ \r\n "; q += "," + UPVC_INVOICE.DELIVEREDTO_ID + " = @" + UPVC_INVOICE.DELIVEREDTO_ID + "@ \r\n "; q += "," + UPVC_INVOICE.TRANSPORT_ID + " = @" + UPVC_INVOICE.TRANSPORT_ID + "@ \r\n "; q += "," + UPVC_INVOICE.VEHICLE_NO + " = @" + UPVC_INVOICE.VEHICLE_NO + "@ \r\n "; q += "," + UPVC_INVOICE.TOTAL_QTY + " = @" + UPVC_INVOICE.TOTAL_QTY + "@ \r\n "; q += "," + UPVC_INVOICE.TOTAL_AREASQ + " = @" + UPVC_INVOICE.TOTAL_AREASQ + "@ \r\n "; q += "," + UPVC_INVOICE.TOTAL_TAXABLE_AMOUNT + " = @" + UPVC_INVOICE.TOTAL_TAXABLE_AMOUNT + "@ \r\n "; q += "," + UPVC_INVOICE.TOTAL_CGST + " = @" + UPVC_INVOICE.TOTAL_CGST + "@ \r\n "; q += "," + UPVC_INVOICE.TOTAL_SGST + " = @" + UPVC_INVOICE.TOTAL_SGST + "@ \r\n "; q += "," + UPVC_INVOICE.TOTAL_IGST + " = @" + UPVC_INVOICE.TOTAL_IGST + "@ \r\n "; q += "," + UPVC_INVOICE.GSTTOTAL + " = @" + UPVC_INVOICE.GSTTOTAL + "@ \r\n "; q += "," + UPVC_INVOICE.LEDGER_ID + " = @" + UPVC_INVOICE.LEDGER_ID + "@ \r\n "; q += "," + UPVC_INVOICE.ADDITIONAL + " = @" + UPVC_INVOICE.ADDITIONAL + "@ \r\n "; q += "," + UPVC_INVOICE.ROUNDS + " = @" + UPVC_INVOICE.ROUNDS + "@ \r\n "; q += "," + UPVC_INVOICE.GRANDTOTAL + " = @" + UPVC_INVOICE.GRANDTOTAL + "@ \r\n "; q += "," + UPVC_INVOICE.REFERED_NO + " = @" + UPVC_INVOICE.REFERED_NO + "@ \r\n "; q += "," + UPVC_INVOICE.LOCKED + " = @" + UPVC_INVOICE.LOCKED + "@ \r\n "; q += "," + UPVC_INVOICE.NOTES + " = @" + UPVC_INVOICE.NOTES + "@ \r\n "; q += "," + UPVC_INVOICE.ACTIVE_ID + " = @" + UPVC_INVOICE.ACTIVE_ID + "@ \r\n "; q += "," + UPVC_INVOICE.USER_ID + " = @" + UPVC_INVOICE.USER_ID + "@ \r\n "; q += " WHERE " + UPVC_INVOICE.UPVC_INVOICE_ID + " = @" + UPVC_INVOICE.UPVC_INVOICE_ID + "@ "; q = AttachParams(q, v); dalsession.Execute(q); }
private static string AttachParams(string q, Upvc_invoice v) { q = q.Replace("@" + UPVC_INVOICE.UPVC_INVOICE_ID + "@", "" + ConvertTO.SqlString(v.Upvc_invoice_id) + ""); q = q.Replace("@" + UPVC_INVOICE.UNIQUENO + "@", "" + ConvertTO.SqlString(v.Uniqueno) + ""); q = q.Replace("@" + UPVC_INVOICE.COMPANY_ID + "@", "" + ConvertTO.SqlString(v.Company_id) + ""); q = q.Replace("@" + UPVC_INVOICE.ACY_ID + "@", "" + ConvertTO.SqlString(v.Acy_id) + ""); q = q.Replace("@" + UPVC_INVOICE.TAXTYPE_ID + "@", "" + ConvertTO.SqlString(v.Taxtype_id) + ""); q = q.Replace("@" + UPVC_INVOICE.SALESTYPE_ID + "@", "" + ConvertTO.SqlString(v.Salestype_id) + ""); q = q.Replace("@" + UPVC_INVOICE.INVOICE_NO + "@", "" + ConvertTO.SqlString(v.Invoice_no) + ""); q = q.Replace("@" + UPVC_INVOICE.INVOICE_DATE + "@", "" + ConvertTO.SqlDate(v.Invoice_date) + ""); q = q.Replace("@" + UPVC_INVOICE.PARTY_ID + "@", "" + ConvertTO.SqlString(v.Party_id) + ""); q = q.Replace("@" + UPVC_INVOICE.DELIVEREDTO_ID + "@", "" + ConvertTO.SqlString(v.Delivered_id) + ""); q = q.Replace("@" + UPVC_INVOICE.TRANSPORT_ID + "@", "" + ConvertTO.SqlString(v.Transport_id) + ""); q = q.Replace("@" + UPVC_INVOICE.VEHICLE_NO + "@", "" + ConvertTO.SqlString(v.Vehicle_no) + ""); q = q.Replace("@" + UPVC_INVOICE.TOTAL_QTY + "@", "" + ConvertTO.SqlString(v.Total_qty + "")); q = q.Replace("@" + UPVC_INVOICE.TOTAL_AREASQ + "@", "" + ConvertTO.SqlString(v.Total_areasq + "")); q = q.Replace("@" + UPVC_INVOICE.TOTAL_TAXABLE_AMOUNT + "@", "" + ConvertTO.SqlString(v.Total_taxable_amount + "")); q = q.Replace("@" + UPVC_INVOICE.TOTAL_CGST + "@", "" + ConvertTO.SqlString(v.Total_cgst + "")); q = q.Replace("@" + UPVC_INVOICE.TOTAL_SGST + "@", "" + ConvertTO.SqlString(v.Total_sgst + "")); q = q.Replace("@" + UPVC_INVOICE.TOTAL_IGST + "@", "" + ConvertTO.SqlString(v.Total_igst + "")); q = q.Replace("@" + UPVC_INVOICE.GSTTOTAL + "@", "" + ConvertTO.SqlString(v.Gsttotal + "")); q = q.Replace("@" + UPVC_INVOICE.LEDGER_ID + "@", "" + ConvertTO.SqlString(v.Ledger_id) + ""); q = q.Replace("@" + UPVC_INVOICE.ADDITIONAL + "@", "" + ConvertTO.SqlString(v.Additional + "")); q = q.Replace("@" + UPVC_INVOICE.ROUNDS + "@", "" + ConvertTO.SqlString(v.Rounds + "")); q = q.Replace("@" + UPVC_INVOICE.GRANDTOTAL + "@", "" + ConvertTO.SqlString(v.Grandtotal + "")); q = q.Replace("@" + UPVC_INVOICE.REFERED_NO + "@", "" + ConvertTO.SqlString(v.Refered_no + "")); q = q.Replace("@" + UPVC_INVOICE.LOCKED + "@", "" + ConvertTO.SqlString(v.Locked) + ""); q = q.Replace("@" + UPVC_INVOICE.NOTES + "@", "" + ConvertTO.SqlString(v.Notes) + ""); q = q.Replace("@" + UPVC_INVOICE.ACTIVE_ID + "@", "" + ConvertTO.SqlString(v.Active_id) + ""); q = q.Replace("@" + UPVC_INVOICE.USER_ID + "@", "" + ConvertTO.SqlString(v.User_id) + ""); return(q); }
public static string GetName_Id(string Id) { Upvc_invoice obj = PKId(Id, new DAL()); if (obj != null) { return(obj.Invoice_no); } return(""); }
public static bool LockStatus(string pkValue) { if (pkValue != null) { Upvc_invoice obj = PKId(pkValue, new DAL()); if (obj.Locked == Core.Unlocked) { return(false); } } return(true); }
private List <PUpvcSales> CollectSales(string id) { List <PUpvcSales> list = new List <PUpvcSales>(); CXCORE.Company company = CXCORE.CCompany_exten.PKId(Current.Company_id); Upvc_invoice invoice = CUpvc_invoice_exten.PKId(id, new DAL()); CXCORE.Party party = CXCORE.CParty_exten.PKId(invoice.Party_id, new DAL()); CXCORE.Party consignee = CXCORE.CParty_exten.PKId(invoice.Party_id, new DAL()); PUpvcSales obj = new PUpvcSales() { Company_name = company.Company_name, Company_address = company.Street1 + "" + company.Street2 + "" + company.City_id + "" + company.State_id + " ", Company_address_1 = company.Email + "" + company.Website, Company_gstin = company.Gstin + "" + company.Cell1, Invoice_no = invoice.Invoice_no, Invoice_date = invoice.Invoice_date, billtobill = invoice.Taxtype_id, Sales_type = invoice.Salestype_id, PlaceOfSupply = invoice.Delivered_id, Party_name = party.Party_name, Party_adress = party.Street_1 + "" + party.Street_2, Party_adress_1 = party.City_id + "" + party.Pincode_id, Party_gstin = party.Gstin, Consignee_name = consignee.Party_name, Consignee_address = consignee.Street_1 + "" + consignee.Street_2, Consignee_address_1 = consignee.City_id + "" + consignee.Pincode_id, Consignee_gstin = consignee.Gstin, Transport = invoice.Transport_id, Taxable_value = invoice.Total_taxable_amount.ToString(), Cgst_tax = invoice.Total_cgst.ToString(), Sgst_tax = invoice.Total_sgst.ToString(), Gst_total = invoice.Gsttotal.ToString(), Roundoff = invoice.Rounds.ToString(), GrandTotal = invoice.Grandtotal.ToString(), Amountinwords = Global.AmountInWords(invoice.Grandtotal), }; list.Add(obj); return(list); }
public void SetAction(BtnEvent pAction, string pPkValue) { fAction = pAction; switch (fAction) { case BtnEvent.Open: btn_save.Text = "&CLOSE"; obj = CUpvc_invoice_exten.PKId(pPkValue, new DAL()); list = CUpvc_invoiceitems_exten.FKId(pPkValue, new DAL()); this.EnableControls(false); break; case BtnEvent.New: btn_save.Text = "&SAVE"; obj = CUpvc_invoice.GetNew(); list = new List <Upvc_invoiceitems>(); this.EnableControls(true); break; case BtnEvent.Edit: btn_save.Text = "&UPDATE"; obj = CUpvc_invoice_exten.PKId(pPkValue, new DAL()); list = CUpvc_invoiceitems_exten.FKId(pPkValue, new DAL()); this.EnableControls(true); break; case BtnEvent.Delete: btn_save.Text = "CONFIRM\r\n&DELETE"; obj = CUpvc_invoice_exten.PKId(pPkValue, new DAL()); list = CUpvc_invoiceitems_exten.FKId(pPkValue, new DAL()); this.EnableControls(false); break; case BtnEvent.Print: btn_save.Text = "&PRINT"; obj = CUpvc_invoice_exten.PKId(pPkValue, new DAL()); list = CUpvc_invoiceitems_exten.FKId(pPkValue, new DAL()); this.EnableControls(false); print_panel.Show(); break; } LoadData(obj); Loaditems(list); }
private static List <Upvc_invoice> EntityList(string q) { List <Upvc_invoice> list = new List <Upvc_invoice>(); using (IDataReader redr = new DAL().Listreader(q)) { while (redr.Read() == true) { Upvc_invoice obj = new Upvc_invoice() { Upvc_invoice_id = redr[UPVC_INVOICE.UPVC_INVOICE_ID].ToString(), Company_id = redr[UPVC_INVOICE.COMPANY_ID].ToString(), Acy_id = redr[UPVC_INVOICE.ACY_ID].ToString(), Taxtype_id = redr[TAXTYPE.TAXTYPE_ID].ToString(), Salestype_id = redr[SALESTYPE.SALESTYPE_NAME].ToString(), Invoice_no = redr[UPVC_INVOICE.INVOICE_NO].ToString(), Invoice_date = redr[UPVC_INVOICE.INVOICE_DATE].ToString(), Party_id = redr[PARTY.PARTY_NAME].ToString(), Delivered_id = redr[UPVC_INVOICE.DELIVEREDTO_ID].ToString(), Transport_id = redr[TRANSPORT.TRANSPORT_NAME].ToString(), Vehicle_no = redr[UPVC_INVOICE.VEHICLE_NO].ToString(), Total_qty = ConvertTO.Decimal(redr[UPVC_INVOICE.TOTAL_QTY].ToString()), Total_areasq = ConvertTO.Decimal(redr[UPVC_INVOICE.TOTAL_AREASQ].ToString()), Total_taxable_amount = ConvertTO.Decimal(redr[UPVC_INVOICE.TOTAL_TAXABLE_AMOUNT].ToString()), Total_cgst = ConvertTO.Decimal(redr[UPVC_INVOICE.TOTAL_CGST].ToString()), Total_sgst = ConvertTO.Decimal(redr[UPVC_INVOICE.TOTAL_SGST].ToString()), Total_igst = ConvertTO.Decimal(redr[UPVC_INVOICE.TOTAL_IGST].ToString()), Gsttotal = ConvertTO.Decimal(redr[UPVC_INVOICE.GSTTOTAL].ToString()), Ledger_id = redr[UPVC_INVOICE.LEDGER_ID].ToString(), Additional = ConvertTO.Decimal(redr[UPVC_INVOICE.ADDITIONAL].ToString()), Rounds = ConvertTO.Decimal(redr[UPVC_INVOICE.ROUNDS].ToString()), Grandtotal = ConvertTO.Decimal(redr[UPVC_INVOICE.GRANDTOTAL].ToString()), Refered_no = ConvertTO.Decimal(redr[UPVC_INVOICE.REFERED_NO].ToString()), Locked = redr[UPVC_INVOICE.LOCKED].ToString(), Notes = redr[UPVC_INVOICE.NOTES].ToString(), Active_id = redr[UPVC_INVOICE.ACTIVE_ID].ToString(), User_id = redr[USER.USER_NAME].ToString() }; list.Add(obj); } redr.Close(); } return(list); }
private void LoadData(Upvc_invoice obj) { vId = obj.Upvc_invoice_id; Core.TaxType = obj.Taxtype_id; SetTaxtype(); txt_taxtype_id.Text = obj.Taxtype_id; txt_salestype_id.Text = obj.Salestype_id; txt_invoice_no.Text = obj.Invoice_no; txt_invoice_date.Text = obj.Invoice_date; txt_party_id.Text = obj.Party_id; txt_Delivered_id.Text = CParty_exten.GetName_Id(obj.Delivered_id); txt_transport_id.Text = obj.Transport_id; txt_vehicle_no.Text = obj.Vehicle_no; txt_total_qty.Text = obj.Total_qty.ToString(); txt_gsttotal.Text = obj.Gsttotal.ToString(); txt_ledger_id.Text = obj.Ledger_id; txt_additional.Text = obj.Additional.ToString(); txt_grandtotal.Text = obj.Grandtotal.ToString(); txt_notes.Text = obj.Notes; Core.Stative = obj.Active_id; Setactives(); }
private Upvc_invoice CollectData() { Upvc_invoice fobj = new Upvc_invoice() { Upvc_invoice_id = vId, Uniqueno = Current.Acy_id + "~" + Current.Company_id + "~" + txt_invoice_no.Text, Company_id = Current.Company_id, Acy_id = Current.Acy_id, Taxtype_id = CTaxtype_exten.GetId_Name(txt_taxtype_id.Text), Salestype_id = CSalestype_exten.GetId_Name(txt_salestype_id.Text), Invoice_no = txt_invoice_no.Text, Invoice_date = txt_invoice_date.Text, Party_id = CParty_exten.GetId_Name(txt_party_id.Text), Delivered_id = CParty_exten.GetId_Name(txt_Delivered_id.Text), Transport_id = CTransport_exten.GetId_Name(txt_transport_id.Text), Vehicle_no = txt_vehicle_no.Text, Total_qty = ConvertTO.Decimal(txt_total_qty.Text), Total_areasq = ConvertTO.Decimal(vTotAreasq.ToString()), 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_no = ConvertTO.Decimal(txt_grandtotal.Text), Locked = Core.Unlocked, Active_id = Core.Stative, Notes = txt_notes.Text, User_id = Current.User }; return(fobj); }
public static Upvc_invoice GetNew() { Upvc_invoice obj = new Upvc_invoice { Upvc_invoice_id = string.Empty, Uniqueno = string.Empty, Company_id = Current.Company_id, Acy_id = Current.Acy_id, Taxtype_id = Core.SGST, Salestype_id = Core.B2B, Invoice_no = CUpvc_invoice_exten.GetNext_No, Invoice_date = string.Empty, Party_id = string.Empty, Delivered_id = string.Empty, Transport_id = Core.ByRoad, Vehicle_no = string.Empty, Total_qty = 0, Total_areasq = 0, Total_taxable_amount = 0, Total_cgst = 0, Total_sgst = 0, Total_igst = 0, Gsttotal = 0, Ledger_id = string.Empty, Additional = 0, Rounds = 0, Grandtotal = 0, Refered_no = 0, Locked = string.Empty, Notes = string.Empty, Active_id = Core.Active, User_id = Current.User }; return(obj); }