示例#1
0
        private Const.Invoice CollectData()
        {
            Const.Invoice fobj = new Const.Invoice()
            {
                Invoice_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, "", "", ""),

                Invoice_no           = txt_invoice_no.Text,
                Invoice_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);
        }
示例#2
0
        private Upvc_Quotation CollectData()
        {
            Upvc_Quotation fobj = new Upvc_Quotation()
            {
                Upvc_Quotation_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),
                Quotation_no         = txt_invoice_no.Text,
                Quotation_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);
        }
示例#3
0
        private static void InsertData(Invoice.Const.Invoice obj, List <Invoiceitems> items, string newDB)
        {
            DAL dalsession;

            try
            {
                dalsession = new DAL();
                dalsession.BeginTransaction();

                List <Invoiceitems> list_new = new List <Invoiceitems>();
                if (obj != null)
                {
                    if (CheckData(obj, newDB) != true)
                    {
                        Invoice.Const.Invoice obj_new = new Invoice.Const.Invoice
                        {
                            Uniqueno             = obj.Uniqueno,
                            Company_id           = obj.Company_id,
                            Acy_id               = obj.Acy_id,
                            Order_id             = "1",
                            Invoice_no           = obj.Invoice_no,
                            Invoice_date         = obj.Invoice_date,
                            Party_id             = CParty_exten.GetId_Name(obj.Party_id),
                            Taxtype_id           = CTaxtype_exten.GetId_Name(obj.Taxtype_id),
                            Salestype_id         = CSalestype_exten.GetId_Name(obj.Salestype_id),
                            Transport_id         = CTransport_exten.GetId_Name(obj.Transport_id),
                            Deliveredto_id       = CDeliveredto_exten.GetId_Name(obj.Deliveredto_id),
                            Bundel               = obj.Bundel,
                            Total_qty            = obj.Total_qty,
                            Total_taxable_amount = obj.Total_taxable_amount,
                            Total_cgst           = obj.Total_cgst,
                            Total_sgst           = obj.Total_sgst,
                            Total_igst           = obj.Total_igst,
                            Gsttotal             = obj.Gsttotal,
                            Ledger_id            = CLedger_exten.GetName_Id(obj.Ledger_id),
                            Additional           = obj.Additional,
                            Rounds               = obj.Rounds,
                            Grandtotal           = obj.Grandtotal,
                            Refered_amt          = obj.Refered_amt,
                            Locked               = obj.Locked,
                            Notes     = obj.Notes,
                            Active_id = obj.Active_id,
                            User_id   = "1"
                        };

                        //switch (obj.Company_id)
                        //{
                        //    case "1":
                        //        obj_new.Company_id = "1";
                        //        obj_new.Acy_id = "1";
                        //        break;

                        //    case "3":
                        //        obj_new.Company_id = "1";
                        //        obj_new.Acy_id = "2";
                        //        break;

                        //    case "4":
                        //        obj_new.Company_id = "1";
                        //        obj_new.Acy_id = "3";
                        //        break;

                        //}

                        obj_new.Uniqueno = obj_new.Acy_id + "~" + obj_new.Company_id + "~" + obj_new.Invoice_no;


                        Invoice.Class.CInvoice.Insert(obj_new, dalsession);
                        var vId = DAL.GetIdentity(dalsession);

                        for (int k = 0; k < items.Count; k++)
                        {
                            Invoiceitems v = new Invoiceitems()
                            {
                                Invoice_id   = vId,
                                Po_no        = "",
                                Dc_no        = "",
                                Product_id   = CProduct_exten.GetId_Name(items[k].Product_id),
                                Sizes_id     = CSizes_exten.GetId_Name(items[k].Sizes_id),
                                Colours_id   = "1",
                                Qty          = items[k].Qty,
                                Price        = items[k].Price,
                                Cgst_percent = items[k].Cgst_percent,
                                Sgst_percent = items[k].Sgst_percent,
                                Igst_percent = items[k].Igst_percent,
                                Refered_id   = items[k].Refered_id,
                                Locked       = items[k].Locked
                            };
                            list_new.Add(v);
                        }

                        Invoice.Class.CInvoiceitems.Insert(list_new, dalsession);
                        dalsession.Commit();
                    }
                }
            }
            catch (Exception ex)

            {
                MessageBox.Show("error : " + ex);
            }
        }
示例#4
0
 void Txt_transport_LookupUpdate(object sender, EventArgs e)
 {
     txt_transport_id.LookupList = CTransport_exten.GetforLookup(new DAL());
 }