Пример #1
0
        private List <Upvc_invoiceitems> Collectitems(string vId)
        {
            List <Upvc_invoiceitems> list = new List <Upvc_invoiceitems>();

            for (int r = 0; r < editgrid.RowCount; r++)
            {
                Upvc_invoiceitems obj = new Upvc_invoiceitems();

                if (
                    (editgrid[UPVC_INVOICEITEMS.PRODUCT_ID, r].Value + "") == "" ||
                    (editgrid[UPVC_INVOICEITEMS.QTY, r].Value + "") == "" ||
                    (editgrid[UPVC_INVOICEITEMS.PRICE, r].Value + "") == ""
                    )
                {
                    //==LEAVE IT(the empty row).
                }
                else
                {
                    obj.Upvc_invoiceitems_id = "";
                    obj.Upvc_invoice_id      = vId;
                    obj.Product_id           = CProduct_exten.GetId_Name(editgrid[UPVC_INVOICEITEMS.PRODUCT_ID, r].Value + "");
                    obj.Pcrate       = (editgrid[UPVC_INVOICEITEMS.PCRATE, r].Value + "");
                    obj.Msm          = (editgrid[UPVC_INVOICEITEMS.MSM, r].Value + "");
                    obj.Widths       = ConvertTO.Decimal(editgrid[UPVC_INVOICEITEMS.WIDTHS, r].Value + "");
                    obj.Heights      = ConvertTO.Decimal(editgrid[UPVC_INVOICEITEMS.HEIGHTS, r].Value + "");
                    obj.TotalAreasq  = ConvertTO.Decimal(editgrid[UPVC_INVOICEITEMS.TOTALAREASQ, r].Value + "");
                    obj.Qty          = ConvertTO.Decimal(editgrid[UPVC_INVOICEITEMS.QTY, r].Value + "");
                    obj.Price        = ConvertTO.Decimal(editgrid[UPVC_INVOICEITEMS.PRICE, r].Value + "");
                    obj.Sgst_percent = ConvertTO.Decimal(editgrid[UPVC_INVOICEITEMS.SGST_PERCENT, r].Value + "");
                    obj.Cgst_percent = ConvertTO.Decimal(editgrid[UPVC_INVOICEITEMS.CGST_PERCENT, r].Value + "");
                    obj.Igst_percent = ConvertTO.Decimal(editgrid[UPVC_INVOICEITEMS.IGST_PERCENT, r].Value + "");
                    obj.Refered_id   = "";
                    obj.Locked       = Core.Unlocked;

                    list.Add(obj);
                }
            }

            if (list.Count != 0)
            {
                return(list);
            }

            return(null);
        }
Пример #2
0
        private List <Outwarditems> Collectitems(string vId)
        {
            List <Outwarditems> list = new List <Outwarditems>();

            for (int r = 0; r < editgrid.RowCount; r++)
            {
                Outwarditems obj = new Outwarditems();

                if (
                    (editgrid[OUTWARDITEMS.PRODUCT_ID, r].Value + "") == "" ||
                    (editgrid[OUTWARDITEMS.COLOURS_ID, r].Value + "") == "" ||
                    (editgrid[OUTWARDITEMS.SIZES_ID, r].Value + "") == "" ||
                    (editgrid[OUTWARDITEMS.QTY, r].Value + "") == ""
                    )
                {
                    //==LEAVE IT(the empty row).
                }
                else
                {
                    obj.Outwarditems_id = "";
                    obj.Outward_id      = vId;
                    obj.Style_id        = CStyle_exten.GetId_Name(Checks.Escape(editgrid[OUTWARDITEMS.STYLE_ID, r].Value + ""));
                    obj.Article_id      = CArticle_exten.GetId_Name(Checks.Escape(editgrid[OUTWARDITEMS.ARTICLE_ID, r].Value + ""));
                    obj.Product_id      = CProduct_exten.GetId_Name(Checks.Escape(editgrid[OUTWARDITEMS.PRODUCT_ID, r].Value + ""));
                    obj.Sizes_id        = CSizes_exten.GetId_Name(editgrid[OUTWARDITEMS.SIZES_ID, r].Value + "");
                    obj.Colours_id      = CColours_exten.GetId_Name(editgrid[OUTWARDITEMS.COLOURS_ID, r].Value + "");
                    obj.Qty             = (editgrid[OUTWARDITEMS.QTY, r].Value + "");
                    //obj.Refered_id = "";
                    obj.Locked = Core.Unlocked;

                    list.Add(obj);
                }
            }

            if (list.Count != 0)
            {
                return(list);
            }

            return(null);
        }
