private void ShowInfo(int _id) { BLL.floor bll = new BLL.floor(); Model.floor model = bll.GetModel(_id); rblBelongChannel.SelectedValue = model.belongchannel.ToString(); txtfloorname.Text = model.floorname; txtTitle.Text = model.title; txtcolor.Text = model.color; txtRemark.Text = model.remark; rblStatus.SelectedValue = model.status; txtSortId.Text = model.sort_id.ToString(); }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; BLL.floor bll = new BLL.floor(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("floor_list.aspx", "keywords={0}&property={1}&page={2}", this.keywords, this.property, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private bool DoAdd() { bool result = false; Model.floor model = new Model.floor(); BLL.floor bll = new BLL.floor(); model.belongchannel = int.Parse(rblBelongChannel.SelectedValue); model.floorname = txtfloorname.Text.Trim(); model.title = txtTitle.Text.Trim(); model.color = txtcolor.Text.Trim(); model.remark = txtRemark.Text.Trim(); model.status = rblStatus.SelectedValue; model.sort_id = int.Parse(txtSortId.Text.Trim()); if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加楼层:" + model.title); //记录日志 result = true; } return result; }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { BLL.floor bll = new BLL.floor(); Repeater rptList = new Repeater(); rptList = this.rptList; for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } bll.UpdateField(id, "sort_id=" + sortId.ToString()); } AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "保存楼层排序"); //记录日志 JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("floor_list.aspx", "keywords={0}&&property={1}", this.keywords, this.property), "Success"); }
private bool DoEdit(int _id) { bool result = false; BLL.floor bll = new BLL.floor(); Model.floor model = bll.GetModel(_id); model.belongchannel = int.Parse(rblBelongChannel.SelectedValue); model.floorname = txtfloorname.Text.Trim(); model.title = txtTitle.Text.Trim(); model.color = txtcolor.Text.Trim(); model.remark = txtRemark.Text.Trim(); model.status = rblStatus.SelectedValue; model.sort_id = int.Parse(txtSortId.Text.Trim()); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改楼层:" + model.title); //记录日志 result = true; } return(result); }