public DisplayWShelfItemDetails LoadEditShelfItems(string suppItemCode)
        {
            var obj = new DisplayWShelfItemDetails();
            WShelfItemDetailsDAL shelfDAl = new WShelfItemDetailsDAL(ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString);
            var supplierIdForInhouse      = 8;

            var          itemHouse = shelfDAl.GetItemBySupplierIdAndItemCode(suppItemCode.Trim(), supplierIdForInhouse);
            WareShelfDAL shelRow   = new WareShelfDAL(ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString);



            if (itemHouse.ItemID > 0)
            {
                var listItmesShelf = shelfDAl.GetAllShelfItems();
                var itemSelected   = (from sh in listItmesShelf where sh.ItemId == itemHouse.ItemID select sh).ToList();
                if (itemSelected.Count() > 0)
                {
                    obj.ItemId             = itemSelected[0].ItemId;
                    obj.Boxing             = listItmesShelf[0].Boxing;
                    obj.Brand              = listItmesShelf[0].Brand;
                    obj.COG                = listItmesShelf[0].COG;
                    obj.Damaged            = listItmesShelf[0].Damaged;
                    obj.Description        = listItmesShelf[0].Description;
                    obj.DSB                = listItmesShelf[0].DSB;
                    obj.Height             = listItmesShelf[0].Height;
                    obj.Id                 = listItmesShelf[0].Id;
                    obj.Length             = listItmesShelf[0].Length;
                    obj.LocationColumnName = listItmesShelf[0].LocationColumnName;
                    obj.LocationId         = listItmesShelf[0].LocationId;
                    obj.LocationRowNumber  = listItmesShelf[0].LocationRowNumber;
                    obj.ManagerUnitPrice   = listItmesShelf[0].ManagerUnitPrice;
                    obj.Name               = listItmesShelf[0].Name;
                    obj.Notes              = listItmesShelf[0].Notes;
                    obj.OEMCode            = listItmesShelf[0].OEMCode;
                    obj.Quantity           = listItmesShelf[0].Quantity;
                    obj.RepUnitPrice       = listItmesShelf[0].RepUnitPrice;
                    obj.SupplierItemCode   = listItmesShelf[0].SupplierItemCode;
                }
            }

            return(obj);
        }
예제 #2
0
        private string GetAllAShelfItems()
        {
            string strOutput = "{\"aaData\":[";
            WShelfItemDetailsDAL shelfDAl = new WShelfItemDetailsDAL(ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString);

            var listShelfItems = shelfDAl.GetAllShelfItems();

            foreach (var item in listShelfItems)
            {
                String strEditOrder = "<img src='../Images/Edit.png'  onclick='openEditItems(" + item.Id.ToString() + ");'>";
                String strEditQty   = "<img src='../Images/Edit.png'  onclick='openQtyItems(" + item.ItemId.ToString() + "," + item.Quantity + ");'>";
                strOutput = strOutput + "[\"" + item.SupplierItemCode + "\","
                            + "\"" + item.Brand + "\","
                            + "\"" + item.Name + "\","
                            + "\"" + item.Boxing + "\","
                            + "\"" + item.Description + "\","
                            + "\"" + item.COG + "\","
                            + "\"" + item.RepUnitPrice + "\","
                            + "\"" + item.OEMCode + "\","
                            + "\"" + item.LocationColumnName + "  -  " + item.LocationRowNumber + "\","


                            + "\"" + item.Quantity + "\","
                            + "\"" + strEditQty + "\","
                            + "\"" + strEditOrder + "\"],";
            }
            if (listShelfItems.Count() > 0)
            {
                int Length = strOutput.Length;
                strOutput = strOutput.Substring(0, (Length - 1));
            }

            strOutput = strOutput + "]}";

            return(strOutput);
        }