Пример #3
0
        private List <Styleitems> Collectitems(string vId)
        {
            List <Styleitems> list = new List <Styleitems>();

            for (int r = 0; r < editgrid.RowCount; r++)
            {
                Styleitems obj = new Styleitems();

                if (
                    (editgrid[STYLEITEMS.PRODUCT_ID, r].Value + "") == "" ||
                    (editgrid[STYLEITEMS.QTY, r].Value + "") == "" ||
                    (editgrid[STYLEITEMS.PRICE, r].Value + "") == ""
                    )
                {
                    //==LEAVE IT(the empty row).
                }
                else
                {
                    obj.Styleitems_id = "";
                    obj.Style_id      = vId;
                    obj.Style_no      = txt_style_no.Text;
                    obj.Article_id    = CArticle_exten.GetId_Name(editgrid[STYLEITEMS.ARTICLE_ID, r].Value + "");
                    obj.Product_id    = CProduct_exten.GetId_Name(editgrid[STYLEITEMS.PRODUCT_ID, r].Value + "");
                    obj.Colours_id    = CColours_exten.GetId_Name(editgrid[STYLEITEMS.COLOURS_ID, r].Value + "");
                    obj.Sizes_id      = CSizes_exten.GetId_Name(editgrid[STYLEITEMS.SIZES_ID, r].Value + "");
                    obj.Qty           = (editgrid[STYLEITEMS.QTY, r].Value + "");
                    obj.Price         = ConvertTO.Decimal(editgrid[STYLEITEMS.PRICE, r].Value + "");
                    obj.Refered_id    = "";
                    obj.Locked        = Core.Unlocked;

                    list.Add(obj);
                }
            }

            if (list.Count != 0)
            {
                return(list);
            }

            return(null);
        }
Пример #4
0
        private Article CollectData()
        {
            Article fobj = new Article()
            {
                Article_id = vId,
                Po_id      = CPo_exten.GetId_Name(txt_po_id.Text),
                Article_no = txt_article_no.Text,
                Product_id = CProduct_exten.GetId_Name(txt_product_id.Text),
                Hsncode_id = CHsncode_exten.GetId_Name(txt_hsncode_id.Text),
                Sizes_id   = CSizes_exten.GetId_Name(txt_sizes_id.Text),
                Colours_id = CColours_exten.GetId_Name(txt_colours_id.Text),
                Qty        = txt_qty.Text,
                Price      = ConvertTO.Decimal(txt_price.Text),
                Barcode    = txt_barcode.Text,
                Active_id  = Core.Stative,
                Notes      = txt_notes.Text,
                User_id    = Current.User
            };

            return(fobj);
        }
