Esempio n. 1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string ids = "";
        XYECOM.Business.SendEmail se = new XYECOM.Business.SendEmail();
        foreach (GridViewRow GR in this.gvlist.Rows)
        {
            if (((CheckBox)(GR.FindControl("chkExport"))).Checked == true)
            {
                ids += "," + this.gvlist.DataKeys[GR.DataItemIndex].Value.ToString();
            }
        }
        if (ids.IndexOf(",") == 0)
        {
            ids = ids.Substring(1);
            int i = 0;
            i = se.Deletes(ids);
            string url = "SendEmail.aspx";
            if (i >= 0)
            {
                XYECOM.Business.Admin ad = new XYECOM.Business.Admin();
                XYECOM.Model.AdminInfo ea = new XYECOM.Model.AdminInfo();

                Alert("删除成功!", url);
                dvDataBind();
            }
            else
            {
                Alert("删除失败!", url);
            }
        }
    }
Esempio n. 2
0
    protected void btnOk_ServerClick(object sender, EventArgs e)
    {
        XYECOM.Model.FiltrateKeyWordInfo efkw = new XYECOM.Model.FiltrateKeyWordInfo();
        XYECOM.Business.FiltrateKeyWord fkw = new XYECOM.Business.FiltrateKeyWord();
        XYECOM.Business.Log l = new XYECOM.Business.Log();
        XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo();
        efkw.FKW_Name = this.txtName.Text;
        XYECOM.Model.AdminInfo ea = new XYECOM.Model.AdminInfo();
        XYECOM.Business.Admin ad = new XYECOM.Business.Admin();
        int err = 0;
        string str = this.txtName.Text.Trim();
        string[] st = str.Split(',');
        for (int i = 0; i < st.Length; i++)
        {
            efkw.FKW_Name = st[i].ToString();
            err = fkw.Insert(efkw);
        }
        if (err == -1)
        {
            el.L_Title = "过滤字管理";
            el.L_Content = "添加过滤字信息";
            el.L_MF = "系统信息设置";

            {
                el.UM_ID = AdminId;
            }
            l.Insert(el);
            Alert("该记录已存在!请重新输入信息!", url);
        }
        else if (err == -2)
        {
            el.L_Title = "过滤字管理";
            el.L_Content = "该记录已存在!请重新输入信息";
            el.L_MF = "系统信息设置";

            {
                el.UM_ID = AdminId;
            }
            Alert("添加失败!", url);
        }
        else
        {
            el.L_Title = "过滤字管理";
            el.L_Content = "添加过滤字信息成功";
            el.L_MF = "系统信息设置";

            {
                el.UM_ID = AdminId;
            }
            l.Insert(el);
            Alert("添加成功!", url);
        }
    }
Esempio n. 3
0
    protected void gvlist_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "del")
        {

            XYECOM.Model.AdminInfo ea = new XYECOM.Model.AdminInfo();
            XYECOM.Business.Admin ad = new XYECOM.Business.Admin();
            XYECOM.Business.Log l = new XYECOM.Business.Log();
            XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo();
            int i = 0;
            int id = Int32.Parse(gvlist.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString());
            if (id == AdminId)
            {
                string url = "Administrator.aspx";
                this.ClientScript.RegisterClientScriptBlock(GetType(), "01", "<script>alertmsg(\"您不能删除自己!\",\"" + url + "\")</script>");
            }
            else
            {
                el.L_Title = "管理员管理";
                el.L_MF = "系统信息设置";

                {
                        el.UM_ID = AdminId;
                }

                this.key.Value = "3";
                i = ad.Delete(id);
                if (i == 1)
                {
                    el.L_Content = "删除管理员信息成功";
                    Response.Redirect(url);
                }
                else
                {
                    el.L_Content = "删除管理员信息失败";
                    Alert("删除失败!", url);
                }
                l.Insert(el);
            }
        }
        else if (e.CommandName == "up")
        {
            this.key.Value = "2";
            XYECOM.Business.Admin ad = new XYECOM.Business.Admin();
            XYECOM.Model.AdminInfo ea = new XYECOM.Model.AdminInfo();
            ea = ad.GetItem(Int32.Parse(gvlist.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString()));
            this.value.Value = gvlist.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString();
            this.txtName1.Text = ea.UM_Name;
            this.ddlUpdate.SelectedValue = ea.UR_ID.ToString();
        }
    }
