示例#1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            int deptEmpId = 0;

            if (string.IsNullOrEmpty(context.Request.Form["id"]))
            {
                context.Response.Write("序号错误");
                context.Response.End();
            }

            if (!int.TryParse(context.Request.Form["id"], out deptEmpId) || deptEmpId <= 0)
            {
                context.Response.Write("序号错误");
                context.Response.End();
            }

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            NFMT.User.Model.DeptEmp deptEmp = new NFMT.User.Model.DeptEmp();
            deptEmp.DeptEmpId = deptEmpId;
            deptEmp.RefStatus = NFMT.Common.StatusEnum.已作废;

            NFMT.User.BLL.DeptEmpBLL bll = new NFMT.User.BLL.DeptEmpBLL();
            NFMT.Common.ResultModel result = bll.Invalid(user, deptEmp);
            if (result.ResultStatus == 0)
                context.Response.Write("操作成功");
            else
                context.Response.Write(result.Message);
        }
示例#2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            string deptIdString = context.Request.Form["did"];
            string empIdsString = context.Request.Form["eids"];

            if (string.IsNullOrEmpty(deptIdString))
            {
                context.Response.Write("必须选择部门");
                context.Response.End();
            }

            if (string.IsNullOrEmpty(empIdsString))
            {
                context.Response.Write("必须选择员工");
                context.Response.End();
            }

            int deptId = 0;
            List<int> empIds = new List<int>();

            if (!int.TryParse(deptIdString, out deptId) || deptId == 0)
            {
                context.Response.Write("选择部门出错");
                context.Response.End();
            }

            NFMT.User.Model.Department dept = new NFMT.User.Model.Department();
            dept.DeptId = deptId;

            string[] strs = empIdsString.Split('|');
            List<NFMT.User.Model.Employee> emps = new List<NFMT.User.Model.Employee>();
            foreach (string s in strs)
            {
                int empId = 0;
                if (!int.TryParse(s, out empId) || empId == 0)
                {
                    context.Response.Write("选择员工出错");
                    context.Response.End();
                }

                NFMT.User.Model.Employee emp = new NFMT.User.Model.Employee();
                emp.EmpId = empId;
                emps.Add(emp);

                empIds.Add(empId);
            }

            NFMT.User.BLL.DeptEmpBLL bll = new NFMT.User.BLL.DeptEmpBLL();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();//bll.DeptEmpAllot(user, dept, emps);

            context.Response.Write(result.Message);
        }
示例#3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            int empId = 0;
            int deptId = 0;

            if (string.IsNullOrEmpty(context.Request.Form["id"]))
            {
                context.Response.Write("员工序号错误");
                context.Response.End();
            }
            if (!int.TryParse(context.Request.Form["id"], out empId) || empId <= 0)
            {
                context.Response.Write("员工序号错误");
                context.Response.End();
            }

            if (string.IsNullOrEmpty(context.Request.Form["did"]))
            {
                context.Response.Write("部门序号错误");
                context.Response.End();
            }
            if (!int.TryParse(context.Request.Form["did"], out deptId) || deptId <= 0)
            {
                context.Response.Write("部门序号错误");
                context.Response.End();
            }

            NFMT.User.Model.DeptEmp deptEmp = new NFMT.User.Model.DeptEmp();
            deptEmp.DeptId = deptId;
            deptEmp.EmpId = empId;
            deptEmp.CreatorId = user.EmpId;
            deptEmp.RefStatus = NFMT.Common.StatusEnum.已生效;

            NFMT.User.BLL.DeptEmpBLL bll = new NFMT.User.BLL.DeptEmpBLL();
            NFMT.Common.ResultModel result = bll.Insert(user, deptEmp);

            context.Response.Write(result.Message);
        }