Ejemplo n.º 1
0
        /// <summary>
        /// 查询仓库
        /// </summary>
        public string GetWarehouseListData()
        {
            var form = Request("form").DeserializeJSONTo <WarehouseQueryEntity>();

            var posService = new PosService(CurrentUserInfo);
            IList <WarehouseInfo> warehouseList;
            string content = string.Empty;

            Hashtable hashtable = new Hashtable();

            hashtable.Add("Code", FormatParamValue(form.warehouse_code));
            hashtable.Add("Name", FormatParamValue(form.warehouse_name));
            hashtable.Add("Contacter", FormatParamValue(form.warehouse_contacter));
            hashtable.Add("Tel", FormatParamValue(form.warehouse_tel));
            hashtable.Add("Status", FormatParamValue(form.warehouse_status));
            hashtable.Add("UnitName", FormatParamValue(form.unit_name));

            int maxRowCount   = PageSize;
            int startRowIndex = Utils.GetIntVal(Request("start"));

            warehouseList = posService.SelectWarehouseList(hashtable, maxRowCount, startRowIndex);

            var jsonData = new JsonData();

            jsonData.totalCount = posService.SelectWarehouseListCount(hashtable).ToString();
            jsonData.data       = warehouseList;

            content = string.Format("{{\"totalCount\":{1},\"topics\":{0}}}",
                                    jsonData.data.ToJSON(),
                                    jsonData.totalCount);
            return(content);
        }