コード例 #1
0
 protected void btnDeleteSelect_Click(object sender, EventArgs e)
 {
     if (Session["ZT_ADMIN"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     else
     {
         if (!Communal.CheckQx("RongYuTypeDelete.aspx"))
         {
             Response.Redirect("RightsWarn.aspx");
         }
         else
         {
             string DeleteTitle = "";
             foreach (GridViewRow gr in this.GridView1.Rows)
             {
                 CheckBox cb = (CheckBox)gr.Cells[1].FindControl("Select");
                 if (cb.Checked)
                 {
                     //删除数据库信息
                     Label ll = (Label)gr.Cells[1].FindControl("lblRongYuTypeID");
                     int RongYuTypeID = Convert.ToInt32(ll.Text);
                     WebProject.BLL.BaseData.ZT_COM_RongYuType bll_RongYuType = new WebProject.BLL.BaseData.ZT_COM_RongYuType();
                     DeleteTitle += bll_RongYuType.GetModel(RongYuTypeID).RongYuTypeName + ",";
                     bll_RongYuType.Delete(RongYuTypeID);
                 }
             }
             LogManage.WriteLog(Request.UserHostAddress, "荣誉管理", "删除荣誉分类", "成功", "荣誉分类名称:" + DeleteTitle.TrimEnd(',') + ", 删除人:" + SessionUtil.GetAdminSession().AdminNo);
             ShowData();
         }
     }
 }
コード例 #2
0
 public void ShowData()
 {
     WebProject.BLL.BaseData.ZT_COM_RongYuType bll_RongYuType = new WebProject.BLL.BaseData.ZT_COM_RongYuType();
     DataSet ds = bll_RongYuType.GetList("");
     if (ds.Tables[0].Rows.Count > 0)
     {
         this.lblMessage.Visible = false;
         this.btnDeleteSelect.Visible = true;
         this.GridView1.Visible = true;
         this.GridView1.DataSource = ds;
         this.GridView1.DataBind();
     }
     else
     {
         this.lblMessage.Visible = true;
         this.btnDeleteSelect.Visible = false;
         this.GridView1.Visible = false;
     }
 }
コード例 #3
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (Session["ZT_ADMIN"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     else
     {
         WebProject.Model.BaseData.ZT_COM_RongYuType model_RongYuType = new WebProject.Model.BaseData.ZT_COM_RongYuType();
         model_RongYuType.RongYuTypeName = this.txtRongYuTypeName.Text.Trim();
         model_RongYuType.RongYuTypeNo = this.txtRongYuTypeNo.Text.Trim();
         model_RongYuType.RongYuTypeOrder = Int32.Parse(this.txtRongYuTypeOrder.Text.Trim());
         model_RongYuType.CreateBy = SessionUtil.GetAdminSession().AdminNo;
         model_RongYuType.CreateDate = DateTime.Now;
         WebProject.BLL.BaseData.ZT_COM_RongYuType bll_RongYuType = new WebProject.BLL.BaseData.ZT_COM_RongYuType();
         bll_RongYuType.Add(model_RongYuType);
         LogManage.WriteLog(Request.UserHostAddress, "荣誉管理", "添加荣誉分类", "成功", "荣誉分类名称:" + model_RongYuType.RongYuTypeName + ", 操作人:" + SessionUtil.GetAdminSession().AdminNo);
         MessageBox.ShowAndRedirect(this, "添加荣誉成功!", "RongYuTypeList.aspx");
     }
 }
コード例 #4
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Session["ZT_ADMIN"] == null)
        {
            Response.Redirect("Login.aspx");
        }
        else
        {
            if (this.txtRongYuTypeName.Text.Trim() == "")
            {
                MessageBox.Show(this, "请输入荣誉类别标题!");
                return;
            }
            if (this.txtRongYuTypeNo.Text.Trim() == "")
            {
                MessageBox.Show(this, "请输入荣誉类别编号!");
                return;
            }
            try
            {
                WebProject.BLL.BaseData.ZT_COM_RongYuType bll_RongYuType = new WebProject.BLL.BaseData.ZT_COM_RongYuType();
                WebProject.Model.BaseData.ZT_COM_RongYuType model_RongYuType = bll_RongYuType.GetModel(Int32.Parse(Request["RongYuTypeID"].ToString()));

                model_RongYuType.RongYuTypeName = this.txtRongYuTypeName.Text.Trim();
                model_RongYuType.RongYuTypeNo = this.txtRongYuTypeNo.Text.Trim();
                model_RongYuType.RongYuTypeOrder = Int32.Parse(this.txtRongYuTypeOrder.Text.Trim());
                model_RongYuType.LastUpdateBy = SessionUtil.GetAdminSession().AdminNo;
                model_RongYuType.LastUpdateDate = DateTime.Now;

                bll_RongYuType.Update(model_RongYuType);
                LogManage.WriteLog(Request.UserHostAddress, "荣誉管理", "修改荣誉分类", "成功", "荣誉分类名称:" + model_RongYuType.RongYuTypeName + ", 操作人:" + SessionUtil.GetAdminSession().AdminNo);
                MessageBox.ShowAndRedirect(this, "修改信息成功!", "RongYuTypeList.aspx");
            }
            catch
            {
                Response.Redirect("RightsWarn.aspx");
            }
        }
    }
コード例 #5
0
    public void ShowData()
    {
        if (Request["RongYuTypeID"] + "" == "")
        {
            Response.Redirect("RightsWarn.aspx");
        }
        else
        {
            try
            {
                WebProject.BLL.BaseData.ZT_COM_RongYuType bll_RongYuType = new WebProject.BLL.BaseData.ZT_COM_RongYuType();
                WebProject.Model.BaseData.ZT_COM_RongYuType model_RongYuType = bll_RongYuType.GetModel(Int32.Parse(Request["RongYuTypeID"].ToString()));

                this.txtRongYuTypeName.Text = model_RongYuType.RongYuTypeName.ToString();
                this.txtRongYuTypeNo.Text = model_RongYuType.RongYuTypeNo.ToString();
                this.txtRongYuTypeOrder.Text = model_RongYuType.RongYuTypeOrder.ToString();
            }
            catch
            {
                Response.Redirect("RightsWarn.aspx");
            }
        }
    }
コード例 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string url = Request.Url.ToString();
     if (CheckString.CheckSqlKeyWord(url) == true)
     {
         MessageBox.ShowAndRedirect(this, "你的IP地址为:" + Page.Request.UserHostAddress + ",请不要输入非法字段!", "Login.aspx");
     }
     else
     {
         if (!this.IsPostBack)
         {
             if (Session["ZT_ADMIN"] == null)
             {
                 Response.Redirect("Login.aspx");
             }
             else
             {
                 if (!Communal.CheckQx("RongYuAdd.aspx"))
                 {
                     Response.Redirect("RightsWarn.aspx");
                 }
                 else
                 {
                     WebProject.BLL.BaseData.ZT_COM_RongYuType bll_RongYuType = new WebProject.BLL.BaseData.ZT_COM_RongYuType();
                     DataSet ds = bll_RongYuType.GetList(" 1=1 ");
                     BindData.BindDropDownList("RongYuTypeName", "RongYuTypeNo", ds, txtRongYuType);
                     this.txtRongYuOrder.Attributes.Add("onpaste", "return false"); //屏蔽粘贴
                 }
             }
         }
     }
 }
