public int BathAdd(BatchaddModel model)
 {
     try
     {
         return(MgrServices.UserAddService.Batchadd(model));
     }
     catch
     { return(0); }
 }
Пример #2
0
        /// <summary>
        /// 批量添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int BathAdd(BatchaddModel model)
        {
            try
            {
                DateTime beforDT = System.DateTime.Now;   //计算运行时间
                return(MgrServices.UserAddService.Batchadd(model));

                DateTime afterDT = System.DateTime.Now;
                TimeSpan ts      = afterDT.Subtract(beforDT);
            }
            catch
            { return(0); }
        }
Пример #3
0
        public void ProcessRequest(HttpContext context)
        {
            //context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");1是成员管理列表;2是查看;3是重置密码;4是批量重置密码;5是批量添加,
            //6是修改校验用户名是否存在,7是获取权限

            int    Type = Convert.ToInt32(Common.GetRequest("type"));
            string Name = Common.GetSessionValue("loginName", context);//登录名或者姓名

            if (Name == null)
            {
                return;
            }
            string EnterpriseCode = Common.GetSessionValue("EnterpriseCode", context);

            if (EnterpriseCode == null)
            {
                return;
            }
            switch (Type)
            {
            case 1:      //成员管理数据集合
                int    U_ID = 0;
                string _id  = Common.GetSessionValue("UserID", context);
                if (_id == null)
                {
                    return;
                }
                U_ID = Convert.ToInt32(_id);

                int    R_ID          = 0;
                string LoginName     = context.Request["LoginName"].ToString();
                string Department_ID = context.Request["departmentname"];
                string U_Sex         = context.Request["sex"];
                string RoleName      = context.Request["RoleName"];
                if (RoleName == "0")
                {
                    RoleName = "";
                }
                int StarPageIndex = Convert.ToInt32(Common.GetRequest("StarPageIndex"));
                int EndPageIndex  = Convert.ToInt32(Common.GetRequest("EndPageIndex"));

                InitGaugePages(U_ID, R_ID, LoginName, Department_ID, RoleName, U_Sex, EnterpriseCode, StarPageIndex, EndPageIndex, context);
                break;

            case 2:      //获取查看的数据
                int UserID = Convert.ToInt32(context.Request["uid"]);
                GetUserInfoByID(UserID, context);
                break;

            case 3:     //根据ID单个更新密码
                int UID = Convert.ToInt32(context.Request["U_ID"]);
                context.Response.Write(UpdatePwdByID(UID));
                break;

            case 4:      //根据用户ID重置密码
                string Userid = context.Request["U_IDs"];
                context.Response.Write(UpdatePwd(Userid));
                break;

            case 5:      //批量添加
                BatchaddModel model = new BatchaddModel();
                model.R_ID           = Common.GetRequest("RoleNameAll");
                model.CreatePeple    = Name;
                model.department     = Common.GetRequest("department");
                model.NumStart       = Convert.ToInt32(Common.GetRequest("NumStart"));
                model.NumEnd         = Convert.ToInt32(Common.GetRequest("NumEnd"));
                model.UserNameR      = Common.GetRequest("UserNameR");
                model.nametype       = Convert.ToInt32(Common.GetRequest("nametype"));
                model.username_ty    = Common.GetRequest("username_ty");
                model.UserName03     = Common.GetRequest("UserName03");
                model.UserName04     = Common.GetRequest("UserName04");
                model.PwdR           = Common.GetRequest("PwdR");
                model.Pwd            = Common.GetRequest("Pwd");
                model.EnterpriseCode = Common.GetSessionValue("EnterpriseCode", context);
                if (model.EnterpriseCode == null)
                {
                    return;
                }
                context.Response.Write(BathAdd(model));
                break;

            case 6:      //校验修改时用户名是否存在
                string ULoginName = context.Request["LoginName"].ToString();
                int    UserIDs    = Convert.ToInt32(Common.GetRequest("UserID"));
                IsExistsUser(ULoginName, UserIDs, context);
                break;

            case 7:      //根据用户名称和三级权限页面的id来获取详细的权限
                context.Response.Write(GetUserFun(Name, 12));
                break;

            case 8:      //获取当前企业下面的所有部门集合
                context.Response.Write(GetTreeString());
                break;

            case 9:     //根据企业id是否存在
                string loginName = Common.GetRequest("loginName");
                IsExistsUserByE(EnterpriseCode, loginName, context);
                break;

            case 10:      //判断是否是咨询师
                GetRoleFuntion(context);
                break;
            }
            //}
        }