Пример #1
0
    protected void btn_Delete_Click(object sender, EventArgs e)
    {
        string idList = string.Empty;

        foreach (GridViewRow dr in GridView1.Rows)
        {
            CheckBox chk = (CheckBox)dr.FindControl("chk_XX");
            if (chk != null && chk.Checked)
            {
                string _id = "'" + dr.Cells[1].Text.Trim() + "'";
                idList += _id + ",";
            }
        }
        if (idList.Length > 0)
        {
            idList = idList.TrimEnd(',');
            bool re = new ObjectGroupBLL().DeleteList(idList);
            if (re)
            {
                UtilityService.AlertAndRedirect(this.Page, "删除成功!", "ObjectGroupMgr.aspx");
            }
            else
            {
                UtilityService.Alert(this.Page, "删除失败!");
            }
        }
    }
Пример #2
0
    protected void btn_Add_Click(object sender, EventArgs e)
    {
        if (txt_Name.Text.Trim() == "系统管理员")
        {
            UtilityService.Alert(this.Page, "该名称是非法名,请换一个职位名称!");
            return;
        }

        Position p = new Position();

        p.PosiName   = txt_Name.Text.Trim();
        p.FatherCode = ddl_Father.SelectedValue.ToString();
        p.OrganID    = (int)Session["OrganID"];
        p.InputBy    = Session["UserID"].ToString();

        bool re = new PositionBLL().Add(p);

        if (re)
        {
            UtilityService.AlertAndRedirect(this, "添加成功!", "PositionMgr.aspx");
        }
        else
        {
            UtilityService.Alert(this, "添加失败!");
        }
    }
Пример #3
0
    protected void btn_Delete_Click(object sender, ImageClickEventArgs e)
    {
        string idList = string.Empty;

        foreach (GridViewRow dr in GridView1.Rows)
        {
            CheckBox chk = (CheckBox)dr.FindControl("chk");
            if (chk != null && chk.Checked)
            {
                string _id   = "'" + dr.Cells[1].Text.Trim() + "'";
                string _name = dr.Cells[2].Text.Trim();
                if (_name == "系统管理员" || _name == "超级管理员" || _id.Substring(3, 4) == "0000")
                {
                    UtilityService.Alert(this.Page, "禁止删除管理员及默认人员类别");
                    return;
                }

                idList += _id + ",";
            }
        }
        if (idList.Length > 0)
        {
            idList = idList.TrimEnd(',');
            bool re = new RoleBLL().DeleteList(idList);
            if (re)
            {
                UtilityService.AlertAndRedirect(this.Page, "删除成功!", "RoleMgr.aspx");
            }
            else
            {
                UtilityService.Alert(this.Page, "删除失败!");
            }
        }
    }
Пример #4
0
    protected void btn_Delete_Click(object sender, ImageClickEventArgs e)
    {
        string idList = string.Empty;

        foreach (GridViewRow dr in GridView1.Rows)
        {
            CheckBox chk = (CheckBox)dr.FindControl("chk");
            if (chk.Checked)
            {
                int _id = Convert.ToInt32((dr.Cells[1].Text));
                idList += _id + ",";
            }
        }
        if (idList.Length > 0)
        {
            if (idList.Contains("1000"))
            {
                UtilityService.Alert(this.Page, "不能删除总公司信息!");
                return;
            }
            OrganBLL organBLL = new OrganBLL();
            idList = idList.TrimEnd(',');
            bool re = organBLL.DeleteList(idList);
            if (re)
            {
                UtilityService.AlertAndRedirect(this.Page, "删除成功!", "OrganMgr.aspx");
            }
            else
            {
                UtilityService.Alert(this.Page, "删除失败!");
            }
        }
    }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         string _name = Request.QueryString["name"].ToString();
         if (_name == "系统管理员")
         {
             UtilityService.AlertAndRedirect(this.Page, "不能修改系统管理员信息!", "PositionMgr.aspx");
         }
     }
 }
Пример #6
0
    protected void btn_ResetPwd_Click(object sender, EventArgs e)
    {
        bool re = new UserBLL().UpdatePwd(txt_UM.Text.Trim(), "123456");

        if (re)
        {
            UtilityService.AlertAndRedirect(this, "初始化密码成功!", "UserMgr.aspx");
        }
        else
        {
            UtilityService.Alert(this, "初始化密码失败!");
        }
    }