コード例 #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string url = Request.Url.ToString();
     if (CheckString.CheckSqlKeyWord(url) == true)
     {
         MessageBox.ShowAndRedirect(this, "你的IP地址为:" + Page.Request.UserHostAddress + ",请不要输入非法字段!", "Login.aspx");
     }
     else
     {
         if (!IsPostBack)
         {
             if (Session["ZT_ADMIN"] == null)
             {
                 Response.Redirect("Login.aspx");
             }
             else
             {
                 if (!Communal.CheckQx("RongYuList.aspx"))
                 {
                     Response.Redirect("RightsWarn.aspx");
                 }
                 else
                 {
                     WebProject.BLL.BaseData.ZT_COM_RongYuType bll_RongYuType = new WebProject.BLL.BaseData.ZT_COM_RongYuType();
                     DataSet ds = bll_RongYuType.GetList(" 1=1 ");
                     BindData.BindDropDownList("所有荣誉", "ALL", "RongYuTypeName", "RongYuTypeNo", ds, txtRongYuType);
                     ShowData(this.txtRongYuType.SelectedValue.ToString());
                     this.btnDeleteSelect.Attributes.Add("onclick", "return confirm('您确认要删除这些记录?');");
                 }
             }
         }
     }
 }
コード例 #8
0
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     if (Session["ZT_ADMIN"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     else
     {
         if (!Communal.CheckQx("RongYuTypeDelete.aspx"))
         {
             Response.Redirect("RightsWarn.aspx");
         }
         else
         {
             //删除数据库的信息
             Label ll = (Label)this.GridView1.Rows[e.RowIndex].Cells[1].FindControl("lblRongYuTypeID");
             int RongYuTypeID = Convert.ToInt32(ll.Text);
             WebProject.BLL.BaseData.ZT_COM_RongYuType bll_RongYuType = new WebProject.BLL.BaseData.ZT_COM_RongYuType();
             LogManage.WriteLog(Request.UserHostAddress, "荣誉管理", "删除荣誉分类", "成功", "荣誉分类名称:" + bll_RongYuType.GetModel(RongYuTypeID).RongYuTypeName + ", 操作人:" + SessionUtil.GetAdminSession().AdminNo);
             bll_RongYuType.Delete(RongYuTypeID);
             //重新加载信息
             ShowData();
         }
     }
 }