public int updateSupplier(InventoryStockBO itemBO)
        {
            InventoryStock item   = convertInventoryStock(itemBO);
            int            status = maintainSupplierDA.updateSupplier(item);

            return(status);
        }
        public InventoryStockBO getItemByName(string itemName)
        {
            InventoryStock   item   = maintainSupplierDA.getItemByName(itemName);
            InventoryStockBO itemBo = convertStockBO(item);

            return(itemBo);
        }
        public InventoryStockBO convertInventoryStockBO(InventoryStock i)
        {
            ibo = new InventoryStockBO();
            ibo.ItemCategory = i.ItemCategory;

            return(ibo);
        }
Exemple #4
0
        protected void ddlItemName_SelectedIndexChanged(object sender, EventArgs e)
        {
            int count = Convert.ToInt32(Session["count"]);

            if (ddlItemName.SelectedIndex == 0 && count == 0)
            {
                ddlSupplier.Enabled       = false;
                ddlSupplier.SelectedIndex = 0;

                tbUOM.Text      = "";
                tbPrice.Text    = "";
                tbQuantity.Text = "";
            }
            else if (ddlItemName.SelectedIndex != 0 && count > 0)
            {
                purchaseOrderBL = new PurchaseOrderBL();
                string           itemName = ddlItemName.SelectedItem.Text;
                InventoryStockBO ins      = new InventoryStockBO();
                ins        = purchaseOrderBL.getUOMByItem(itemName);
                tbUOM.Text = ins.ItemUOM.ToString();

                ddlSupplier.Enabled = false;
                string supplier = (String)Session["ddlValue"];
                ddlSupplier.SelectedItem.Text = supplier;
                PurchaseOrderDetailsJoinBO pod = new PurchaseOrderDetailsJoinBO();
                pod          = purchaseOrderBL.getPriceBySupplier(itemName, supplier);
                tbPrice.Text = pod.Price.ToString();

                tbQuantity.Text = "";
            }
            else
            {
                purchaseOrderBL = new PurchaseOrderBL();
                string           itemName = ddlItemName.SelectedItem.Text;
                InventoryStockBO ins      = new InventoryStockBO();
                ins        = purchaseOrderBL.getUOMByItem(itemName);
                tbUOM.Text = ins.ItemUOM.ToString();

                ddlSupplier.Enabled = true;
                List <String>    supplierList = new List <string>();
                InventoryStockBO bo           = new InventoryStockBO();
                bo = purchaseOrderBL.getSupplierByItem(itemName);
                supplierList.Add(bo.Supplier1);
                supplierList.Add(bo.Supplier2);
                supplierList.Add(bo.Supplier3);

                ddlSupplier.DataSource = supplierList;
                ddlSupplier.DataBind();

                ListItem liSupplier = new ListItem("Select Supplier", "-1");
                ddlSupplier.Items.Insert(0, liSupplier);
                tbPrice.Text    = "";
                tbQuantity.Text = "";
            }
        }
        public List <InventoryStockBO> convertStockBOList(List <InventoryStock> stocklst)
        {
            List <InventoryStockBO> stockBOlst = new List <InventoryStockBO>();

            foreach (InventoryStock item in stocklst)
            {
                InventoryStockBO itemBo = convertStockBO(item);
                stockBOlst.Add(itemBo);
            }
            return(stockBOlst);
        }
        public InventoryStockBO convertInventoryStockBO(InventoryStock i)
        {
            ibo              = new InventoryStockBO();
            ibo.Bin          = i.Bin;
            ibo.ItemNumber   = i.ItemNumber;
            ibo.ItemName     = i.ItemName;
            ibo.ItemCategory = i.ItemCategory;
            ibo.Quantity     = i.Quantity;
            ibo.ItemUOM      = i.ItemUOM;
            ibo.Price1       = Convert.ToDouble(i.Price1);

            return(ibo);
        }
Exemple #7
0
        public InventoryStockBO getUOMForItem(string itemName)
        {
            var query = (from invs in context.InventoryStocks
                         where invs.ItemName == itemName
                         select new { invs.ItemUOM });
            InventoryStockBO obj = new InventoryStockBO();

            foreach (var q in query)
            {
                obj.ItemUOM = q.ItemUOM;
            }
            return(obj);
        }
        public InventoryStockBO getSupplier3(String itemNumber)
        {
            List <InventoryStockBO> supList = new List <InventoryStockBO>();
            InventoryStockBO        retList = new InventoryStockBO();
            InventoryStockBO        ibo     = new InventoryStockBO();

            supList = cav.getSupplierListFromItemNumber(itemNumber);
            foreach (InventoryStockBO inv in supList)
            {
                ibo.Supplier1 = inv.Supplier3;
                ibo.Price1    = inv.Price3;
                retList       = ibo;
            }
            return(retList);
        }
        public List <string> getDistinctCategory()
        {
            List <string> i = new List <string>();

            var query = (from x in context.InventoryStocks
                         select new { x.ItemCategory }).Distinct().ToList();

            foreach (var q in query)
            {
                InventoryStockBO b = new InventoryStockBO();
                b.ItemCategory = q.ItemCategory;
                i.Add(b.ItemCategory);
            }
            return(i);
        }
