protected void btnUpdate_Click(object sender, EventArgs e) { //保存修改到数据库 AreaDal areaDal = new AreaDal(); areaDal.Save(txtSortID.Text, txtAreaCode.Text); JScript.Instance.ShowMessage(UpdatePanel1, "保存数据成功。"); }
/// <summary> /// 通过父级获取子集 /// </summary> /// <param name="parent"></param> /// <returns></returns> public List <AreaModel> GetAreas(int level, string parent, int max_count = 500) { if (level < 0 || !ValidateHelper.IsPlumpString(parent)) { return(null); } var dal = new AreaDal(); return(dal.GetList(x => x.AreaLevel == level && x.ParentID == parent, count: max_count)); }
/// <summary> /// 通过父级获取子集 /// </summary> /// <param name="parent"></param> /// <returns></returns> public List <AreaModel> GetAreas(int level, string parent, int max_count = 500) { if (level < 0 || !ValidateHelper.IsPlumpString(parent)) { return(null); } string key = Com.GetCacheKey("AreaBll.GetAreas", level.ToString(), parent, max_count.ToString()); return(Cache(key, () => { var dal = new AreaDal(); return dal.GetList(x => x.AreaLevel == level && x.ParentID == parent, count: max_count); })); }
private void BindData() { pager.PageSize = PagingSize; AreaDal areaDal = new AreaDal(); string filter = null; if (ViewState["Filter"] != null) { filter = ViewState["Filter"].ToString(); } pager.RecordCount = areaDal.GetCount(filter); DataTable table = areaDal.GetAll(pageIndex, PagingSize, filter); BindTable2GridView(gvMain, table); }
private void OnFormLoad(object sender, EventArgs e) { this.dal = new AreaDal(); if (!isNew) { this.Text = "区域信息-修改"; layoutControlItem3.Visibility = layoutControlItem11.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; txtCode.Enabled = false; txtCode.Properties.Buttons[0].Visible = false; ShowEditInfo(); } else { BindCategories(); } }
public string GetA(string id) { string AreaName = string.Empty; string cityName = string.Empty; if (!string.IsNullOrEmpty(id)) { AreaDal dal = new AreaDal(); Model.Area model = new Model.Area(); model = dal.GetModel(int.Parse(id)); if (model != null) { AreaName = model.title; int partentID = model.parent; Model.Area City = dal.GetModel(partentID); if (City != null) { cityName = City.title; } } } return(cityName + "-" + AreaName); }
private void LoadNoteBook(int ID) { AreaDal dal = new AreaDal(); Model.Area modelArea = new Model.Area(); Model.dt_feedback Model = bllNot.GetModel(ID); chkPointValue.Value = Model.user_Function; if (Model.user_Function == "是") { chkPoint.Checked = true; } else { chkPoint.Checked = false; } lblName.Text = Model.user_name; lblsex.Text = Model.user_qq; lblPhone.Text = Model.user_tel; lbluser_tel.Text = Model.title; lblEmail.Text = Model.user_email; lblContent.Text = Model.content; lblZhuZhi.Text = Model.zhuzhi; string DiDian = Model.user_Address; string Address = string.Empty; if (!string.IsNullOrEmpty(DiDian)) { if (DiDian.IndexOf('|') > 0) { string[] addList = DiDian.Split('|'); for (int i = 0; i < addList.Length; i++) { if (!string.IsNullOrEmpty(addList[i].ToString())) { int AreaID = int.Parse(addList[i].ToString()); modelArea = dal.GetModel(AreaID); if (modelArea != null) { if (i > 0) { Address += "-"; } Address += modelArea.title; } } } } } lblAdress.Text = Address; lblClassName.Text = Model.user_Class; //lblFunction.Text = Model.user_Function; lblMoney.Text = Model.user_Money.ToString(); lblMianJi.Text = Model.user_MianJi.ToString(); if (Model.zhuzhi == "介紹房屋出售") { p1.Visible = true; } else { p1.Visible = false; } lblReplayContent.Text = Model.reply_content; }