/// <summary> /// 商品选择器 /// </summary> /// <param name="name"></param> /// <param name="mcode"></param> /// <param name="CustomerID"></param> /// <param name="status"></param> /// <param name="p"></param> /// <returns></returns> /// 商品选择器 从库存中筛选 public ActionResult OrderInventorySelect(string name = "", string bnumber = "", int storageID = 0, int CustomerID = 0, int status = -1, int p = 1) { List <InventoryEntity> mList = null; int count = InventoryService.GetInventoryCount(name, bnumber, storageID, CustomerID); PagerInfo pager = new PagerInfo(); pager.PageIndex = p; pager.PageSize = PAGESIZE; pager.SumCount = count; pager.URL = "OrderInventorySelect"; //客户信息 ViewBag.Customer = CustomerService.GetCustomerByRule("", 1);//只显示使用中的数据 ViewBag.GoodsModel = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "GoodsCode" && t.Status == 1).ToList(); if (!string.IsNullOrEmpty(name) || storageID > 0 || CustomerID > 0 || !string.IsNullOrEmpty(bnumber)) { mList = InventoryService.GetInventoryInfoByRule(name, bnumber, storageID, CustomerID, pager); } else { mList = InventoryService.GetInventoryInfoPager(pager); } ViewBag.StorageID = storageID; ViewBag.Name = name ?? ""; ViewBag.Status = status; ViewBag.Description = bnumber; ViewBag.CustomerID = CustomerID; ViewBag.Goods = mList; ViewBag.Pager = pager; return(View()); }
public static NewsEntity TranslateNewsEntity(NewsInfo info, bool isApi) { NewsEntity entity = new NewsEntity(); entity.ID = info.ID; entity.ChannelID = info.ChannelID; entity.Title = info.Title; entity.AttachmentIDs = info.AttachmentIDs; entity.zhaiyao = info.zhaiyao; if (isApi)//如果API接口调用 需要将图片地址替换成完成路径 { entity.Content = info.Content.Replace("/Scripts/", FileUrl + "/Scripts/"); } else { entity.Content = info.Content; } entity.Sort = info.Sort; entity.Status = info.Status; entity.Operator = info.Operator; entity.CreateDate = info.CreateDate; entity.ModifyDate = info.ModifyDate; List <AttachmentEntity> lstAttach = BaseDataService.GetAttachmentInfoByKyes(info.AttachmentIDs); if (isApi == false) { entity.Attachments = lstAttach; } if (lstAttach != null && lstAttach.Count > 0) { entity.ImageUrl = lstAttach[0].FilePath.Replace("~", FileUrl); } return(entity); }
/// <summary> /// 商品选择器 /// </summary> /// <param name="name"></param> /// <param name="mcode"></param> /// <param name="CustomerID"></param> /// <param name="status"></param> /// <param name="p"></param> /// <returns></returns> /// 商品选择器 从商品中筛选 public ActionResult OrderGoodsSelect(string type = "", string name = "", string goodsType = "", int carrierid = 0, int storageID = 0, int customerid = 0, int status = -1, int p = 1) { List <GoodsEntity> goodsList = null; List <InventoryEntity> inventoryList = null; PagerInfo pager = new PagerInfo(); //运输订单A 运输订单B 从订单表中获取数据 if (!string.IsNullOrEmpty(type) && type.Equals("YSDDA") || type.Equals("YSDDB")) { int count = GoodsService.GetGoodsCount(name, "", customerid, status); pager.PageIndex = p; pager.PageSize = PAGESIZE; pager.SumCount = count; pager.URL = "OrderGoodsSelect"; //客户信息 ViewBag.Customer = CustomerService.GetCustomerByRule("", 1);//只显示使用中的数据 ViewBag.GoodsModel = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "GoodsCode" && t.Status == 1).ToList(); if (!string.IsNullOrEmpty(name) || storageID > 0 || customerid > 0 || carrierid > 0) { goodsList = GoodsService.GetGoodsInfoByRule(name, "", customerid, status, pager); } else { goodsList = GoodsService.GetGoodsInfoPager(pager); } } else { //仓配订单 调拨订单从库存表中获取数据 int count = InventoryService.GetInventoryCount(name, "", storageID, customerid); pager.PageIndex = p; pager.PageSize = PAGESIZE; pager.SumCount = count; pager.URL = "OrderGoodsSelect"; //客户信息 ViewBag.Customer = CustomerService.GetCustomerByRule("", 1);//只显示使用中的数据 ViewBag.GoodsModel = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "GoodsCode" && t.Status == 1).ToList(); if (!string.IsNullOrEmpty(name) || storageID > 0) { inventoryList = InventoryService.GetInventoryInfoByRule(name, "", storageID, customerid, pager); } else { inventoryList = InventoryService.GetInventoryInfoPager(pager); } } ViewBag.StorageID = storageID; ViewBag.Name = name ?? ""; ViewBag.Status = status; ViewBag.GoodsType = goodsType; ViewBag.CustomerID = customerid; ViewBag.GoodsList = goodsList; ViewBag.InventoryList = inventoryList; ViewBag.Pager = pager; ViewBag.TYPE = type;//运输订单A:YSDDA 运输订单B:YSDDB 仓配订单:CPDD 调拨订单:DBDD return(View()); }
public ActionResult Index(string customerid, string paytype, int status = -1, int p = 1) { ReservationsSearchEntity search = new ReservationsSearchEntity(); search.CustomerID = customerid.ToLong(0); search.PayType = paytype; search.Status = status; int count = ReservationsService.GetReservationsCount(search); PagerInfo pager = new PagerInfo(); pager.PageIndex = p; pager.PageSize = PAGESIZE; pager.SumCount = count; pager.URL = "/Rev"; List <CustomerEntity> customers = CustomerService.GetCustomerList(); List <BaseDataEntity> paytypes = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "P00").ToList(); ViewBag.Search = search; List <ReservationsEntity> mList = ReservationsService.GetReservationsByRule(search, pager); ViewBag.Reservations = mList; ViewBag.Pager = pager; ViewBag.Customers = customers; ViewBag.PayTypes = paytypes; return(View()); }
public ActionResult Index(string name, string mcode, int status = -1, int p = 1) { List <CarEntity> mList = null; int count = CarService.GetCarCount(name, mcode, status); PagerInfo pager = new PagerInfo(); pager.PageIndex = p; pager.PageSize = PAGESIZE; pager.SumCount = count; pager.URL = "/Car"; ViewBag.CarModel = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "C00" && t.Status == 1).ToList(); if (!string.IsNullOrEmpty(name) || status > -1 || !string.IsNullOrEmpty(mcode)) { mList = CarService.GetCarInfoByRule(name, mcode, status, pager); } else { mList = CarService.GetCarInfoPager(pager); } ViewBag.Name = name ?? ""; ViewBag.Status = status; ViewBag.ModelCode = mcode; ViewBag.Cars = mList; ViewBag.Pager = pager; return(View()); }
/// <summary> /// 获取所有有汽车、有充电桩的城市 /// </summary> /// <returns></returns> public JsonResult GetAllHasCity() { List <City> lstCity = new List <City>(); lstCity = BaseDataService.GetAllHasCity(); return(Json(JsonHelper.ToJson <List <City> >(lstCity))); }
/// <summary> /// 仓配订单/调拨订单 /// 运输订单A/运输订单B 添加 /// </summary> /// <param name="type"></param> /// <returns></returns> public ActionResult OrderAdd(string type, int orderid = 0) { //默认承运商 //ViewBag.Carrier = CarrierService.GetCarrierByRule("", 1);//只显示使用中的数据 //默认仓库 //ViewBag.Storage = StorageService.GetStorageByRule("", 1);//只显示使用中的数据 //门店 //ViewBag.Goods = GoodsService.GetGoodsByRule("", 1);//只显示使用中的数据 //客户信息 ViewBag.Customer = CustomerService.GetCustomerByRule("", 1);//只显示使用中的数据 //温度 ViewBag.TemList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "TM00" && t.Status == 1).ToList(); //收货方类型 ViewBag.ReceiverList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "Reveiver00" && t.Status == 1).ToList(); //物流方式 ViewBag.DeliverList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "DeliverModel00" && t.Status == 1).ToList(); //收货人信息 //ViewBag.Receiver = ReceiverService.GetReceiverByRule("", "", "", 1);//只显示使用中的数据 ViewBag.CarModel = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "CarModel00" && t.Status == 1).ToList(); OrderEntity entity = new OrderEntity(); entity.OrderNo = OrderService.GetOrderNo(); ViewBag.Order = entity; ViewBag.ButtonName = "发布订单"; if (orderid > 0) { ViewBag.ButtonName = "确认修改"; ViewBag.Order = OrderService.GetOrderByOrderID(orderid); } ViewBag.TypeName = StringHelper.getOrderType(type); ViewBag.Type = type; return(View()); }
/// <summary> /// /// </summary> /// <returns></returns> public List <Productos> Listar() { var db = new BaseDataService <Productos>(); var lista = db.Get(); return(lista); }
/// <summary> /// 获取传入订单号 /// </summary> /// <param name="ids"></param> /// <param name="typedesc">送货单、补损单</param> /// <returns></returns> private List <OrderEntity> getOrderList(string ids, string typedesc) { List <OrderEntity> list = new List <OrderEntity>(); if (!string.IsNullOrEmpty(ids)) { string[] strs = ids.Split(','); foreach (string str in strs) { if (!string.IsNullOrEmpty(str)) { OrderEntity entity = OrderService.GetOrderEntityById(str.ToInt(0)); entity.TypeDesc = typedesc; List <BaseDataEntity> baseList = BaseDataService.GetBaseDataByType(entity.OrderSource); entity.CompanyName = baseList != null && baseList.Count > 0 ? baseList[0].ValueInfo : ""; if (entity != null) { list.Add(entity); } //更新订单接单(下载)状态 OrderService.UpdateUploadStatus(str.ToInt(0), 1); } } } return(list); }
public ActionResult Edit(string cid) { //省份 ViewBag.Province = BaseDataService.GetAllProvince(); //默认承运商 ViewBag.Carrier = CarrierService.GetCarrierByRule("", 1); //只显示使用中的数据 //默认仓库 ViewBag.Storage = StorageService.GetStorageByRule("", 1); //只显示使用中的数据 //客户信息 ViewBag.Customer = CustomerService.GetCustomerByRule("", 1); //只显示使用中的数据 //收货方类型 ViewBag.ReceiverList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "Reveiver00" && t.Status == 1).ToList(); if (!string.IsNullOrEmpty(cid)) { ReceiverEntity entity = ReceiverService.GetReceiverEntityById(cid.ToLong(0)); entity.Url = UrlPar; ViewBag.Receiver = entity; } else { ViewBag.Receiver = new ReceiverEntity(); } return(View()); }
private static ChargingBaseEntity TranslateChargingBaseInfo(ChargingBaseInfo chargeBaseInfo) { ChargingBaseEntity chargingBaseEntity = new ChargingBaseEntity(); if (chargeBaseInfo != null) { chargingBaseEntity.ChargeBaseID = chargeBaseInfo.ChargeBaseID; chargingBaseEntity.Name = chargeBaseInfo.Name; chargingBaseEntity.Code = chargeBaseInfo.Code; chargingBaseEntity.ChargeFee = chargeBaseInfo.ChargeFee; chargingBaseEntity.ServerFee = chargeBaseInfo.ServerFee; chargingBaseEntity.ParkFee = chargeBaseInfo.ParkFee; chargingBaseEntity.ChargeNum = chargeBaseInfo.ChargeNum; chargingBaseEntity.PayType = chargeBaseInfo.PayType; chargingBaseEntity.Address = chargeBaseInfo.Address; chargingBaseEntity.Coordinate = chargeBaseInfo.Coordinate; chargingBaseEntity.StartTime = chargeBaseInfo.StartTime; chargingBaseEntity.EndTime = chargeBaseInfo.EndTime; chargingBaseEntity.IsUse = chargeBaseInfo.IsUse; chargingBaseEntity.CityID = chargeBaseInfo.CityID; if (!string.IsNullOrEmpty(chargingBaseEntity.PayType)) { chargingBaseEntity.PayTypeName = GetPayTypeNames(chargingBaseEntity.PayType); } if (chargingBaseEntity.CityID > 0) { City city = BaseDataService.GetAllCity().FirstOrDefault(t => t.CityID == chargingBaseEntity.CityID); chargingBaseEntity.CityInfo = city; } } return(chargingBaseEntity); }
public void ShouldAddGames() { using (var db = new JUGContext()) { var teamDataService = new BaseDataService <TeamDAO>(); var gameDataService = new GameDataService(); Assert.Empty(teamDataService.GetAll(db)); Assert.Empty(gameDataService.GetAll(db)); DbHelper.AddSomeTeams(10, db); var game = new GameDAO(); game.Home = teamDataService.GetAll(db).Where(t => t.Name == "Team 1").FirstOrDefault(); game.Away = teamDataService.GetAll(db).Where(t => t.Name == "Team 6").FirstOrDefault(); game.AwayScore = 5; game.HomeScore = 6; game.IsComplete = true; game.IsStarted = true; game.CanTie = true; gameDataService.Create(game, db); Assert.Single(db.Games.Local); } }
public void LogException(Exception exception) { try { string userId = null; try { userId = HttpContext.Current.User.Identity.Name; } catch { /* Enviar un correo electrónico al webmaster */ } var error = new Error() { UserId = userId, Exception = exception.GetType().FullName, Message = exception.Message, Everything = exception.ToString(), IpAddress = HttpContext.Current.Request.UserHostAddress, UserAgent = HttpContext.Current.Request.UserAgent, PathAndQuery = HttpContext.Current.Request.Url == null ? "" : HttpContext.Current.Request.Url.PathAndQuery, HttpReferer = HttpContext.Current.Request.UrlReferrer == null ? "" : HttpContext.Current.Request.UrlReferrer.PathAndQuery, }; var db = new BaseDataService <Error>(); db.Create(error); } catch (Exception ex) { /* Enviar un correo electrónico al webmaster */ } }
/// <summary> /// 商品选择器 /// </summary> /// <param name="name"></param> /// <param name="mcode"></param> /// <param name="CustomerID"></param> /// <param name="status"></param> /// <param name="p"></param> /// <returns></returns> public ActionResult GoodsSelect(string name, string mcode, int CustomerID = -1, int status = -1, int p = 1) { List <GoodsEntity> mList = null; int count = GoodsService.GetGoodsCount(name, mcode, CustomerID, status); PagerInfo pager = new PagerInfo(); pager.PageIndex = p; pager.PageSize = PAGESIZE; pager.SumCount = count; pager.URL = "GoodsSelect"; //客户信息 ViewBag.Customer = CustomerService.GetCustomerByRule("", 1);//只显示使用中的数据 ViewBag.GoodsModel = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "GoodsCode" && t.Status == 1).ToList(); if (!string.IsNullOrEmpty(name) || CustomerID > -1 || status > -1 || !string.IsNullOrEmpty(mcode)) { mList = GoodsService.GetGoodsInfoByRule(name, mcode, CustomerID, status, pager); } else { mList = GoodsService.GetGoodsInfoPager(pager); } ViewBag.Name = name ?? ""; ViewBag.Status = status; ViewBag.Description = mcode; ViewBag.CustomerID = CustomerID; ViewBag.Goods = mList; ViewBag.Pager = pager; return(View()); }
public void LogException(Exception exception) { // try-catch because database itself could be down or Request context is unknown. try { string userId = null; try { userId = HttpContext.Current.User.Identity.Name; } catch { /* no hacer nada, o enviar un correo electrónico al webmaster */ } // ** Prototype pattern. El objeto Error tiene sus valores predeterminados inicializados var error = new Error() { UserId = userId, Exception = exception.GetType().FullName, Message = exception.Message, Everything = exception.ToString(), IpAddress = HttpContext.Current.Request.UserHostAddress, //UserAgent = HttpContext.Current.Request.UserAgent, PathAndQuery = HttpContext.Current.Request.Url == null ? "" : HttpContext.Current.Request.Url.PathAndQuery, HttpReferer = HttpContext.Current.Request.UrlReferrer == null ? "" : HttpContext.Current.Request.UrlReferrer.PathAndQuery, }; var db = new BaseDataService <Error>(); db.Create(error); } catch (Exception ex) { /* no hacer nada, o enviar un correo electrónico al webmaster */ } }
public ActionResult Edit(string cid) { //默认承运商 ViewBag.Carrier = CarrierService.GetCarrierByRule("", 1); //只显示使用中的数据 //默认仓库 ViewBag.Storage = StorageService.GetStorageByRule("", 1); //只显示使用中的数据 //门店 ViewBag.Goods = GoodsService.GetGoodsByRule("", 1); //只显示使用中的数据 //客户信息 ViewBag.Customer = CustomerService.GetCustomerByRule("", 1); //只显示使用中的数据 //温度 ViewBag.TemList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "TM00" && t.Status == 1).ToList(); //收货方类型 ViewBag.ReceiverList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "Reveiver00" && t.Status == 1).ToList(); //收货方 ViewBag.DeliverList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "DeliverModel00" && t.Status == 1).ToList(); if (!string.IsNullOrEmpty(cid)) { ViewBag.PriceSet = PriceSetService.GetPriceSetEntityById(cid.ToLong(0)); } else { ViewBag.PriceSet = new PriceSetEntity(); } return(View()); }
/// <summary> /// 订单导入 /// </summary> /// <returns></returns> public JsonResult GoodsImportData() { List <GoodsEntity> list = new List <GoodsEntity>(); DataSet ds = new DataSet(); if (Request.Files.Count == 0) { throw new Exception("请选择导入文件!"); } String token = Request["token"]; Cache.Remove(token); // 保存文件到UploadFiles文件夹 for (int i = 0; i < Request.Files.Count; i++) { HttpPostedFileBase file = Request.Files[i]; var fileName = file.FileName; var filePath = Server.MapPath(string.Format("~/{0}", "UploadFiles")); string path = Path.Combine(filePath, fileName); file.SaveAs(path); ds = ExcelHelper.ImportBaseExceltoDt(path); list = BaseDataService.GetImportList(ds); //存入缓存 Cache.Add(token, list); } return(Json(list)); }
public ActionResult Index(string name, string receiverType, int customerID = -1, int status = -1, int p = 1) { List <ReceiverEntity> mList = null; int count = ReceiverService.GetReceiverCount(name, receiverType, customerID, status); PagerInfo pager = new PagerInfo(); pager.PageIndex = p; pager.PageSize = PAGESIZE; pager.SumCount = count; pager.URL = "/Receiver"; //客户信息 ViewBag.Customer = CustomerService.GetCustomerByRule("", 1);//只显示使用中的数据 //收货方类型 ViewBag.ReceiverList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "Reveiver00" && t.Status == 1).ToList(); if (!string.IsNullOrEmpty(name) || status > -1 || customerID > -1 || !string.IsNullOrEmpty(receiverType)) { mList = ReceiverService.GetReceiverInfoByRule(name, receiverType, customerID, status, pager); } else { mList = ReceiverService.GetReceiverInfoPager(pager); } ViewBag.Name = name ?? ""; ViewBag.Status = status; ViewBag.ReceiverType = receiverType; ViewBag.CustomerID = customerID; ViewBag.Receiver = mList; ViewBag.Pager = pager; return(View()); }
/// <summary> /// /// </summary> /// <returns></returns> public List <Category> Listar() { var db = new BaseDataService <Category>(); var lista = db.Get(); return(lista); }
/// <summary> /// 商品入库 /// </summary> /// <returns></returns> public ActionResult Index() { //温度 ViewBag.TemList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "TM00" && t.Status == 1).ToList(); //仓库信息 ViewBag.Storage = StorageService.GetStorageByRule("", 1);//只显示使用中的数据 return(View()); }
public void Constructor_BaseDataService() { var datastoreContextFactory = new Mock <IDatastoreContext <IDbProvider> >(); _baseDataService = new BaseDataServiceMock(datastoreContextFactory.Object); Assert.IsNotNull(_baseDataService); }
/// <summary> /// 保存Modbus串口设置 /// </summary> public static void SaveSystemSetting(SystemSetting setting) { _systemSetting = setting; BaseDataService.SaveSystemSetting(_systemSetting); SerialPortService.PortClose(); LoadSystemSetting(); //串口服务实例化 // SerialPortService = SerialPortService.Instance(_systemSetting.ModbusSetting, GetSlaveConfig(), _systemSetting.WarningCabinetId); }
public PopulateDatabaseController( ILogger <PopulateDatabaseController> logger, BaseDataService baseDataService, EuroStatFetchService euroStatFetchService ) { _logger = logger; this.baseDataService = baseDataService; this.euroStatFetchService = euroStatFetchService; }
public JsonResult searchAttachmentByIDs(string ids) { List <AttachmentEntity> listAtt = new List <AttachmentEntity>(); if (!string.IsNullOrEmpty(ids)) { listAtt = BaseDataService.GetAttachmentInfoByKyes(ids.TrimEnd(',')); } return(Json(listAtt)); }
/// <summary> /// 利润分析表 /// </summary> /// <param name="carrierid">承运商ID</param> /// <param name="storageid">仓库ID</param> /// <param name="customerid">客户ID</param> /// <param name="receivername">收货方</param> /// <param name="ordertype">订单类型</param> /// <param name="orderno">订单编号</param> /// <param name="begindate">订单开始时间</param> /// <param name="enddate">订单结束时间</param> /// <param name="p"></param> /// <returns></returns> public ActionResult ProfitReport(int carrierid = 0, int storageid = 0, int customerid = 0, string receivername = "", string ordertype = "", string orderno = "", string begindate = "", string enddate = "", int p = 1) { // 默认当月 if (string.IsNullOrEmpty(begindate) || string.IsNullOrEmpty(enddate)) { DateTime dt = DateTime.Now; begindate = dt.Year + "-" + dt.Month + "-" + "01"; enddate = DateTime.Now.ToString("yyyy-MM-dd"); } List <OrderEntity> mList = null; OrderFeeInfo feeinfo = ReportService.GetOrderCount("", carrierid, storageid, customerid, -1, -1, -1, ordertype, orderno, begindate, enddate, -1); int count = feeinfo.count; PagerInfo pager = new PagerInfo(); pager.PageIndex = p; pager.PageSize = PAGESIZE; pager.SumCount = count; pager.URL = "ProfitReport"; mList = ReportService.GetOrderInfoByRule(pager, "", carrierid, storageid, customerid, -1, -1, -1, ordertype, orderno, begindate, enddate, -1); //默认承运商 ViewBag.Carrier = CarrierService.GetCarrierByRule("", 1); //只显示使用中的数据 //默认仓库 ViewBag.Storage = StorageService.GetStorageByRule("", 1); //只显示使用中的数据 //客户信息 ViewBag.Customer = CustomerService.GetCustomerByRule("", 1); //只显示使用中的数据 //订单类型 List <BaseDataEntity> orderTypeList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "OrderTypeList").ToList(); ReEntity report = ReportService.CreateReportList(mList); report.TotalAllPayAmount = feeinfo.TotalAllPayAmount; report.TotalllReceiverAmount = feeinfo.TotalllReceiverAmount; ViewBag.Report = report; ViewBag.GUID = System.Guid.NewGuid().ToString(); ViewBag.carrierid = carrierid; ViewBag.storageid = storageid; ViewBag.customerid = customerid; ViewBag.OrderType = ordertype; ViewBag.BeginDate = begindate; ViewBag.EndDate = enddate; ViewBag.orderTypeList = orderTypeList; ViewBag.ReceiverName = receivername; //存入缓存 Cache.Add(ViewBag.GUID, report.reportList); ViewBag.Pager = pager; return(View()); }
public static void AddVerificationCode(string telephone, string vcode, int timeout) { VerificationCodeEntity entity = new VerificationCodeEntity(); entity.Mobile = telephone; entity.Email = ""; entity.VCode = vcode; entity.DeadLine = DateTime.Now.AddMinutes(timeout); entity.Status = 1;//0 失效 1有效 BaseDataService.AddVerificationCode(entity); }
public JsonResult GetCity(int pid) { List <City> listCity = BaseDataService.GetAllCity(); if (!listCity.IsEmpty()) { listCity = listCity.Where(t => t.ProvinceID == pid).ToList(); } return(Json(listCity)); }
public void Constructor_BaseDataService_Null() { try { _baseDataService = new BaseDataServiceMock(null); } catch (ArgumentNullException ex) { Assert.IsTrue(ex.ParamName == "datastoreContext"); throw; } }
public override IEnumerable <string> GetAllProducts() { var shouldRealoadData = (DateTime.Now - lastLoadedTime).TotalMinutes >= 1; if (cache == null || shouldRealoadData) { cache = BaseDataService.GetAllProducts(); lastLoadedTime = DateTime.Now; } return(cache); }
/// <summary> /// 初始化(OrderSortService初次调用时需要一点时间,所以在登陆窗口先调用一下,进行初始化,避免登陆后卡顿) /// </summary> public static void Initialize() { //更新邮寄方式 try { BaseDataService.UpdatePostTypes(); } catch (Exception ex) { SaveErrLogHelper.SaveErrorLog(string.Empty, ex.ToString()); } }
private static void Insert() { var service = new BaseDataService(); var list = new List<BaseDataDataModel> { new BaseDataDataModel {Path="/", GroupCode = "X", Code = "1", Name = "edward4", CreatedBy = "edward"}, new BaseDataDataModel {Path="/",GroupCode = "X", Code = "1", Name = "edward5", CreatedBy = "edward"} }; var list2 = new List<BaseDataDataModel>(); //list2.Add(new BaseDataDataModel { GroupCode = "Y", Code = "1", Name = "edward4", CreatedBy = "edward" }); //list2.Add(new BaseDataDataModel { GroupCode = "Y", Code = "1", Name = "edward5", CreatedBy = "edward" }); var listGroup = new List<BaseDataGroupDataModel> { new BaseDataGroupDataModel {Code = "A",CreatedOn=DateTime.Now}, new BaseDataGroupDataModel {Code = "B"} }; service.BulkInsert(listGroup); }
private static void Update() { var service = new BaseDataService(); var list = service.Fetch(new Sql<BaseDataDataModel>().Where(t => t.RowStatus == 0)); service.Update(list[0]); service.Update(list[0], t => t.RowStatus); //service.Update(new Expression<Func<BaseDataDataModel, object>>[]{t => t.Name, t => t.GroupCode}, list, t => t.RowStatus, t => t.Code); }
private static void Page() { var service = new BaseDataService(); var list = service.Fetch(new Sql<BaseDataDataModel>("T").Select(t=>t.Name).From().Where(t => t.RowStatus == 0 && t.Id > 10).OrderBy(t=>t.CreatedOn,t=>t.RowStatus).OrderByDescending(t=>t.Name)); var page = service.Page(2, 15, new Sql<BaseDataDataModel>().Where(t => t.RowStatus == 0 && t.Id > 10)); }