Пример #5
0
        private List <Quotationitems> Collectitems(string vId)
        {
            List <Quotationitems> list = new List <Quotationitems>();

            for (int r = 0; r < editgrid.RowCount; r++)
            {
                Quotationitems obj = new Quotationitems();

                if (
                    (editgrid[QUOTATIONITEMS.PRODUCT_ID, r].Value + "") == "" ||
                    (editgrid[QUOTATIONITEMS.QTY, r].Value + "") == "" ||
                    (editgrid[QUOTATIONITEMS.PRICE, r].Value + "") == ""
                    )
                {
                    //==LEAVE IT(the empty row).
                }
                else
                {
                    obj.Quotationitems_id = "";
                    obj.Quotation_id      = vId;
                    obj.Product_id        = CProduct_exten.GetId_Name(Checks.Escape(editgrid[QUOTATIONITEMS.PRODUCT_ID, r].Value + ""));
                    obj.Sizes_id          = CSizes_exten.GetId_Name(editgrid[QUOTATIONITEMS.SIZES_ID, r].Value + "");
                    obj.Qty        = (editgrid[QUOTATIONITEMS.QTY, r].Value + "");
                    obj.Price      = ConvertTO.Decimal(editgrid[QUOTATIONITEMS.PRICE, r].Value + "");
                    obj.Refered_id = "";
                    obj.Locked     = Core.Unlocked;

                    list.Add(obj);
                }
            }

            if (list.Count != 0)
            {
                return(list);
            }

            return(null);
        }
Пример #6
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);
            }
        }
Пример #7
0
        private List <Creditnoteitems> Collectitems(string vId)
        {
            List <Creditnoteitems> list = new List <Creditnoteitems>();

            for (int r = 0; r < editgrid.RowCount; r++)
            {
                Creditnoteitems obj = new Creditnoteitems();

                if (
                    (editgrid[CREDITNOTEITEMS.PRODUCT_ID, r].Value + "") == "" ||
                    (editgrid[CREDITNOTEITEMS.QTY, r].Value + "") == "" ||
                    (editgrid[CREDITNOTEITEMS.PRICE, r].Value + "") == ""
                    )
                {
                    //==LEAVE IT(the empty row).
                }
                else
                {
                    obj.Creditnoteitems_id = "";
                    obj.Creditnote_id      = vId;

                    if (Customised.WithPo == true)
                    {
                        obj.Po_no = Checks.Escape(editgrid[CREDITNOTEITEMS.PO_NO, r].Value + "");
                    }
                    else
                    {
                        obj.Po_no = "0";
                    }

                    if (Customised.WithDc == true)
                    {
                        obj.Dc_no = Checks.Escape(editgrid[CREDITNOTEITEMS.DC_NO, r].Value + "");
                    }
                    else
                    {
                        obj.Dc_no = "0";
                    }

                    obj.Product_id = CProduct_exten.GetId_Name(Checks.Escape(editgrid[CREDITNOTEITEMS.PRODUCT_ID, r].Value + ""));

                    if (Customised.WithSizes == true)
                    {
                        obj.Sizes_id = CSizes_exten.GetId_Name(editgrid[CREDITNOTEITEMS.SIZES_ID, r].Value + "");
                    }
                    else
                    {
                        obj.Sizes_id = "1";
                    }

                    if (Customised.WithColours == true)
                    {
                        obj.Colours_id = CColours_exten.GetId_Name(editgrid[CREDITNOTEITEMS.COLOURS_ID, r].Value + "");
                    }
                    else
                    {
                        obj.Colours_id = "1";
                    }


                    obj.Qty          = (editgrid[CREDITNOTEITEMS.QTY, r].Value + "");
                    obj.Price        = ConvertTO.Decimal(editgrid[CREDITNOTEITEMS.PRICE, r].Value + "");
                    obj.Cgst_percent = ConvertTO.Decimal(editgrid[CREDITNOTEITEMS.CGST_PERCENT, r].Value + "");
                    obj.Sgst_percent = ConvertTO.Decimal(editgrid[CREDITNOTEITEMS.SGST_PERCENT, r].Value + "");
                    obj.Igst_percent = ConvertTO.Decimal(editgrid[CREDITNOTEITEMS.IGST_PERCENT, r].Value + "");
                    obj.Refered_id   = "";
                    obj.Locked       = Core.Unlocked;

                    list.Add(obj);
                }
            }

            if (list.Count != 0)
            {
                return(list);
            }

            return(null);
        }
