public static bool ModifyStorageLocation(StorageLocationEntity entity) { long result = 0; if (entity != null) { StorageLocationRepository mr = new StorageLocationRepository(); StorageLocationInfo StorageLocationInfo = TranslateStorageLocationInfo(entity); if (entity.StorageLocationID > 0) { StorageLocationInfo.StorageLocationID = entity.StorageLocationID; StorageLocationInfo.ChangeDate = DateTime.Now; result = mr.ModifyStorageLocation(StorageLocationInfo); } else { StorageLocationInfo.ChangeDate = DateTime.Now; StorageLocationInfo.CreateDate = DateTime.Now; result = mr.CreateNew(StorageLocationInfo); } List <StorageLocationInfo> miList = mr.GetAllStorageLocation();//刷新缓存 Cache.Add("StorageLocationALL", miList); } return(result > 0); }
public void SubmitBatch(string warehouseId) { if (!repository.IsUsingForStorageLocation(warehouseId)) { throw new Exception("货架中有库位正在使用中,不能创建库位列表"); } if (GetList(warehouseId)?.Count() > 0) { throw new Exception("库位已经存在,不能重新创建!"); } List <StorageLocationEntity> list = new List <StorageLocationEntity>(); var shelftEntity = warehouseApp.FindEntity(warehouseId); var preEnCode = warehouseApp.GetStorageLocationPreEncode(warehouseId); for (int i = 1; i <= shelftEntity.F_ShelfLayer; i++) { for (int n = 1; n <= shelftEntity.F_ShelfNumber; n++) { StorageLocationEntity entity = new StorageLocationEntity(); entity.Create(); entity.F_Status = 0; entity.F_EnabledMark = true; entity.F_EnCode = preEnCode + i.ToString("00") + n.ToString("00"); entity.F_LayerNumber = i; entity.F_SortCode = n; entity.F_LocationType = 1;//拣货 entity.F_Warehouse = warehouseId; list.Add(entity); } } repository.SubmitBatch(list); }
public void SubmitForm(StorageLocationEntity entity, string keyValue) { if (string.IsNullOrWhiteSpace(keyValue)) { throw new Exception("库存F_Id不能为空"); } entity.Modify(keyValue); repository.Update(entity); }
public static StorageLocationEntity GetStorageLocationById(long gid) { StorageLocationEntity result = new StorageLocationEntity(); StorageLocationRepository mr = new StorageLocationRepository(); StorageLocationInfo info = mr.GetStorageLocationByKey(gid); result = TranslateStorageLocationEntity(info); return(result); }
public void Modify(StorageLocationEntity StorageLocation) { if (StorageLocation != null) { StorageLocation.OperatorID = CurrentUser.UserID; } StorageLocationService.ModifyStorageLocation(StorageLocation); Response.Redirect("/StorageLocation/"); }
public static List <StorageLocationEntity> GetStorageLocationInfoPager(PagerInfo pager) { List <StorageLocationEntity> all = new List <StorageLocationEntity>(); StorageLocationRepository mr = new StorageLocationRepository(); List <StorageLocationInfo> miList = mr.GetAllStorageLocationInfoPager(pager); if (!miList.IsEmpty()) { foreach (StorageLocationInfo mInfo in miList) { StorageLocationEntity carEntity = TranslateStorageLocationEntity(mInfo); all.Add(carEntity); } } return(all); }
public static List <StorageLocationEntity> GetSubAreaNoByStorageAreaNo(string StorageAreaNo, int status) { List <StorageLocationEntity> all = new List <StorageLocationEntity>(); StorageLocationRepository mr = new StorageLocationRepository(); List <StorageLocationInfo> miList = mr.GetSubAreaNoByStorageAreaNo(StorageAreaNo, status); if (!miList.IsEmpty()) { foreach (StorageLocationInfo mInfo in miList) { StorageLocationEntity entity = new StorageLocationEntity(); entity.StorageSubAreaNo = mInfo.StorageSubAreaNo; all.Add(entity); } } return(all); }
public static List <StorageLocationEntity> GetStorageLocationInfoByRule(int StorageID, string storageAreaNo, string storagesubareano, int status, PagerInfo pager) { List <StorageLocationEntity> all = new List <StorageLocationEntity>(); StorageLocationRepository mr = new StorageLocationRepository(); List <StorageLocationInfo> miList = mr.GetStorageLocationInfoByRule(StorageID, storageAreaNo, storagesubareano, status, pager); if (!miList.IsEmpty()) { foreach (StorageLocationInfo mInfo in miList) { StorageLocationEntity storeEntity = TranslateStorageLocationEntity(mInfo); all.Add(storeEntity); } } return(all); }
public static List <StorageLocationEntity> GetStorageLocationByKeys(string ids) { List <StorageLocationEntity> all = new List <StorageLocationEntity>(); StorageLocationRepository mr = new StorageLocationRepository(); List <StorageLocationInfo> miList = mr.GetStorageLocationByKeys(ids); if (!miList.IsEmpty()) { foreach (StorageLocationInfo mInfo in miList) { StorageLocationEntity entity = TranslateStorageLocationEntity(mInfo); all.Add(entity); } } return(all); }
public static List <StorageLocationEntity> GetStorageLocationByRule(string name, int storageID, int status) { List <StorageLocationEntity> all = new List <StorageLocationEntity>(); StorageLocationRepository mr = new StorageLocationRepository(); List <StorageLocationInfo> miList = mr.GetStorageLocationByRule(name, storageID, status); if (!miList.IsEmpty()) { foreach (StorageLocationInfo mInfo in miList) { StorageLocationEntity StorageLocationEntity = TranslateStorageLocationEntity(mInfo); all.Add(StorageLocationEntity); } } return(all); }
private static StorageLocationInfo TranslateStorageLocationInfo(StorageLocationEntity entity) { StorageLocationInfo info = new StorageLocationInfo(); if (info != null) { info.StorageID = entity.StorageID; info.StorageAreaNo = entity.StorageAreaNo; info.StorageSubAreaNo = entity.StorageSubAreaNo; info.StorageLocationNo = entity.StorageLocationNo; info.Remark = entity.Remark; info.OperatorID = entity.OperatorID; info.Status = entity.Status; info.IsLock = entity.IsLock; info.CreateDate = entity.CreateDate; info.ChangeDate = entity.ChangeDate; info.StorageLocationID = entity.StorageLocationID; } return(info); }
public static List <StorageLocationEntity> GetStorageLocationAll() { List <StorageLocationEntity> all = new List <StorageLocationEntity>(); StorageLocationRepository mr = new StorageLocationRepository(); List <StorageLocationInfo> miList = mr.GetAllStorageLocation();//Cache.Get<List<StorageLocationInfo>>("StorageLocationALL"); //if (miList.IsEmpty()) //{ // miList = mr.GetAllStorageLocation(); // Cache.Add("StorageLocationALL", miList); //} if (!miList.IsEmpty()) { foreach (StorageLocationInfo mInfo in miList) { StorageLocationEntity StorageLocationEntity = TranslateStorageLocationEntity(mInfo); all.Add(StorageLocationEntity); } } return(all); }
private static StorageLocationEntity TranslateStorageLocationEntity(StorageLocationInfo info) { StorageLocationEntity entity = new StorageLocationEntity(); if (info != null) { entity.StorageID = info.StorageID; entity.StorageAreaNo = info.StorageAreaNo; entity.StorageSubAreaNo = info.StorageSubAreaNo; entity.StorageLocationNo = info.StorageLocationNo; entity.Remark = info.Remark; entity.IsLock = info.IsLock; entity.OperatorID = info.OperatorID; entity.Status = info.Status; entity.CreateDate = info.CreateDate; entity.ChangeDate = info.ChangeDate; entity.StorageLocationID = info.StorageLocationID; // 关联的仓库信息 entity.storages = StorageService.GetStorageEntityById(entity.StorageID); } return(entity); }
public ActionResult SubmitForm(StorageLocationEntity entity, string keyValue) { app.SubmitForm(entity, keyValue); return(Success("操作成功。")); }