Esempio n. 1
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);
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }
Esempio n. 4
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);
        }
Esempio n. 5
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);
            }
        }
Esempio n. 6
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);
        }