private void Bind() { int totalCount = 0; string liAppend = "开奖:<select id=\"cbbLItem\" class=\"easyui-combobox\" style=\"width:200px;\">"; BLL.LotteryItem liBll = new BLL.LotteryItem(); List <Model.LotteryItem> liList = liBll.GetList(1, 1000, out totalCount, "", null); if (liList != null) { foreach (Model.LotteryItem model in liList) { liAppend += "<option value=\"" + model.ItemCode + "\">" + model.ItemName + "</option>"; } } liAppend += "</select>"; dlgContent.InnerHtml = liAppend; BLL.RunLottery rlBll = new BLL.RunLottery(); rpData.DataSource = rlBll.GetDataSet(1, 5, out totalCount, "", null);; rpData.DataBind(); }
/// <summary> /// 批量删除数据 /// </summary> private void OnDelete() { string itemsAppend = hV.Value.Trim(); if (string.IsNullOrEmpty(itemsAppend)) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "请至少勾选一行进行操作", "错误提醒", "error"); return; } if (bll == null) { bll = new BLL.LotteryItem(); } string[] itemsAppendArr = itemsAppend.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); List <string> list = itemsAppendArr.ToList <string>(); if (bll.DeleteBatch(list)) { WebHelper.MessageBox.MessagerShow(this.Page, lbtnPostBack, "操作成功"); Bind(); } else { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "操作失败", "系统提示"); } }
private void Bind() { //查询条件 GetSearchItem(); int totalCount = 0; if (bll == null) { bll = new BLL.LotteryItem(); } rpData.DataSource = bll.GetDataSet(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out totalCount, sqlWhere, parms == null ? null : parms.ToArray());; rpData.DataBind(); AspNetPager1.RecordCount = totalCount; }
private void Bind() { if (!string.IsNullOrEmpty(nId)) { if (bll == null) { bll = new BLL.LotteryItem(); } Model.LotteryItem model = bll.GetModel(nId); if (model != null) { txtName.Value = model.ItemName; txtCode.Value = model.ItemCode; txtImageUrl.Value = model.ImageUrl; } } }
/// <summary> /// 获取当前区间数据行的数据列表 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <returns></returns> public static List <Model.LotteryItem> GetList() { BLL.LotteryItem bll = new BLL.LotteryItem(); if (!enableCaching) { return(bll.GetList(1, 100, "", null)); } string key = "lotteryItem_All"; List <Model.LotteryItem> data = (List <Model.LotteryItem>)HttpRuntime.Cache[key]; if (data == null) { data = bll.GetList(1, 100, "", null); AggregateCacheDependency cd = DependencyFactory.GetLotteryItemDependency(); HttpRuntime.Cache.Add(key, data, cd, DateTime.Now.AddHours(timeOut), Cache.NoSlidingExpiration, CacheItemPriority.High, null); } return(data); }
private void OnSave() { string sName = txtName.Value.Trim(); if (string.IsNullOrEmpty(sName)) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "名称不能为空,请检查", "错误提醒", "error"); return; } string sCode = txtCode.Value.Trim(); if (string.IsNullOrEmpty(sCode)) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "代号不能为空,请检查", "错误提醒", "error"); return; } string sRatio = txtRatio.Value.Trim(); if (string.IsNullOrEmpty(sRatio)) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "赔率不能为空,请检查", "错误提醒", "error"); return; } decimal ratio = 0; if (!decimal.TryParse(sRatio, out ratio)) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "赔率正确格式为整数,请检查", "错误提醒", "error"); return; } string sImageUrl = txtImageUrl.Value.Trim(); if (string.IsNullOrEmpty(sImageUrl)) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "图片不能为空,请检查", "错误提醒", "error"); return; } if (bll == null) { bll = new BLL.LotteryItem(); } Model.LotteryItem model = new Model.LotteryItem(); model.ItemName = sName; model.ItemCode = sCode; model.ImageUrl = sImageUrl; model.FixRatio = ratio; model.LastUpdatedDate = DateTime.Now; int effectCount = -1; if (!string.IsNullOrEmpty(nId)) { model.NumberID = nId; effectCount = bll.Update(model); } else { effectCount = bll.Insert(model); } if (effectCount == 110) { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "已存在相同记录", "温馨提醒", "error"); return; } if (effectCount > 0) { WebHelper.MessageBox.MessagerShow(this.Page, lbtnPostBack, "操作成功"); } else { WebHelper.MessageBox.Messager(this.Page, lbtnPostBack, "操作失败"); } }