private void ShowInfo(int _id) { Cms.BLL.C_model bll = new Cms.BLL.C_model(); Cms.Model.C_model model = bll.GetModel(_id); txtTitle.Text = model.modelName; }
private bool DoEdit(int _id) { try { Cms.BLL.C_model bll = new Cms.BLL.C_model(); Cms.Model.C_model model = bll.GetModel(_id); model.modelName = txtTitle.Text.Trim(); model.modelValue = txtTitle.Text.Trim(); if (bll.Update(model)) { adminUser.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "[" + model.modelName + "]"); //记录日志 return(true); } } catch { return(false); } return(false); }
private bool DoAdd() { try { Cms.Model.C_model model = new Cms.Model.C_model(); Cms.BLL.C_model bll = new Cms.BLL.C_model(); model.modelName = txtTitle.Text.Trim(); model.modelValue = txtTitle.Text.Trim(); if (bll.Add(model) > 0) { adminUser.AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "[" + model.modelName + "]"); //记录日志 return(true); } } catch { return(false); } return(false); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Cms.Model.C_model model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Cms.Model.C_model model) { return(dal.Add(model)); }