Exemple #10
0
        public InventoryStockBO getSupplierForItem(string itemName)
        {
            var query = (from invs in context.InventoryStocks
                         where invs.ItemName == itemName
                         select new { invs.Supplier1, invs.Supplier2, invs.Supplier3 });
            InventoryStockBO obj = new InventoryStockBO();

            foreach (var q in query)
            {
                obj.Supplier1 = q.Supplier1;
                obj.Supplier2 = q.Supplier2;
                obj.Supplier3 = q.Supplier3;
            }
            return(obj);
        }
        public List <InventoryStockBO> getItemListByCategory(String category)
        {
            List <InventoryStockBO> i = new List <InventoryStockBO>();

            var query = (from x in context.InventoryStocks
                         where x.ItemCategory.Equals(category)
                         select new { x.ItemNumber, x.ItemName }).Distinct().ToList();

            foreach (var q in query)
            {
                InventoryStockBO b = new InventoryStockBO();
                b.ItemNumber = q.ItemNumber;
                b.ItemName   = q.ItemName;
                i.Add(b);
            }
            return(i);
        }
        public InventoryStock convertInventoryStock(InventoryStockBO itemBo)
        {
            InventoryStock item = new InventoryStock();

            item.ItemNumber   = itemBo.ItemNumber;
            item.Quantity     = itemBo.Quantity;
            item.ItemName     = itemBo.ItemName;
            item.ItemCategory = itemBo.ItemCategory;
            item.ReorderLevel = itemBo.ReorderLevel;
            item.ItemUOM      = itemBo.ItemUOM;
            item.Bin          = itemBo.Bin;
            item.Supplier1    = itemBo.Supplier1;
            item.Supplier2    = itemBo.Supplier2;
            item.Supplier3    = itemBo.Supplier3;
            item.Price1       = (decimal)itemBo.Price1;
            item.Price2       = (decimal)itemBo.Price2;
            item.Price3       = (decimal)itemBo.Price3;
            return(item);
        }
Exemple #13
0
        public void showSupplierInfo(string itemName)
        {
            selectedItem = bl.getItemByName(itemName);

            selectedItem.SupplierOne   = bl.getSupplierBySupplierId(selectedItem.Supplier1);
            selectedItem.SupplierTwo   = bl.getSupplierBySupplierId(selectedItem.Supplier2);
            selectedItem.SupplierThree = bl.getSupplierBySupplierId(selectedItem.Supplier3);

            ddlSupplier1.SelectedItem.Text = selectedItem.SupplierOne.SupplierId;
            tbSupplier1Name.Text           = selectedItem.SupplierOne.SupplierName;
            tbSupplier1Price.Text          = Convert.ToString(selectedItem.Price1);

            ddlSupplier2.SelectedItem.Text = selectedItem.SupplierTwo.SupplierId;
            tbSupplier2Name.Text           = selectedItem.SupplierTwo.SupplierName;
            tbSupplier2Price.Text          = Convert.ToString(selectedItem.Price2);

            ddlSupplier3.SelectedItem.Text = selectedItem.SupplierThree.SupplierId;
            tbSupplier3Name.Text           = selectedItem.SupplierThree.SupplierName;
            tbSupplier3Price.Text          = Convert.ToString(selectedItem.Price3);
        }
        public List <InventoryStockBO> getSupplierListFromItemNumber(String itemNumber)
        {
            List <InventoryStockBO> ilist = new List <InventoryStockBO>();
            InventoryStockBO        i     = new InventoryStockBO();
            var query = (from x in context.InventoryStocks
                         where x.ItemNumber.Equals(itemNumber)
                         select new { x.Supplier1, x.Supplier2, x.Supplier3, x.Price1, x.Price2, x.Price3 }).ToList();

            foreach (var q in query)
            {
                i.Supplier1 = q.Supplier1;
                i.Supplier2 = q.Supplier2;
                i.Supplier3 = q.Supplier3;
                i.Price1    = Convert.ToDouble(q.Price1);
                i.Price2    = Convert.ToDouble(q.Price2);
                i.Price3    = Convert.ToDouble(q.Price3);
                ilist.Add(i);
            }
            return(ilist);
        }
