protected void btnSave_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.txtDicName.Text.Trim())) { int DicCateID = DataConverter.CLng(this.HdnDicID.Value); if (DicCateID > 0) { M_Dictionary info = B_DataDictionary.GetModel(DicCateID); info.DicName = this.txtDicName.Text.Trim(); B_DataDictionary.Update(info); } else { M_Dictionary info = new M_Dictionary(); info.DicID = 0; info.DicCate = DataConverter.CLng(this.HdnDicCateID.Value); info.DicName = this.txtDicName.Text.Trim(); info.IsUsed = true; B_DataDictionary.AddDic(info); } this.txtDicName.Text = ""; this.HdnDicID.Value = "0"; this.btnSave.Text = "添加"; DataBind(); } }
protected void btnSetUnUsed_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.Form["idchk"])) { B_DataDictionary.SetUsedByArr(Request.Form["idchk"], false); DataBind(); } }
protected void Lnk_Click(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { string Id = e.CommandArgument.ToString(); string returnValue = B_DataDictionary.GetDicString(DataConverter.CLng(Id)); returnValue = returnValue.Replace(",", "\r\n"); this.TxtSelectDic.Text = returnValue; } }
protected void Egv_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Del") { string Id = e.CommandArgument.ToString(); dictBll.Del(DataConverter.CLng(Id)); DataBind(); } if (e.CommandName == "Edit1") { string Id = e.CommandArgument.ToString(); M_Dictionary info = B_DataDictionary.GetModel(DataConverter.CLng(Id)); this.txtDicName.Text = info.DicName; this.HdnDicID.Value = Id; this.btnSave.Text = "修改"; } }
public ContentResult DicItem_API() { string action = GetParam("action"); string ids = GetParam("ids"); switch (action) { case "del": dItemBll.DelByIds(ids); break; case "save": { string name = GetParam("name"); if (string.IsNullOrEmpty(name)) { return(Content(Failed.ToString())); } M_Dictionary info = new M_Dictionary(); if (Mid > 0) { info = B_DataDictionary.GetModel(Mid); } info.DicName = name; if (info.DicID < 1) { info.DicCate = CateID; info.IsUsed = true; B_DataDictionary.AddDic(info); } else { B_DataDictionary.Update(info); } } break; } return(Content(Success.ToString())); }
protected void btnSetAllUsed_Click(object sender, EventArgs e) { B_DataDictionary.SetAllUsed(DataConverter.CLng(this.HdnDicCateID.Value)); DataBind(); }
public void DataBind(string key = "") { Egv.DataSource = B_DataDictionary.GetDicListbyCate(DataConverter.CLng(this.HdnDicCateID.Value)); Egv.DataBind(); }