Пример #8
0
        private List <Purchaseitems> Collectitems(string vId)
        {
            List <Purchaseitems> list = new List <Purchaseitems>();

            for (int r = 0; r < editgrid.RowCount; r++)
            {
                Purchaseitems obj = new Purchaseitems();

                if (
                    (editgrid[PURCHASEITEMS.PRODUCT_ID, r].Value + "") == "" ||
                    (editgrid[PURCHASEITEMS.QTY, r].Value + "") == "" ||
                    (editgrid[PURCHASEITEMS.PRICE, r].Value + "") == ""
                    )
                {
                    //==LEAVE IT(the empty row).
                }
                else
                {
                    obj.Purchaseitems_id = "";
                    obj.Purchase_id      = vId;
                    obj.Purchase_no      = txt_purchase_no.Text;


                    //if (Customise.Purchase_poid_dcid == true)
                    //{
                    //    if (((editgrid[PURCHASEITEMS.PO_ID, r].Value + "") == "") || ((editgrid[PURCHASEITEMS.PO_ID, r].Value + "") == Core.Without_Po) || ((editgrid[PURCHASEITEMS.PO_ID, r].Value + "") == Core._Without_po_))
                    //    {
                    //        obj.Po_id = "1";
                    //        obj.Poitems_id = "1";
                    //    }
                    //    else
                    //    {

                    //        obj.Po_id = CPo_exten.GetId_Name(editgrid[PURCHASEITEMS.PO_ID, r].Value + "");
                    //        obj.Poitems_id = editgrid[PURCHASEITEMS.POITEMS_ID, r].Value + "";
                    //    }
                    //}

                    //if (Customise.Purchase_pono_dcno == true)
                    //{
                    //    obj.Po_id = (editgrid[PURCHASEITEMS.PO_ID, r].Value + "");
                    //    obj.Poitems_id = editgrid[PURCHASEITEMS.POITEMS_ID, r].Value + "";
                    //}

                    //if (Customise.Purchase_poid_dcid == true)
                    //{
                    //    if (((editgrid[PURCHASEITEMS.DC_ID, r].Value + "") == "") || ((editgrid[PURCHASEITEMS.DC_ID, r].Value + "") == Core.Without_Dc) || ((editgrid[PURCHASEITEMS.DC_ID, r].Value + "") == "0"))
                    //    {
                    //        obj.Dc_id = "1";
                    //        obj.Dcitems_id = "1";
                    //    }
                    //    else
                    //    {
                    //        obj.Dc_id = CDc_exten.GetId_Name(editgrid[PURCHASEITEMS.DC_ID, r].Value + "");
                    //        obj.Dcitems_id = (editgrid[PURCHASEITEMS.DCITEMS_ID, r].Value + "");
                    //        if (obj.Dcitems_id == "") { obj.Dcitems_id = "1"; }
                    //    }
                    //}

                    //if (Customise.Purchase_pono_dcno == true)
                    //{
                    //    obj.Dc_id = (editgrid[PURCHASEITEMS.DC_ID, r].Value + "");
                    //    obj.Dcitems_id = (editgrid[PURCHASEITEMS.DCITEMS_ID, r].Value + "");
                    //}

                    obj.Product_id   = CProduct_exten.GetId_Name(Checks.Escape(editgrid[PURCHASEITEMS.PRODUCT_ID, r].Value + ""));
                    obj.Qty          = ConvertTO.Decimal(editgrid[PURCHASEITEMS.QTY, r].Value + "");
                    obj.Price        = ConvertTO.Decimal(editgrid[PURCHASEITEMS.PRICE, r].Value + "");
                    obj.Cgst_percent = ConvertTO.Decimal(editgrid[PURCHASEITEMS.CGST_PERCENT, r].Value + "");
                    obj.Sgst_percent = ConvertTO.Decimal(editgrid[PURCHASEITEMS.SGST_PERCENT, r].Value + "");
                    obj.Igst_percent = ConvertTO.Decimal(editgrid[PURCHASEITEMS.IGST_PERCENT, r].Value + "");
                    obj.Refered_id   = "";
                    obj.Locked       = Core.Unlocked;

                    list.Add(obj);
                }
            }

            if (list.Count != 0)
            {
                return(list);
            }

            return(null);
        }