Пример #7
0
    protected void btn_Modity_Click(object sender, EventArgs e)
    {
        ObjectGroup r = new ObjectGroup();

        r.Code     = lab_Code.Text.Trim();
        r.Name     = txt_Name.Text.Trim();
        r.TypeCode = ddl_Type.SelectedValue.ToString();

        bool re = new ObjectGroupBLL().Update(r);

        if (re)
        {
            UtilityService.AlertAndRedirect(this, "修改成功!", "ObjectGroupMgr.aspx");
        }
        else
        {
            UtilityService.Alert(this, "修改失败!");
        }
    }
Пример #8
0
    protected void btn_Modity_Click(object sender, EventArgs e)
    {
        Model.User u = new Model.User();
        u.UserID   = txt_UM.Text.Trim();
        u.UserName = txt_Name.Text.Trim();
        u.OrganID  = int.Parse(ddl_Organ.SelectedValue.ToString());//(int)Session["OrganID"];
        u.Status   = 1;
        u.OpenDate = DateTime.Parse(txt_OpenDate.Text);

        bool re = new UserBLL().Update(u);

        if (re)
        {
            UtilityService.AlertAndRedirect(this, "修改成功!", "UserMgr.aspx");
        }
        else
        {
            UtilityService.Alert(this, "修改失败!");
        }
    }
Пример #9
0
    protected void btn_Add_Click(object sender, EventArgs e)
    {
        ObjectGroup r = new ObjectGroup();

        r.Name     = txt_Name.Text.Trim();
        r.TypeCode = ddl_Type.SelectedValue.ToString();
        r.OrganID  = (int)Session["OrganID"];
        r.InputBy  = Session["UserID"].ToString();

        int re = new ObjectGroupBLL().Add(r);

        if (re > 0)
        {
            UtilityService.AlertAndRedirect(this, "添加成功!", "ObjectGroupMgr.aspx");
        }
        else
        {
            UtilityService.Alert(this, "添加失败!");
        }
    }
Пример #10
0
    protected void btn_Modity_Click(object sender, EventArgs e)
    {
        if (txt_Name.Text.Trim() == "系统管理员" || txt_Name.Text.Trim() == "超级管理员")
        {
            UtilityService.Alert(this.Page, "该名称是非法名,请换一个角色名称!");
            return;
        }

        Model.Role r = new Model.Role();
        r.RoleCode = lab_Code.Text;
        r.RoleName = txt_Name.Text.Trim();

        bool re = new RoleBLL().Update(r);

        if (re)
        {
            UtilityService.AlertAndRedirect(this, "修改成功!", "RoleMgr.aspx");
        }
        else
        {
            UtilityService.Alert(this, "修改失败!");
        }
    }
Пример #11
0
    protected void btn_Add_Click(object sender, EventArgs e)
    {
        if (txt_Name.Text.Trim().ToLower() == "admin")
        {
            UtilityService.Alert(this.Page, "admin是非法用户名,请换一个用户名称!");
            return;
        }


        Model.User u = new Model.User();
        u.UserID   = txt_UM.Text.Trim();
        u.UserName = txt_Name.Text.Trim();
        //u.Password = txt_Pwd.Text.Trim();
        u.Status   = 1;
        u.OrganID  = int.Parse(ddl_Organ.SelectedValue.ToString());//(int)Session["OrganID"];
        u.OpenDate = DateTime.Parse(txt_OpenDate.Text);
        u.InputBy  = Session["UserID"].ToString();

        DataSet oldU = new UserBLL().GetList(" UserID = '" + u.UserID + "'");

        if (oldU != null && oldU.Tables[0].Rows.Count > 0)
        {
            UtilityService.Alert(this, "该用户名已存在!");
            return;
        }

        int re = new UserBLL().Add(u);

        if (re > 0)
        {
            UtilityService.AlertAndRedirect(this, "添加成功!", "UserMgr.aspx");
        }
        else
        {
            UtilityService.Alert(this, "添加失败!");
        }
    }
Пример #12
0
    protected void btn_Add_Click(object sender, EventArgs e)
    {
        if (txt_Name.Text.Trim() == "系统管理员" || txt_Name.Text.Trim() == "超级管理员")
        {
            UtilityService.Alert(this.Page, "该名称是非法名,请换一个角色名称!");
            return;
        }

        Model.Role r = new Model.Role();
        r.RoleName = txt_Name.Text.Trim();
        r.OrganID  = (int)Session["OrganID"];
        r.InputBy  = Session["UserID"].ToString();

        int re = new RoleBLL().Add(r);

        if (re > 0)
        {
            UtilityService.AlertAndRedirect(this, "添加成功!", "RoleMgr.aspx");
        }
        else
        {
            UtilityService.Alert(this, "添加失败!");
        }
    }