Exemple #15
0
        public InventoryStockBO convertInventoryStockBO(InventoryStock i)
        {
            ibo                 = new InventoryStockBO();
            ibo.ItemNumber      = i.ItemNumber;
            ibo.ItemName        = i.ItemName;
            ibo.Quantity        = i.Quantity;
            ibo.ItemCategory    = i.ItemCategory;
            ibo.ReorderLevel    = i.ReorderLevel;
            ibo.ReorderQuantity = i.ReorderQuantity;
            ibo.ItemUOM         = i.ItemUOM;
            ibo.Bin             = i.Bin;
            ibo.Supplier1       = i.Supplier1;
            ibo.Supplier2       = i.Supplier2;
            ibo.Supplier3       = i.Supplier3;
            ibo.Price1          = (double)i.Price1;
            ibo.Price2          = (double)i.Price2;
            ibo.Price3          = (double)i.Price3;

            return(ibo);
        }
Exemple #16
0
        private void upload(DataSet dataSet)
        {
            List <InventoryStockBO> stockBOlst = new List <InventoryStockBO>();

            int count = dataSet.Tables[0].Rows.Count - 1;

            if (dataSet != null && dataSet.Tables.Count > 0)
            {
                for (int index = 1; index <= count; index++)
                {
                    InventoryStockBO stockBO = new InventoryStockBO();
                    stockBO.ItemNumber      = dataSet.Tables[0].Rows[index].ItemArray[0].ToString();
                    stockBO.ItemName        = dataSet.Tables[0].Rows[index].ItemArray[1].ToString();
                    stockBO.Quantity        = Convert.ToInt32(dataSet.Tables[0].Rows[index].ItemArray[2].ToString());
                    stockBO.ItemCategory    = dataSet.Tables[0].Rows[index].ItemArray[3].ToString();
                    stockBO.ReorderLevel    = Convert.ToInt32(dataSet.Tables[0].Rows[index].ItemArray[4].ToString());
                    stockBO.ReorderQuantity = Convert.ToInt32(dataSet.Tables[0].Rows[index].ItemArray[5].ToString());

                    stockBO.ItemUOM = dataSet.Tables[0].Rows[index].ItemArray[6].ToString();
                    stockBO.Bin     = dataSet.Tables[0].Rows[index].ItemArray[7].ToString();


                    stockBO.Supplier1 = dataSet.Tables[0].Rows[index].ItemArray[8].ToString();
                    stockBO.Supplier2 = dataSet.Tables[0].Rows[index].ItemArray[9].ToString();
                    stockBO.Supplier3 = dataSet.Tables[0].Rows[index].ItemArray[10].ToString();
                    stockBO.Price1    = Convert.ToDouble(dataSet.Tables[0].Rows[index].ItemArray[11]);
                    stockBO.Price2    = Convert.ToDouble(dataSet.Tables[0].Rows[index].ItemArray[12]);
                    stockBO.Price3    = Convert.ToDouble(dataSet.Tables[0].Rows[index].ItemArray[13]);

                    stockBOlst.Add(stockBO);
                }
                Session["stockBOlst"] = stockBOlst;
                int status = bl.updateStockSupplier(stockBOlst);
                GridView1.DataSource = stockBOlst;
                GridView1.DataBind();
                fooTableSetting();
            }
        }
Exemple #17
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            selectedItem = bl.getItemByName(ddlItemName.SelectedItem.Text);

            selectedItem.Supplier1 = ddlSupplier1.SelectedItem.Text;
            selectedItem.Supplier2 = ddlSupplier2.SelectedItem.Text;
            selectedItem.Supplier3 = ddlSupplier3.SelectedItem.Text;

            selectedItem.SupplierOne   = bl.getSupplierBySupplierId(selectedItem.Supplier1);
            selectedItem.SupplierTwo   = bl.getSupplierBySupplierId(selectedItem.Supplier2);
            selectedItem.SupplierThree = bl.getSupplierBySupplierId(selectedItem.Supplier3);

            selectedItem.Price1 = Convert.ToDouble(tbSupplier1Price.Text);
            selectedItem.Price2 = Convert.ToDouble(tbSupplier2Price.Text);
            selectedItem.Price3 = Convert.ToDouble(tbSupplier3Price.Text);

            int status = bl.updateSupplier(selectedItem);

            if (status > 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Data saved successfully')", true);
            }
        }