Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "固定资产申购"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }

        ScriptManager1.RegisterAsyncPostBackControl(addRow);
        if (ViewState["count"] != null)
        {
            for (int i = 0; i < Convert.ToInt16(ViewState["count"]); i++)
            {
                addNewRow();
            }
        }
        if (!IsPostBack)
        {
            DataSet allPro = ProjectInfo.GetAllProjects();
            projectCodeList.DataSource     = allPro.Tables[0].DefaultView;
            projectCodeList.DataTextField  = "ProjectName";
            projectCodeList.DataValueField = "ProjectCode";
            projectCodeList.DataBind();

            staffName.Text  = info.StaffName;
            department.Text = info.Department;
            applyDate.Text  = DateTime.Today.ToShortDateString();
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "出差报销"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }

        ScriptManager1.RegisterAsyncPostBackControl(projectNameList);
        if (!IsPostBack)
        {//首次加载才需要绑定
            DataSet allPro = ProjectInfo.GetAllProjects();
            projectNameList.DataSource     = allPro.Tables[0].DefaultView;
            projectNameList.DataTextField  = "ProjectName";
            projectNameList.DataValueField = "ProjectName";
            projectNameList.DataBind();
            accountList.DataSource     = allPro.Tables[0].DefaultView;
            accountList.DataTextField  = "ProjectAccount";
            accountList.DataValueField = "ProjectAccount";
            accountList.DataBind();

            accountList.SelectedValue = ProjectInfo.GetProjectInfoByName(projectNameList.SelectedValue).ProjectAccount;

            staffName.Text  = info.StaffName;
            department.Text = info.Department;
            applyDate.Text  = DateTime.Today.ToShortDateString();
        }



        //
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "用户管理"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }
        if (!IsPostBack)
        {
            DataSet allDep = Department.GetAllDepartment();
            depList.DataSource    = allDep.Tables[0].DefaultView;
            depList.DataTextField = "DepartmentName";
            //depList.DataValueField = "DepartmentID";
            depList.DataValueField = "DepartmentName";
            depList.DataBind();

            DataSet allPos = Roles.GetAllRoles();
            posList.DataSource    = allPos.Tables[0].DefaultView;
            posList.DataTextField = "RoleName";
            //posList.DataValueField = "RoleID";
            posList.DataValueField = "RoleName";
            posList.DataBind();
        }
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "角色管理"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }
        if (IsPostBack)
        {
            if (Roles.hasRoles(Request["PositionName"]))
            {
                string name  = Request["PositionName"];
                string limit = Request["limit"];
                Session["tempName"]  = name;
                Session["tempLimit"] = limit;


                Response.Write("<Script Language='JavaScript'>if ( window.confirm('职位已存在,确认更新?')) {window.location.href='PositionUpdate.aspx' } else {window.location.href='#' };</script>");
            }
            else
            {
                Roles.SetRole(Request["PositionName"], Convert.ToInt32(Request["limit"]));
                Response.Redirect("~/Account/BasicInfo.aspx");
            }
        }
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "组织管理"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }
        if (IsPostBack)
        {
            if (BusinessUnit.hasBUInfo(Request["BUName"].Trim()))
            {
                string name = Request["BUName"];
                string boss = Request["boss"];
                string code = Request["BUCode"];
                Session["tempName"] = name;
                Session["tempBoss"] = boss;
                Session["tempCode"] = code;

                Response.Write("<Script Language='JavaScript'>if ( window.confirm('事业部已存在,确认更新?')) {window.location.href='BusinessUnitUpdate.aspx' } else {window.location.href='#' };</script>");
            }
            else
            {
                BusinessUnit.SetBU(Request["BUName"].Trim(), Request["boss"], Request["BUCode"]);
                Response.Redirect("~/Account/BasicInfo.aspx");
            }
        }
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "收支一览"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }

        if (!IsPostBack)
        {
            loadTypeList();
        }
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "员工用餐申请"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }

        if (!IsPostBack)
        {
            staffName.Text  = info.StaffName;
            department.Text = info.Department;
            position.Text   = info.Position;
        }
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "到款分配"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }


        if (!IsPostBack)
        {//首次加载才需要绑定
            DataSet allPro = ProjectInfo.GetAllProjects();
            projectNameList.DataSource     = allPro.Tables[0].DefaultView;
            projectNameList.DataTextField  = "ProjectName";
            projectNameList.DataValueField = "ProjectName";
            projectNameList.DataBind();

            staffName.Text = info.StaffName;
        }
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "组织管理"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }
        if (!IsPostBack)
        {//初次加载
            DataSet allBU = BusinessUnit.GetAllBU();
            buList.DataSource     = allBU.Tables[0].DefaultView;
            buList.DataTextField  = "UnitName";
            buList.DataValueField = "UnitID";
            buList.DataBind();
        }
        else
        {
            if (Department.hasDepartmentInfo(Request["departmentName"].Trim()))
            {
                string name   = Request["departmentName"];
                string boss   = Request["boss"];
                string leader = Request["leader"];
                Session["tempName"]   = name;
                Session["tempBoss"]   = boss;
                Session["tempLeader"] = leader;
                Session["tempParent"] = buList.SelectedValue;

                Response.Write("<Script Language='JavaScript'>if ( window.confirm('部门已存在,确认更新?')) {window.location.href='DepartmentUpdate.aspx' } else {window.location.href='#' };</script>");
            }
            else
            {
                Department.SetDepartment(Request["departmentName"], Convert.ToInt32(buList.SelectedValue), Request["boss"], Request["leader"]);
                Response.Redirect("~/Account/BasicInfo.aspx");
            }
        }
    }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "车辆使用登记"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='ApplyListPage.aspx'</script>");
        }
        ScriptManager1.RegisterAsyncPostBackControl(addRow);
        if (ViewState["count"] != null)
        {
            for (int i = 0; i < Convert.ToInt16(ViewState["count"]); i++)
            {
                addNewRow();
            }
        }
        if (!IsPostBack)
        {
            staffName.Text  = info.StaffName;
            department.Text = info.Department;
        }
    }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "新建项目"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }


        if (IsPostBack)
        {
            string name           = projectName.Value;
            string code           = projectCode.Value;
            string manager        = manager_txt.Value;
            string projectAccount = projectAccount_txt.Value;
            string budget         = budget_txt.Value;
            string collected      = collected_txt.Value;
            string applyDate      = DateTime.Today.ToShortDateString();
            string members        = memberList.Text;
            string remark         = remarkBox.Text;
            string department     = depList.SelectedValue;

            if (ProjectInfo.HasProjectInfo(projectCode.Value))
            {
                Session["tempName"]       = name;
                Session["tempCode"]       = code;
                Session["tempManager"]    = manager;
                Session["tempAccount"]    = projectAccount;
                Session["tempBudget"]     = budget;
                Session["tempCollected"]  = collected;
                Session["tempDate"]       = applyDate;
                Session["tempMembers"]    = members;
                Session["tempRemark"]     = remark;
                Session["tempDepartment"] = remark;

                Response.Write("<Script Language='JavaScript'>if ( window.confirm('对应编号的项目已存在,确认更新?')) {window.location.href='RolesUpdate.aspx' } else {window.location.href='#' };</script>");
            }
            else
            {
                ProjectInfo pi = new ProjectInfo();
                pi.ProjectCode    = code;
                pi.ProjectName    = name;
                pi.Manager        = manager;
                pi.ProjectAccount = projectAccount;
                pi.Budget         = Convert.ToInt32(budget);
                pi.Collected      = Convert.ToInt32(collected);
                pi.ApplyDate      = Convert.ToDateTime(applyDate);
                pi.Memeber        = members;
                pi.Remark         = remark;
                pi.Status         = false;
                pi.Department     = department;

                ProjectInfo.setProjectInfoByCode(code, pi);
                Response.Redirect("~/Account/BasicInfo.aspx");
            }
        }
        else
        {
            DataSet allDep = Department.GetAllDepartment();
            depList.DataSource    = allDep.Tables[0].DefaultView;
            depList.DataTextField = "DepartmentName";
            //depList.DataValueField = "DepartmentID";
            depList.DataValueField = "DepartmentName";
            depList.DataBind();

            applyDate.Text = DateTime.Today.ToShortDateString();
        }
    }