private void RptBind(string _strWhere, string _orderby) { this.page = AXRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; ax_depot_category bll = new ax_depot_category(); 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("depot_category_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { ax_depot_category bll = new ax_depot_category(); 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()); } JscriptMsg(this.Page, " 排序保存成功", Utils.CombUrlTxt("depot_category_list.aspx", "keywords={0}&page={1}", this.keywords, this.page.ToString()), "Success"); }
private bool DoAdd() { ax_depot_category model = new ax_depot_category(); if (model.Exists(txttitle.Text.Trim())) { JscriptMsg(this.Page, "您输入的发货仓库名称已经存在,请检查!", "", "Error"); return(false); } model.title = txttitle.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.remark = txtremark.Text.Trim(); if (model.Add() > 0) { AddAdminLog("添加", "添加发货仓库:" + txttitle.Text); //记录日志 return(true); } return(false); }