Esempio n. 4
0
    protected void btnOk_ServerClick1(object sender, EventArgs e)
    {
        XYECOM.Business.Log l = new XYECOM.Business.Log();
        XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo();
        XYECOM.Model.AdminInfo ea = new XYECOM.Model.AdminInfo();
        XYECOM.Business.Admin ad = new XYECOM.Business.Admin();
        ea.UM_Name = this.txtName.Text;
        ea.UM_Pwd = XYECOM.Core.SecurityUtil.MD5(this.txtPwd.Text.Trim(), XYECOM.Configuration.Security.Instance.Md5value);
        ea.UR_ID = Convert.ToInt32(this.ddlRose.SelectedValue.ToString());
        int i = 0;
        i = ad.Insert(ea);
        if (i == 1)
        {
            el.L_Title = "管理员管理";
            el.L_Content = "添加管理员信息成功";
            el.L_MF = "系统信息设置";

            {
                el.UM_ID = AdminId;
            }
            l.Insert(el);
            Reload();
            //string url = "Administrator.aspx";
            //this.ClientScript.RegisterClientScriptBlock(GetType(), "01", "<script>alertmsg(\"添加成功!\",\"" + url + "\")</script>");
        }
        else if (i == -1)
        {
            el.L_Title = "管理员管理";
            el.L_Content = "该记录已经存在,请重新输入";
            el.L_MF = "系统信息设置";

            {
                el.UM_ID = AdminId;
            }
            l.Insert(el);
            Alert("该记录已经存在,请重新输入!", url);
        }
        else
        {
            el.L_Title = "管理员管理";
            el.L_Content = "添加管理员信息";
            el.L_MF = "系统信息设置";

            {
                el.UM_ID = AdminId;
            }
            l.Insert(el);
            Alert("添加失败!", url);
        }
    }
Esempio n. 5
0
    protected void Submit1_ServerClick(object sender, EventArgs e)
    {
        this.key.Value = "2";

        XYECOM.Business.Admin adminBLL = new XYECOM.Business.Admin();
        XYECOM.Model.AdminInfo adminInfo = new XYECOM.Model.AdminInfo();
        XYECOM.Business.Log l = new XYECOM.Business.Log();
        XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo();

        adminInfo = adminBLL.GetItem(Convert.ToInt32(this.value.Value));

        adminInfo.UR_ID = Convert.ToInt32(this.ddlUpdate.SelectedValue.ToString());
        adminInfo.UM_ID = Convert.ToInt32(this.value.Value);

        if (adminInfo.UM_Pwd != XYECOM.Core.SecurityUtil.MD5(this.txtYuanPwd.Text.Trim(), XYECOM.Configuration.Security.Instance.Md5value))
        {
            Alert("原密码不正确!", url);
            return;
        }

        if (this.txtNewPwd.Text.Trim() != this.txtOKpwd.Text.Trim())
        {
            Alert("两次密码输入不一致!", url);
            return;
        }

        adminInfo.UM_Pwd = XYECOM.Core.SecurityUtil.MD5(this.txtNewPwd.Text.Trim(), XYECOM.Configuration.Security.Instance.Md5value);

        int i = adminBLL.Update(adminInfo);

        if (i == 1)
        {
            el.L_Title = "管理员管理";
            el.L_Content = "修改管理员信息成功";
            el.L_MF = "系统信息设置";

            {
                el.UM_ID = AdminId;
            }
            l.Insert(el);
            Alert("修改成功!", url);
        }
        else
        {
            Alert("修改失败!", url);
        }
    }