示例#1
0
        public List<WareHouse> GetWareHouses(string itemNumber, string site, string userName)
        {
            IAXHelper axHelper = ObjectFactory.GetInstance<IAXHelper>();
            List<WareHouse> wareHouseList = new List<WareHouse>();

            try
            {
                DataTable resultTable = axHelper.GetWareHouses(itemNumber, site, userName);

                foreach (DataRow row in resultTable.Rows)
                {
                    WareHouse wareHouseObject = new WareHouse();
                    wareHouseObject.WareHouseCode = row["WareHouseID"].ToString();
                    wareHouseObject.WareHouseName = row["WareHouseName"].ToString();
                    wareHouseObject.PhyiscalQty = row["PhysicalQty"].ToString();
                    wareHouseObject.WareHouseandQty = wareHouseObject.WareHouseCode + " [Qty - " + wareHouseObject.PhyiscalQty + " ]";
                    wareHouseList.Add(wareHouseObject);

                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return wareHouseList;
        }
 private JsonResult _GetWareHouses(string itemNumber, string site)
 {
     string userName = User.Identity.Name.ToString().Split('\\')[1];
     WareHouse wareHouseObject = new WareHouse();
     return Json(new SelectList(wareHouseObject.GetWareHouses(itemNumber, site, userName), "WareHouseCode", "WareHouseandQty"), JsonRequestBehavior.AllowGet);
 }