public void StorageLocationService_Should_return_LocalStorageService_for_localpath() { Helper.CreateDummyCustomers(); var storageService = StorageLocationService.GetStorageService(ConfigurationManager.Settings.OutputFile); Assert.IsInstanceOfType(storageService, typeof(LocalStorageService)); }
public ActionResult Index(int storageid = 0, string storageareano = "", string storagesubareano = "", int status = -1, int p = 1) { List <StorageLocationEntity> mList = null; int storageidn = storageid; int count = StorageLocationService.GetStorageLocationCount(storageidn, storageareano, storagesubareano, status); PagerInfo pager = new PagerInfo(); pager.PageIndex = p; pager.PageSize = PAGESIZE; pager.SumCount = count; pager.URL = "/StorageLocation"; //仓库 ViewBag.Storage = StorageService.GetStorageByRule("", 1);//只显示使用中的数据 if (storageidn > 0 || status > -1 || !string.IsNullOrEmpty(storageareano)) { mList = StorageLocationService.GetStorageLocationInfoByRule(storageidn, storageareano, storagesubareano, status, pager); } else { mList = StorageLocationService.GetStorageLocationInfoPager(pager); } ViewBag.AreasNo = storageareano; ViewBag.SubAreasNo = storagesubareano; ViewBag.StorageID = storageid; ViewBag.Status = status; ViewBag.storageAreaNo = storageareano; ViewBag.StorageLocation = mList; ViewBag.Pager = pager; return(View()); }
public void CustomerRepositery_should_throw_exception_for_invalid_location() { var path = @"C:\customers.txt"; var storageService = StorageLocationService.GetStorageService(path); Assert.ThrowsException <Exception>(() => new CustomerRepository(storageService)); }
public void Modify(StorageLocationEntity StorageLocation) { if (StorageLocation != null) { StorageLocation.OperatorID = CurrentUser.UserID; } StorageLocationService.ModifyStorageLocation(StorageLocation); Response.Redirect("/StorageLocation/"); }
public async Task CustomerRepository_should_return_data_with_specific_distance() { var storageService = StorageLocationService.GetStorageService(Helper.OutputPath); var repository = new CustomerRepository(storageService); var result = await repository.GetCustomersWithinSpecificDistanceAsync(ConfigurationManager.Settings.OfficeLocation, 100); Assert.IsNotNull(result); Assert.AreEqual(3, result.Count()); }
public async Task CustomerRepository_should_return_data_for_valid_source() { var storageService = StorageLocationService.GetStorageService(Helper.OutputPath); var repository = new CustomerRepository(storageService); var result = await repository.GetCustomersAsync(); Assert.IsNotNull(result); Assert.AreEqual(4, result.Count()); }
public CustomerInvitationManager(string customerFileLocation) { var storageService = StorageLocationService.GetStorageService(customerFileLocation); customerService = new CustomerRepository(storageService); outputWriters = new IOutputWriter[] { new ConsoleWriter(), new CustomerOutputFileWriter(customerService) }; }
public ActionResult Edit(string cid) { //库位区域 ViewBag.StorageAreas = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "StorageAreaNo00" && t.Status == 1).ToList(); //仓库 ViewBag.Storage = StorageService.GetStorageByRule("", 1);//只显示使用中的数据 if (!string.IsNullOrEmpty(cid)) { ViewBag.StorageLocation = StorageLocationService.GetStorageLocationEntityById(cid.ToLong(0)); } else { ViewBag.StorageLocation = new StorageLocationEntity(); } return(View()); }
/// <summary> /// 库位查询 /// </summary> /// <param name="storageid"></param> /// <param name="storageareano"></param> /// <param name="status"></param> /// <param name="p"></param> /// <returns></returns> public ActionResult InventoryLocation(int storageid = -1, string storageareano = "", string storagesubareano = "", int status = -1, int p = 1) { List <StorageLocationEntity> mList = null; int storageidn = storageid; int count = StorageLocationService.GetStorageLocationCount(storageidn, storageareano, storagesubareano, status); PagerInfo pager = new PagerInfo(); pager.PageIndex = p; pager.PageSize = 50; pager.SumCount = count; pager.URL = "InventoryLocation"; //仓库 ViewBag.Storage = StorageService.GetStorageByRule("", 1);//只显示使用中的数据 ////库位区域 //ViewBag.AreasNo = StorageLocationService.GetAreaNoByStorageID(storageid, status); ////库位子区域 //ViewBag.SubAreasNo = StorageLocationService.GetSubAreaNoByStorageAreaNo(storageareano, status); if (storageidn > -1 || status > -1 || !string.IsNullOrEmpty(storageareano) || !string.IsNullOrEmpty(storagesubareano)) { mList = StorageLocationService.GetStorageLocationInfoByRule(storageidn, storageareano, storagesubareano, status, pager); } else { mList = StorageLocationService.GetStorageLocationInfoPager(pager); } ViewBag.AreasNo = storageareano; ViewBag.SubAreasNo = storagesubareano; ViewBag.LocationHtml = GetHtml(mList); ViewBag.StorageID = storageid; ViewBag.Status = status; ViewBag.storageAreaNo = storageareano; ViewBag.StorageLocation = mList; ViewBag.Pager = pager; return(View()); }
/// <summary> /// 根据仓库区域筛选对应的库位子区域 /// </summary> /// <param name="pid"></param> /// <returns></returns> public JsonResult GetStorageSubAreaNo(string areaNo) { List <StorageLocationEntity> list = StorageLocationService.GetSubAreaNoByStorageAreaNo(areaNo, 1); return(Json(list)); }
/// <summary> /// 根据仓库ID筛选对应的库位区域 /// </summary> /// <param name="pid"></param> /// <returns></returns> public JsonResult GetStorageAreaNo(int sid) { List <StorageLocationEntity> list = StorageLocationService.GetAreaNoByStorageID(sid, 1); return(Json(list)); }
public void StorageLocationService_Should_return_null_when_empty_path() { var storageService = StorageLocationService.GetStorageService(null); Assert.IsNull(storageService); }
public void StorageLocationService_Should_return_OnlineStorageService_for_validUri() { var storageService = StorageLocationService.GetStorageService("https://google.com"); Assert.IsInstanceOfType(storageService, typeof(OnlineStorageService)); }
public void Remove(string cid) { StorageLocationService.Remove(long.Parse(cid)); Response.Redirect("/StorageLocation/"); }