public ActionResult CateList() { string cateName = WebUtil.GetFormValue <string>("cateName", string.Empty); int pageIndex = WebUtil.GetFormValue <int>("pageIndex", 0); int pageSize = WebUtil.GetFormValue <int>("pageSize", 0); ProductCategoryProvider provider = new ProductCategoryProvider(); ProductCategoryEntity entity = new ProductCategoryEntity(); if (!cateName.IsEmpty()) { entity.Begin <ProductCategoryEntity>() .Where <ProductCategoryEntity>("CateNum", ECondition.Like, "%" + cateName + "%") .Or <ProductCategoryEntity>("CateName", ECondition.Like, "%" + cateName + "%") .End <ProductCategoryEntity>() ; } PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; List <ProductCategoryEntity> list = provider.GetList(entity, ref pageInfo); list = list.IsNull() ? new List <ProductCategoryEntity>() : list; string json = ConvertJson.ListToJson <ProductCategoryEntity>(list, "data"); JsonObject jsonObject = new JsonObject(json); this.ReturnJson.AddProperty("list", jsonObject); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetList() { string ProductName = WebUtil.GetFormValue <string>("ProductName", string.Empty); int pageIndex = WebUtil.GetFormValue <int>("pageIndex", 0); int pageSize = WebUtil.GetFormValue <int>("pageSize", 0); string CateNum = WebUtil.GetFormValue <string>("CateNum", string.Empty); ProductProvider provider = new ProductProvider(); ProductEntity entity = new ProductEntity(); if (!ProductName.IsEmpty()) { entity.Begin <ProductEntity>() .Where <ProductEntity>("ProductName", ECondition.Like, "%" + ProductName + "%") .Or <ProductEntity>("SnNum", ECondition.Like, "%" + ProductName + "%") .Or <ProductEntity>("BarCode", ECondition.Like, "%" + ProductName + "%") .End <ProductEntity>(); } if (!CateNum.IsEmpty()) { entity.Where <ProductEntity>("CateNum", ECondition.Eth, CateNum); } PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; List <ProductEntity> listResult = provider.GetList(entity, ref pageInfo); string json = ConvertJson.ListToJson <ProductEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetCustomerList() { int pageIndex = WebUtil.GetFormValue <int>("pageIndex", 1); int pageSize = WebUtil.GetFormValue <int>("pageSize", 15); string CusNum = WebUtil.GetFormValue <string>("CusNum", string.Empty); int CusType = WebUtil.GetFormValue <int>("CusType", 0); CustomerProvider provider = new CustomerProvider(); CustomerEntity entity = new CustomerEntity(); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; if (!CusNum.IsEmpty()) { entity.Begin <CustomerEntity>() .Where <CustomerEntity>("CusNum", ECondition.Like, "%" + CusNum + "%") .Or <CustomerEntity>("CusName", ECondition.Like, "%" + CusNum + "%") .End <CustomerEntity>(); } if (CusType != 0) { entity.Where <CustomerEntity>(a => a.CusType == CusType); } List <CustomerEntity> listResult = provider.GetCustomerList(entity, ref pageInfo); string json = ConvertJson.ListToJson <CustomerEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetEquipmentList() { int pageIndex = WebUtil.GetFormValue <int>("pageIndex", 1); int pageSize = WebUtil.GetFormValue <int>("pageSize", 15); string EquipmentName = WebUtil.GetFormValue <string>("EquipmentName", string.Empty); int Status = WebUtil.GetFormValue <int>("Status", 0); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; EquipmentProvider provider = new EquipmentProvider(); EquipmentEntity entity = new EquipmentEntity(); if (!EquipmentName.IsEmpty()) { entity.Begin <EquipmentEntity>() .Where <EquipmentEntity>("SnNum", ECondition.Like, "%" + EquipmentName + "%") .Or <EquipmentEntity>("EquipmentName", ECondition.Like, "%" + EquipmentName + "%") .End <EquipmentEntity>(); } if (Status != 0) { entity.Where <EquipmentEntity>(a => a.Status == Status); } List <EquipmentEntity> list = provider.GetList(entity, ref pageInfo); string json = ConvertJson.ListToJson <EquipmentEntity>(list, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); this.ReturnJson.AddProperty("RowCount", list.Count); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetCheckDif() { string OrderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); int pageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); int pageSize = WebUtil.GetFormValue <int>("PageSize", 10); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; CheckDataProvider provider = new CheckDataProvider(); List <CheckDataEntity> listResult = provider.GetCheckDifList(OrderNum, ref pageInfo); listResult = listResult == null ? new List <CheckDataEntity>() : listResult; System.Threading.Tasks.Parallel.ForEach(listResult, item => { item.LocalQty = ConvertHelper.ToType <double>(item.LocalQty.ToString()); item.FirstQty = ConvertHelper.ToType <double>(item.FirstQty.ToString()); item.DifQty = ConvertHelper.ToType <double>((item.FirstQty - item.LocalQty).ToString()); item.LocalName = LocalHelper.GetLocalNumList(this.DefaultStore, item.LocalNum); }); string json = ConvertJson.ListToJson <CheckDataEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", json); this.ReturnJson.AddProperty("RowCount", pageInfo.PageCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetOrderDetail() { string orderNum = WebUtil.GetFormValue <string>("orderNum", string.Empty); Bill <OrdersEntity, OrderDetailEntity> bill = new OrderBill(); if (!orderNum.IsEmpty()) { OrderDetailEntity detail = new OrderDetailEntity(); detail.OrderNum = orderNum; List <OrderDetailEntity> listResult = bill.GetOrderDetail(detail); if (!listResult.IsNullOrEmpty()) { listResult.Remove(a => a.Num == 0); LocalProductProvider provider = new LocalProductProvider(); string storageNum = this.DefaultStore; foreach (OrderDetailEntity item in listResult) { item.LocalNum = provider.GetLocalNum(storageNum, item.ProductNum); } string json = ConvertJson.ListToJson <OrderDetailEntity>(listResult, "List"); JsonObject jsonObject = new JsonObject(json); this.ReturnJson.AddProperty("Data", jsonObject); } } return(Content(this.ReturnJson.ToString())); }
public ActionResult LoadLocalProduct() { List <BadReportDetailEntity> listResult = Session[CacheKey.TEMPDATA_CACHE_BADPRODUCTDETAIL] as List <BadReportDetailEntity>; listResult = listResult.IsNull() ? new List <BadReportDetailEntity>() : listResult; this.ReturnJson.AddProperty("List", ConvertJson.ListToJson <BadReportDetailEntity>(listResult, "Data")); return(Content(this.ReturnJson.ToString())); }
public ActionResult LoadProduct() { List <InStorDetailEntity> list = Session[CacheKey.TEMPDATA_CACHE_INSTORDETAIL] as List <InStorDetailEntity>; list = list.IsNull() ? new List <InStorDetailEntity>() : list; this.ReturnJson.AddProperty("List", ConvertJson.ListToJson <InStorDetailEntity>(list, "Data")); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetList() { int status = WebUtil.GetFormValue <int>("Status", 0); string orderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); string supName = WebUtil.GetFormValue <string>("SupName", string.Empty); string beginTime = WebUtil.GetFormValue <string>("beginTime", string.Empty); string endTime = WebUtil.GetFormValue <string>("endTime", string.Empty); int pageSize = WebUtil.GetFormValue <int>("PageSize", 10); int pageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); int InType = WebUtil.GetFormValue <int>("InType", 0); string planNum = WebUtil.GetFormValue <string>("planNum", string.Empty); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; InStorageEntity entity = new InStorageEntity(); if (status > 0) { entity.Where(a => a.Status == status); } if (!orderNum.IsEmpty()) { entity.Where("OrderNum", ECondition.Like, "%" + orderNum + "%"); } if (!supName.IsEmpty()) { entity.AndBegin <InStorageEntity>() .And <InStorageEntity>("SupNum", ECondition.Like, "%" + supName + "%") .Or <InStorageEntity>("SupName", ECondition.Like, "%" + supName + "%") .End <InStorageEntity>() ; } if (!beginTime.IsEmpty() && !endTime.IsEmpty()) { entity.Where("OrderTime", ECondition.Between, ConvertHelper.ToType <DateTime>(beginTime), ConvertHelper.ToType <DateTime>(endTime)); } entity.And(a => a.StorageNum == this.DefaultStore); if (InType > 0) { entity.And(a => a.InType == InType); } if (!planNum.IsEmpty()) { entity.And("ContractOrder", ECondition.Like, "%" + planNum + "%"); } Bill <InStorageEntity, InStorDetailEntity> bill = new InStorageOrder(); List <InStorageEntity> listResult = bill.GetList(entity, ref pageInfo); listResult = listResult == null ? new List <InStorageEntity>() : listResult; string json = ConvertJson.ListToJson <InStorageEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", json); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetUserList() { var dd = DdUserHelp.UserList.Where(p => p.id < 1000).ToList(); string json = ConvertJson.ListToJson <DdUser>(dd, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); this.ReturnJson.AddProperty("RowCount", dd.Count); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetLocalProductList() { string BarCode = WebUtil.GetFormValue <string>("BarCode", string.Empty); LocalProductProvider provider = new LocalProductProvider(); List <LocalProductEntity> listResult = provider.GetList(BarCode); listResult = listResult.IsNull() ? new List <LocalProductEntity>() : listResult; string json = ConvertJson.ListToJson <LocalProductEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetLocalDetail() { string barCode = WebUtil.GetFormValue <string>("SnNum", string.Empty); BadProvider provider = new BadProvider(); List <LocalProductEntity> list = provider.GetList(barCode); if (!list.IsNullOrEmpty()) { Parallel.ForEach(list, item => { item.Num = ConvertHelper.ToType <double>(item.Num.ToString(), 0); }); } this.ReturnJson.AddProperty("List", ConvertJson.ListToJson <LocalProductEntity>(list, "Data")); return(Content(this.ReturnJson.ToString())); }
public ActionResult Load() { string OrderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); if (!OrderNum.IsEmpty()) { ReturnProvider provider = new ReturnProvider(); ReturnOrderEntity backEntity = provider.CheckOrder(OrderNum); if (backEntity != null && backEntity.Status == (int)EAudite.Wait) { this.ReturnJson.AddProperty("d", "1001"); return(Content(this.ReturnJson.ToString())); } Bill <OutStorageEntity, OutStoDetailEntity> bill = new OutStorageOrder(); OutStorageEntity entity = new OutStorageEntity(); entity.OrderNum = OrderNum; entity = bill.GetOrder(entity); if (entity.IsNotNull()) { if (entity.Status != (int)EAudite.Pass) { this.ReturnJson.AddProperty("d", "1002"); return(Content(this.ReturnJson.ToString())); } this.ReturnJson.AddProperty("CusNum", entity.CusNum); this.ReturnJson.AddProperty("CusName", entity.CusName); this.ReturnJson.AddProperty("Address", entity.Address); this.ReturnJson.AddProperty("Contact", entity.Contact); this.ReturnJson.AddProperty("Phone", entity.Phone); //加载详细内容 OutStoDetailEntity detail = new OutStoDetailEntity(); detail.OrderNum = OrderNum; List <OutStoDetailEntity> list = bill.GetOrderDetail(detail); list = list.IsNull() ? new List <OutStoDetailEntity>() : list; //获得已经退货的数量 List <ReturnDetailEntity> listResult = provider.GetDetailByOrder(OrderNum); if (!listResult.IsNullOrEmpty()) { list.ForEach(a => { double qty = listResult.Where(b => b.BarCode == a.BarCode && b.ProductNum == a.ProductNum && b.LocalNum == a.LocalNum && b.StorageNum == a.StorageNum && b.BatchNum == a.BatchNum).Sum(b => b.BackNum); a.BackNum = qty; }); } Session[CacheKey.TEMPDATE_CACHE_RETURNPRODUCTDETAIL] = list; string json = ConvertJson.ListToJson <OutStoDetailEntity>(list, "List"); this.ReturnJson.AddProperty("data", json); } } return(Content(this.ReturnJson.ToString())); }
public ActionResult GetAdminList() { int pageIndex = WebUtil.GetFormValue <int>("pageIndex", 1); int pageSize = WebUtil.GetFormValue <int>("pageSize", 15); string userCode = WebUtil.GetFormValue <string>("userCode", string.Empty); string userName = WebUtil.GetFormValue <string>("userName", string.Empty); string roleNum = WebUtil.GetFormValue <string>("roleNum", string.Empty); string departNum = WebUtil.GetFormValue <string>("departNum", string.Empty); string search = WebUtil.GetFormValue <string>("search", string.Empty); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; AdminProvider provider = new AdminProvider(); AdminEntity entity = new AdminEntity(); if (!search.IsEmpty()) { entity.Where("UserCode", ECondition.Like, "%" + search + "%"); entity.Or("RealName", ECondition.Like, "%" + search + "%"); entity.Or("UserName", ECondition.Like, "%" + search + "%"); } else { if (!userCode.IsEmpty()) { entity.Where("UserCode", ECondition.Like, "%" + userCode + "%"); entity.Or("RealName", ECondition.Like, "%" + userCode + "%"); } if (!userName.IsEmpty()) { entity.Where("UserName", ECondition.Like, "%" + userName + "%"); } if (!roleNum.IsEmpty()) { entity.And(a => a.RoleNum == roleNum); } if (!departNum.IsEmpty()) { entity.And(a => a.DepartNum == departNum); } } List <AdminEntity> listResult = provider.GetList(entity, ref pageInfo); string json = ConvertJson.ListToJson <AdminEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult Edit() { //退货单号 string OrderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); if (!OrderNum.IsEmpty()) { //退货单部分 Bill <ReturnOrderEntity, ReturnDetailEntity> bill = new ReturnOrder(); ReturnOrderEntity entity = new ReturnOrderEntity(); entity.OrderNum = OrderNum; entity = bill.GetOrder(entity); if (entity.Status != (int)EAudite.Wait) { this.ReturnJson.AddProperty("d", "1001"); return(Content(this.ReturnJson.ToString())); } ReturnDetailEntity detail = new ReturnDetailEntity(); detail.OrderNum = OrderNum; List <ReturnDetailEntity> listDetails = bill.GetOrderDetail(detail); //出货单部分 Bill <OutStorageEntity, OutStoDetailEntity> provider = new OutStorageOrder(); OutStoDetailEntity items = new OutStoDetailEntity(); items.OrderNum = entity.ContractOrder; List <OutStoDetailEntity> list = provider.GetOrderDetail(items); //已经退货部分 ReturnProvider returnProvider = new ReturnProvider(); List <ReturnDetailEntity> listResult = returnProvider.GetDetailByOrder(entity.ContractOrder); if (!list.IsNullOrEmpty()) { list.ForEach(a => { ReturnDetailEntity item = listDetails.FirstOrDefault(b => b.BarCode == a.BarCode && b.ProductNum == a.ProductNum && b.LocalNum == a.LocalNum && b.StorageNum == a.StorageNum); if (item != null) { a.Qty = item.BackNum; } a.BackNum = listResult.Where(b => b.BarCode == a.BarCode && b.ProductNum == a.ProductNum && b.LocalNum == a.LocalNum && b.StorageNum == a.StorageNum).Sum(b => b.BackNum); }); } Session[CacheKey.TEMPDATE_CACHE_RETURNPRODUCTDETAIL] = list; string json = ConvertJson.ListToJson <OutStoDetailEntity>(list, "List"); this.ReturnJson.AddProperty("data", json); } return(Content(this.ReturnJson.ToString())); }
public ActionResult GetLocal() { string StorageNum = WebUtil.GetFormValue <string>("StorageNum", string.Empty); List <LocationEntity> listResult = new List <LocationEntity>(); LocationProvider provider = new LocationProvider(); if (!StorageNum.IsEmpty()) { listResult = provider.GetList(StorageNum); } string json = ConvertJson.ListToJson <LocationEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); this.ReturnJson.AddProperty("RowCount", listResult.Count); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetSelectAddress() { string CusNum = WebUtil.GetFormValue <string>("CusNum", string.Empty); List <CusAddressEntity> list = null; if (!CusNum.IsEmpty()) { CustomerProvider provider = new CustomerProvider(); list = provider.GetAddressList(CusNum); } list = list == null ? new List <CusAddressEntity>() : list; string json = ConvertJson.ListToJson <CusAddressEntity>(list, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); return(Content(this.ReturnJson.ToString())); }
public ActionResult RoleList(int pageIndex, int pageSize, string roleName) { SysRoleProvider provider = new SysRoleProvider(); List <SysRoleEntity> list = provider.GetList(); List <SysRoleEntity> listResult = new List <SysRoleEntity>(); List <SysRoleEntity> returnList = new List <SysRoleEntity>(); if (!list.IsNullOrEmpty()) { listResult = list.Where(a => a.RoleNum.Contains(roleName) || a.RoleName.Contains(roleName)).ToList(); returnList = listResult.Skip((pageIndex - 1) * pageSize).Take(pageSize).OrderByDescending(a => a.ID).ToList(); } this.ReturnJson.AddProperty("Data", ConvertJson.ListToJson <SysRoleEntity>(returnList, "List")); this.ReturnJson.AddProperty("RowCount", listResult.Count); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetList() { int Status = WebUtil.GetFormValue <int>("Status", 0); string OrderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); string BadType = WebUtil.GetFormValue <string>("BadType", string.Empty); string ProductType = WebUtil.GetFormValue <string>("ProductType", string.Empty); string beginTime = WebUtil.GetFormValue <string>("beginTime", string.Empty); string endTime = WebUtil.GetFormValue <string>("endTime", string.Empty); int pageSize = WebUtil.GetFormValue <int>("PageSize", 10); int pageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; BadReportEntity entity = new BadReportEntity(); if (Status > 0) { entity.Where(a => a.Status == Status); } if (!OrderNum.IsEmpty()) { entity.Where("OrderNum", ECondition.Like, "%" + OrderNum + "%"); } if (!ProductType.IsEmpty()) { entity.Where("ProductType", ECondition.Eth, ProductType); } if (!BadType.IsEmpty()) { entity.Where("BadType", ECondition.Eth, BadType); } if (!beginTime.IsEmpty() && !endTime.IsEmpty()) { entity.Where("CreateTime", ECondition.Between, ConvertHelper.ToType <DateTime>(beginTime), ConvertHelper.ToType <DateTime>(endTime)); } entity.And(a => a.StorageNum == this.DefaultStore); Bill <BadReportEntity, BadReportDetailEntity> bill = new BadOrder(); List <BadReportEntity> listResult = bill.GetList(entity, ref pageInfo); listResult = listResult == null ? new List <BadReportEntity>() : listResult; string json = ConvertJson.ListToJson <BadReportEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", json); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetContact() { string snNum = WebUtil.GetFormValue <string>("SnNum", string.Empty); CustomerProvider provider = new CustomerProvider(); CusAddressEntity entity = new CusAddressEntity(); entity = provider.GetSingleAddress(snNum); if (entity.IsNotNull()) { StringBuilder sb = new StringBuilder(); List <CusAddressEntity> listResult = new List <CusAddressEntity>(); listResult.Add(entity); string json = ConvertJson.ListToJson(listResult, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); } return(Content(this.ReturnJson.ToString())); }
public ActionResult GetAddList() { //string CusNum = WebUtil.GetFormValue<string>("CusNum", string.Empty); //List<CusAddressEntity> list = null; //if (!CusNum.IsEmpty()) //{ // CustomerProvider provider = new CustomerProvider(); // list = provider.GetAddressList(CusNum); //} List <CusAddressEntity> list = Session[CacheKey.JOOSHOW_CUSADDRESS_CACHE] as List <CusAddressEntity>; list = list == null ? new List <CusAddressEntity>() : list; string json = ConvertJson.ListToJson <CusAddressEntity>(list, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); return(Content(this.ReturnJson.ToString())); }
public ActionResult LoadDetail() { int pageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); int pageSize = WebUtil.GetFormValue <int>("PageSize", 10); List <ProductEntity> ListProducts = Session[CacheKey.JOOSHOW_CHECKDETAIL_CACHE] as List <ProductEntity>; ListProducts = ListProducts.IsNull() ? new List <ProductEntity>() : ListProducts; int rowCount = ListProducts.Count; ListProducts = ListProducts.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); string json = ConvertJson.ListToJson(ListProducts, "List"); this.ReturnJson.AddProperty("Data", json); this.ReturnJson.AddProperty("RowCount", rowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetList() { int pageIndex = WebUtil.GetFormValue <int>("pageIndex", 1); int pageSize = WebUtil.GetFormValue <int>("pageSize", 15); string LocalName = WebUtil.GetFormValue <string>("LocalName", string.Empty); string LocalType = WebUtil.GetFormValue <string>("LocalType", string.Empty); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; LocationProvider provider = new LocationProvider(); LocationEntity entity = new LocationEntity(); StorageEntity SEntity = new StorageEntity(); SEntity.Include(a => new { StorageName = a.StorageName }); entity.Left <StorageEntity>(SEntity, new Params <string, string>() { Item1 = "StorageNum", Item2 = "StorageNum" }); string StorageNum = this.DefaultStore; entity.Where <LocationEntity>("StorageNum", ECondition.Eth, StorageNum); if (!LocalName.IsEmpty()) { entity.Begin <LocationEntity>() .Where <LocationEntity>("LocalName", ECondition.Like, "%" + LocalName + "%") .Or <LocationEntity>("LocalNum", ECondition.Like, "%" + LocalName + "%") .Or <LocationEntity>("LocalBarCode", ECondition.Like, "%" + LocalName + "%") .End <LocationEntity>() ; } if (!LocalType.IsEmpty()) { entity.Where <LocationEntity>("LocalType", ECondition.Eth, LocalType); } List <LocationEntity> listResult = provider.GetList(entity, ref pageInfo); string json = ConvertJson.ListToJson <LocationEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetTreeSource() { string RoleNum = WebUtil.GetFormValue <string>("RoleNum", this.LoginUser.RoleNum); PowerProvider provider = new PowerProvider(); Params <List <SysResourceEntity>, List <SysResourceEntity>, List <SysResourceEntity> > param = provider.GetRole(RoleNum); List <SysResourceEntity> listAlloted = null; List <SysResourceEntity> listNotAlloted = null; List <SysResourceEntity> listSource = null; listSource = param.Item1; listAlloted = param.Item2; listNotAlloted = param.Item3; listSource = listSource.IsNull() ? new List <SysResourceEntity>() : listSource; listAlloted = listAlloted.IsNull() ? new List <SysResourceEntity>() : listAlloted; listNotAlloted = listNotAlloted.IsNull() ? new List <SysResourceEntity>() : listNotAlloted; this.ReturnJson.AddProperty("ListNotAlloted", ConvertJson.ListToJson <SysResourceEntity>(listNotAlloted)); this.ReturnJson.AddProperty("ListAlloted", ConvertJson.ListToJson <SysResourceEntity>(listAlloted)); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetSupplierList() { int pageIndex = WebUtil.GetFormValue <int>("pageIndex", 1); int pageSize = WebUtil.GetFormValue <int>("pageSize", 15); string SupNum = WebUtil.GetFormValue <string>("SupNum", string.Empty); SupplierProvider provider = new SupplierProvider(); SupplierEntity entity = new SupplierEntity(); List <SupplierEntity> list = provider.GetList(); if (!list.IsNullOrEmpty()) { List <SupplierEntity> listResult = list.Where(a => a.SupNum.Contains(SupNum) || a.SupName.Contains(SupNum)).ToList(); List <SupplierEntity> returnList = listResult.Skip((pageIndex - 1) * pageSize).Take(pageSize).OrderByDescending(a => a.ID).ToList(); string json = ConvertJson.ListToJson <SupplierEntity>(returnList, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); this.ReturnJson.AddProperty("RowCount", listResult.Count); } return(Content(this.ReturnJson.ToString())); }
public ActionResult GetMeasure() { string name = WebUtil.GetFormValue <string>("name", string.Empty); int pageIndex = WebUtil.GetFormValue <int>("pageIndex", 1); int pageSize = WebUtil.GetFormValue <int>("pageSize", 10); PageInfo pageInfo = new PageInfo() { PageIndex = 1, PageSize = pageSize }; MeasureProvider provider = new MeasureProvider(); MeasureEntity entity = new MeasureEntity(); entity.MeasureName = name; List <MeasureEntity> listResult = provider.GetList(entity, ref pageInfo); listResult = listResult.IsNull() ? new List <MeasureEntity>() : listResult; string json = ConvertJson.ListToJson <MeasureEntity>(listResult); this.ReturnJson.AddProperty("List", json); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetMenuList(int pageIndex, int pageSize, string resName, string parentNum) { SysResourceProvider provider = new SysResourceProvider(); List <SysResourceEntity> list = provider.GetList(); if (!list.IsNullOrEmpty()) { List <SysResourceEntity> listResult = list; if (!resName.IsEmpty()) { listResult = listResult.Where(a => a.ResName.Contains(resName)).ToList(); } if (!parentNum.IsEmpty()) { listResult = listResult.Where(a => a.ParentNum.Contains(parentNum)).ToList(); } List <SysResourceEntity> returnList = listResult.Skip((pageIndex - 1) * pageSize).Take(pageSize).OrderByDescending(a => a.ID).ToList(); this.ReturnJson.AddProperty("Data", ConvertJson.ListToJson <SysResourceEntity>(returnList, "List")); this.ReturnJson.AddProperty("RowCount", listResult.Count); } return(Content(this.ReturnJson.ToString())); }
public ActionResult GetList() { int status = WebUtil.GetFormValue <int>("Status", 0); string orderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); string beginTime = WebUtil.GetFormValue <string>("BeginTime", string.Empty); string endTime = WebUtil.GetFormValue <string>("EndTime", string.Empty); CheckStockEntity entity = new CheckStockEntity(); if (status > 0) { entity.Where(a => a.Status == status); } if (!orderNum.IsEmpty()) { entity.Where("OrderNum", ECondition.Like, "%" + orderNum + "%"); } if (!beginTime.IsEmpty() && !endTime.IsEmpty()) { entity.Where("CreateTime", ECondition.Between, ConvertHelper.ToType <DateTime>(beginTime, DateTime.Now.AddDays(-1)), ConvertHelper.ToType <DateTime>(endTime, DateTime.Now)); } entity.And(a => a.StorageNum == this.DefaultStore); int pageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); int pageSize = WebUtil.GetFormValue <int>("PageSize", 10); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; Bill <CheckStockEntity, CheckStockInfoEntity> bill = new CheckOrder(); List <CheckStockEntity> listResult = bill.GetList(entity, ref pageInfo); listResult = listResult.IsNull() ? new List <CheckStockEntity>() : listResult; string json = ConvertJson.ListToJson(listResult, "List"); this.ReturnJson.AddProperty("Data", json); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetList() { int pageIndex = WebUtil.GetFormValue <int>("pageIndex", 1); int pageSize = WebUtil.GetFormValue <int>("pageSize", 10); string StorageName = WebUtil.GetFormValue <string>("StorageName", string.Empty); int StorageType = WebUtil.GetFormValue <int>("StorageType", -1); int IsForbid = WebUtil.GetFormValue <int>("IsForbid", -1); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; StorageProvider provider = new StorageProvider(); StorageEntity entity = new StorageEntity(); if (IsForbid > -1) { entity.Where <StorageEntity>("IsForbid", ECondition.Eth, IsForbid); } if (StorageType > -1) { entity.Where <StorageEntity>("StorageType", ECondition.Eth, StorageType); } if (!StorageName.IsEmpty()) { entity.Begin <StorageEntity>() .Where <StorageEntity>("StorageName", ECondition.Like, "%" + StorageName + "%") .Or <StorageEntity>("StorageNum", ECondition.Like, "%" + StorageName + "%") .End <StorageEntity>() ; } List <StorageEntity> listResult = provider.GetList(entity, ref pageInfo); string json = ConvertJson.ListToJson <StorageEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", new JsonObject(json)); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }
public ActionResult GetList() { int Status = WebUtil.GetFormValue <int>("Status", 0); string OrderNum = WebUtil.GetFormValue <string>("OrderNum", string.Empty); string CusName = WebUtil.GetFormValue <string>("CusName", string.Empty); string beginTime = WebUtil.GetFormValue <string>("beginTime", string.Empty); string endTime = WebUtil.GetFormValue <string>("endTime", string.Empty); string order = WebUtil.GetFormValue <string>("order", string.Empty); int OutType = WebUtil.GetFormValue <int>("OutType", 0); string planNum = WebUtil.GetFormValue <string>("planNum"); int pageSize = WebUtil.GetFormValue <int>("PageSize", 10); int pageIndex = WebUtil.GetFormValue <int>("PageIndex", 1); PageInfo pageInfo = new PageInfo() { PageIndex = pageIndex, PageSize = pageSize }; OutStorageEntity entity = new OutStorageEntity(); if (Status > 0) { entity.Where(a => a.Status == Status); } if (!OrderNum.IsEmpty()) { entity.Where("OrderNum", ECondition.Like, "%" + OrderNum + "%"); } if (!CusName.IsEmpty()) { entity.Begin <OutStorageEntity>() .And <OutStorageEntity>("CusNum", ECondition.Like, "%" + CusName + "%") .Or <OutStorageEntity>("CusName", ECondition.Like, "%" + CusName + "%") .End <OutStorageEntity>() ; } if (!beginTime.IsEmpty() && !endTime.IsEmpty()) { entity.Where("OrderTime", ECondition.Between, ConvertHelper.ToType <DateTime>(beginTime), ConvertHelper.ToType <DateTime>(endTime)); } entity.And(a => a.StorageNum == this.DefaultStore); if (!order.IsEmpty()) { OrderProvider orderProvider = new OrderProvider(); List <string> listContractOrder = orderProvider.GetOrderPlan(order); listContractOrder = listContractOrder.IsNull() ? new List <string>() : listContractOrder; if (listContractOrder.Count == 0) { listContractOrder.Add(order); } entity.And("ContractOrder", ECondition.In, listContractOrder.ToArray()); } if (OutType > 0) { entity.And(a => a.OutType == OutType); } if (!planNum.IsEmpty()) { OutStoDetailEntity detail = new OutStoDetailEntity(); detail.Where("ContractOrder", ECondition.Like, "%" + planNum + "%"); entity.Left <OutStoDetailEntity>(detail, new Params <string, string>() { Item1 = "OrderNum", Item2 = "OrderNum" }); } Bill <OutStorageEntity, OutStoDetailEntity> bill = new OutStorageOrder(); List <OutStorageEntity> listResult = bill.GetList(entity, ref pageInfo); listResult = listResult == null ? new List <OutStorageEntity>() : listResult; string json = ConvertJson.ListToJson <OutStorageEntity>(listResult, "List"); this.ReturnJson.AddProperty("Data", json); this.ReturnJson.AddProperty("RowCount", pageInfo.RowCount); return(Content(this.ReturnJson.ToString())); }