protected void cbType_SelectedIndexChanged(object sender, EventArgs e) { int id; int.TryParse(cbType.SelectedValue.ToString(), out id); if (id < 4) { cbItem.DataSource = MyEnumHelper.GetEnumList <ItemEnum>().Where(i => i.Id < 10).ToList(); cbItem.DisplayMember = "Name"; cbItem.ValueMember = "Id"; cbItem.SelectedIndex = 0; } if (id == 4) { cbItem.DataSource = MyEnumHelper.GetEnumList <ItemEnum>().Where(i => i.Id >= 10 && i.Id < 20).ToList(); cbItem.DisplayMember = "Name"; cbItem.ValueMember = "Id"; cbItem.SelectedIndex = 0; } if (id == 5) { cbItem.DataSource = MyEnumHelper.GetEnumList <ItemEnum>().Where(i => i.Id >= 20).ToList(); cbItem.DisplayMember = "Name"; cbItem.ValueMember = "Id"; cbItem.SelectedIndex = 0; } }
public ApiResult PayTypes() { var res = MyEnumHelper.GetEnumList <ReceiptTypeEnum>(); return(new ApiResult { status = 1, data = res }); }
public ApiResult State() { //var res = await idNameService.GetByTypeNameAsync("订单状态"); var res = MyEnumHelper.GetEnumList <OrderStateEnum>(); return(new ApiResult { status = 1, data = res }); }
private void Home_Load(object sender, EventArgs e) { var typeList = MyEnumHelper.GetEnumList <TypeEnum>(); cbType.DataSource = typeList; cbType.DisplayMember = "Name"; cbType.ValueMember = "Id"; cbType.SelectedIndex = 0; statService.Add(); Bind(); }
public async Task <ActionResult> List(int?orderStateId, string keyword, DateTime?startTime, DateTime?endTime, int pageIndex = 1) { var result = await orderService.GetDeliverModelListAsync(null, orderStateId, keyword, startTime, endTime, pageIndex, pageSize); DeliverListViewModel res = new DeliverListViewModel(); res.Orders = result.Orders; res.PageCount = result.PageCount; res.OrderStates = MyEnumHelper.GetEnumList <OrderStateEnum>().Where(s => s.id == (int)OrderStateEnum.待发货 || s.id == (int)OrderStateEnum.已发货).ToArray(); return(Json(new AjaxResult { Status = 1, Data = res })); }
public async Task <ActionResult> List(int?orderStateId, string keyword, DateTime?startTime, DateTime?endTime, int pageIndex = 1) { var result = await orderService.GetModelListAsync(null, orderStateId, null, keyword, startTime, endTime, pageIndex, pageSize); OrderListViewModel model = new OrderListViewModel(); model.Orders = result.Orders; model.PageCount = result.PageCount; model.OrderStates = MyEnumHelper.GetEnumList <OrderStateEnum>(); return(Json(new AjaxResult { Status = 1, Data = model })); }
public async Task <ActionResult> List(long?stateId, string keyword, DateTime?startTime, DateTime?endTime, int pageIndex = 1) { TakeCashSearchResult result = await takeCashService.GetModelListAsync(null, stateId, keyword, startTime, endTime, pageIndex, pageSize); TakeCashListViewModel model = new TakeCashListViewModel(); model.TakeCashes = result.TakeCashes; model.PageCount = result.PageCount; model.States = MyEnumHelper.GetEnumList <TakeCashStateEnum>(); return(Json(new AjaxResult { Status = 1, Data = model })); }
public long Add() { using (MyDbContext dbc = new MyDbContext()) { if (dbc.GetAll <StatEntity>().AsNoTracking().Any()) { return(-1); } var typeList = MyEnumHelper.GetEnumList <TypeEnum>(); var itemList = MyEnumHelper.GetEnumList <ItemEnum>(); StatEntity entity; foreach (var type in typeList) { if (type.Id <= 3) { var items = itemList.Where(i => i.Id < 10); foreach (var item in items) { entity = new StatEntity(); entity.ItemId = item.Id; entity.TypeId = type.Id; dbc.Stats.Add(entity); } } if (type.Id == 4) { var items = itemList.Where(i => i.Id >= 10 && i.Id < 20); foreach (var item in items) { entity = new StatEntity(); entity.ItemId = item.Id; entity.TypeId = type.Id; dbc.Stats.Add(entity); } } if (type.Id == 5) { var items = itemList.Where(i => i.Id > 20); foreach (var item in items) { entity = new StatEntity(); entity.ItemId = item.Id; entity.TypeId = type.Id; dbc.Stats.Add(entity); } } } dbc.SaveChanges(); return(1); } }
//[Permission("幻灯片管理_删除幻灯片")] public async Task <ActionResult> TeamList(string mobile, long?teamLevel, string keyword, DateTime?startTime, DateTime?endTime, int pageIndex = 1) { var res = await userService.GetModelTeamListAsync(mobile, teamLevel, keyword, startTime, endTime, pageIndex, pageSize); TeamListViewModel model = new TeamListViewModel(); model.PageCount = res.PageCount; model.TotalCount = res.TotalCount; model.Members = res.Members; model.TeamLevels = MyEnumHelper.GetEnumList <TeamLevelEnum>(); model.TeamLeader = res.TeamLeader; return(Json(new AjaxResult { Status = 1, Data = model })); }
//[Permission("幻灯片管理_删除幻灯片")] public async Task <ActionResult> List(int?levelId, string keyword, DateTime?startTime, DateTime?endTime, int pageIndex = 1) { //await orderService.AutoConfirmAsync(); var result = await userService.GetModelListAsync(levelId, keyword, startTime, endTime, pageIndex, pageSize); TeamUserListViewModel model = new TeamUserListViewModel(); model.PageCount = result.PageCount; model.Users = result.Users; model.Levels = MyEnumHelper.GetEnumList <LevelEnum>(); model.TeamLevels = MyEnumHelper.GetEnumList <TeamLevelEnum>(); return(Json(new AjaxResult { Status = 1, Data = model })); }
public async Task <ActionResult> List(int?levelId, string keyword, DateTime?startTime, DateTime?endTime, int pageIndex = 1) { //await orderService.AutoConfirmAsync(); //long levelId = await idNameService.GetIdByNameAsync("会员等级"); var result = await userService.GetModelListAsync(levelId, keyword, startTime, endTime, pageIndex, pageSize); var set1 = new SettingDTO(); UserListViewModel model = new UserListViewModel(); model.ThreePlay = new SettingModel { Id = set1.Id, Name = set1.Name, Parm = set1.Param }; model.PageCount = result.PageCount; model.Users = result.Users; model.Levels = MyEnumHelper.GetEnumList <LevelEnum>(); //model.UserUps = (await settingService.GetModelListAsync("会员升级")).Select(s => new SettingModel { Id = s.Id, Parm = s.Param, Name=s.Name}).ToList(); //model.Discounts = (await settingService.GetModelListAsync("会员优惠")).Select(s => new SettingModel { Id = s.Id, Parm = s.Param, Name=s.Name}).ToList(); return(Json(new AjaxResult { Status = 1, Data = model })); }
private void AddEdit_Load(object sender, EventArgs e) { cbType.DataSource = MyEnumHelper.GetEnumList <TypeEnum>(); cbType.DisplayMember = "Name"; cbType.ValueMember = "Id"; cbType.SelectedIndex = 0; cbItem.DataSource = MyEnumHelper.GetEnumList <ItemEnum>().Where(i => i.Id < 10).ToList(); cbItem.DisplayMember = "Name"; cbItem.ValueMember = "Id"; cbItem.SelectedIndex = 0; if (action == "Edit") { var res = checkWorkService.GetModel(id); if (res == null) { return; } cbType.SelectedValue = res.TypeId; cbItem.SelectedValue = res.ItemId; txtNumber.Text = res.Number.ToString(); txtAmount.Text = res.Amount.ToString(); } }
public ApiResult List() { return(new ApiResult { status = 1, data = MyEnumHelper.GetEnumList <PayTypeEnum>() }); }
public long Calc() { using (MyDbContext dbc = new MyDbContext()) { if (!dbc.GetAll <StatEntity>().AsNoTracking().Any()) { return(-1); } var typeList = MyEnumHelper.GetEnumList <TypeEnum>(); var itemList = MyEnumHelper.GetEnumList <ItemEnum>(); DateTime time = DateTime.Now; StatEntity stat; IQueryable <CheckWorkEntity> result; foreach (var type in typeList) { if (type.Id <= 3) { var items = itemList.Where(i => i.Id < 10); foreach (var item in items) { result = dbc.GetAll <CheckWorkEntity>().AsNoTracking().Where(c => c.TypeId == type.Id && c.ItemId == item.Id); if (result.Count() <= 0) { continue; } stat = dbc.GetAll <StatEntity>().SingleOrDefault(s => s.TypeId == type.Id && s.ItemId == item.Id); //if(time.Month) //stat.QuarterNumber = result.Where(c=>c.CreateTime); stat.QuarterAmount = 0; stat.YearNumber = 0; stat.YearAmount = 0; stat.TotalNumber = 0; stat.TotalAmount = 0; dbc.SaveChanges(); } } if (type.Id == 4) { var items = itemList.Where(i => i.Id >= 10 && i.Id < 20); foreach (var item in items) { stat = new StatEntity(); stat.ItemId = item.Id; stat.TypeId = type.Id; dbc.Stats.Add(stat); } } if (type.Id == 5) { var items = itemList.Where(i => i.Id > 20); foreach (var item in items) { stat = new StatEntity(); stat.ItemId = item.Id; stat.TypeId = type.Id; dbc.Stats.Add(stat); } } } dbc.SaveChanges(); return(1); } }
public AjaxResult StateTypes() { return(new AjaxResult { Status = 1, Data = MyEnumHelper.GetEnumList <OrderStateEnum>() }); }
public ApiResult Levels() { return(new ApiResult { status = 1, data = MyEnumHelper.GetEnumList <TeamLevelEnum>() }); }