private void RptBind(int id) { DataTable dt =new Cms.BLL.C_model().GetList("").Tables[0]; this.rptList.DataSource = dt; this.rptList.DataBind(); Cms.BLL.C_Column cm = new Cms.BLL.C_Column(); string classname = cm.GetModel(27).className; bool bladd = adminUser.setpurview(classname, "add"); bool blEdit = adminUser.setpurview(classname, "Edit"); bool blDelete = adminUser.setpurview(classname, "Delete"); if (!bladd) { btnadd.Visible = false; } if (!blEdit) { btnSave.Visible = false; } if (!blDelete) { btnDelete.Visible = false; } }
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; }
protected void btnDelete_Click(object sender, EventArgs e) { // ChkAdminLevel("channel_" + this.channel_name + "_category", DTEnums.ActionEnum.Delete.ToString()); //检查权限 Cms.BLL.C_model bll = new Cms.BLL.C_model(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { adminUser.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "删除" + bll.GetModel(id).modelName); //记录日志 bll.Delete(id); } } JscriptMsg("删除数据成功!", Utils.CombUrlTxt("model_list.aspx", "channel_id={0}", this.channel_id.ToString()), "Success"); }
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); }