Esempio n. 1
0
        public JsonResult UpdateMobilePhone(string userID)
        {
            bool flag   = false;
            int  result = 0;

            if (!string.IsNullOrEmpty(CurrentUser.LoginName))
            {
                Users item = WinWarBusiness.OrganizationBusiness.GetUserByUserID(userID);
                if (!string.IsNullOrEmpty(item.BindMobilePhone))
                {
                    flag = OrganizationBusiness.ClearAccountBindMobile(userID, CurrentUser.AgentID);
                    if (flag)
                    {
                        result = 1;
                        if (!string.IsNullOrEmpty(item.MobilePhone))
                        {
                            result = 2;
                        }
                    }
                }
                else
                {
                    result = 3;
                }
            }

            JsonDictionary.Add("result", result);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 2
0
        /// <summary>
        /// 设置用户头像
        /// </summary>
        /// <param name="avatar"></param>
        /// <returns></returns>
        public JsonResult SaveAccountAvatar(string avatar)
        {
            int result = 0;

            if (!string.IsNullOrEmpty(avatar))
            {
                avatar = avatar.Split(',')[1];
                MemoryStream stream = new MemoryStream(Convert.FromBase64String(avatar));
                Bitmap       img    = new Bitmap(stream);

                avatar = FilePath + CurrentUser.UserID + ".png";
                img.Save(Server.MapPath(avatar));

                bool flag = OrganizationBusiness.UpdateAccountAvatar(CurrentUser.UserID, avatar, CurrentUser.AgentID);

                if (flag)
                {
                    result                   = 1;
                    CurrentUser.Avatar       = avatar;
                    Session["ClientManager"] = CurrentUser;
                }
            }

            JsonDictionary.Add("Result", result);
            JsonDictionary.Add("Avatar", avatar);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 3
0
        /// <summary>
        /// 重置手机号
        /// </summary>
        /// <param name="bindMobile"></param>
        /// <param name="option"></param>
        /// <param name="code"></param>
        /// <returns></returns>
        public JsonResult UpdateMobilePhone(string userID)
        {
            bool flag   = false;
            int  result = 0;

            if (OrganizationBusiness.IsExistAccountType(EnumAccountType.UserName, userID))
            {
                Users item = IntFactoryBusiness.OrganizationBusiness.GetUserByUserID(userID, CurrentUser.ClientID);
                if (OrganizationBusiness.IsExistAccountType(EnumAccountType.Mobile, CurrentUser.UserID))
                {
                    flag = OrganizationBusiness.ClearAccountBindMobile(userID);
                    if (flag)
                    {
                        result = 1;
                        if (!string.IsNullOrEmpty(item.MobilePhone))
                        {
                            result = 2;
                        }
                    }
                }
                else
                {
                    result = 3;
                }
            }

            JsonDictionary.Add("result", result);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 4
0
        public JsonResult SaveOrderStage(string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            OrderStageEntity     model      = serializer.Deserialize <OrderStageEntity>(entity);

            int result = 0;

            if (string.IsNullOrEmpty(model.StageID))
            {
                model.StageID = new SystemBusiness().CreateOrderStage(model.StageName, model.Sort, model.Mark, model.MaxHours, "", model.ProcessID, CurrentUser.UserID, CurrentUser.ClientID, out result);

                model.Owner = OrganizationBusiness.GetUserByUserID(CurrentUser.UserID, CurrentUser.ClientID);
            }
            else
            {
                bool bl = new SystemBusiness().UpdateOrderStage(model.StageID, model.StageName, model.Mark, model.MaxHours, model.ProcessID, CurrentUser.UserID, OperateIP, CurrentUser.ClientID);
                if (bl)
                {
                    result = 1;
                }
            }

            JsonDictionary.Add("status", result);
            JsonDictionary.Add("model", model);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 5
0
        /// <summary>
        /// 获取订单基本信息
        /// </summary>
        public static ClientOrder GetClientOrderInfo(string orderID)
        {
            DataTable   dt    = ClientOrderDAL.BaseProvider.GetClientOrderInfo(orderID);
            ClientOrder model = new ClientOrder();

            if (dt.Rows.Count == 1)
            {
                DataRow row = dt.Rows[0];
                model.FillData(row);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.ClientID);
                if (string.IsNullOrEmpty(model.CreateUser.Name))
                {
                    M_Users mUser = M_UsersBusiness.GetUserDetail(model.CreateUserID);
                    if (mUser != null && !string.IsNullOrEmpty(mUser.Name))
                    {
                        model.CreateUser.Name = mUser.Name;
                    }
                }
                if (!string.IsNullOrEmpty(model.CheckUserID))
                {
                    model.CheckUser = OrganizationBusiness.GetUserByUserID(model.CheckUserID, model.ClientID);
                    if (string.IsNullOrEmpty(model.CheckUser.Name))
                    {
                        M_Users mUser = M_UsersBusiness.GetUserDetail(model.CheckUserID);
                        if (mUser != null && !string.IsNullOrEmpty(mUser.Name))
                        {
                            model.CheckUser.Name = mUser.Name;
                        }
                    }
                }
            }

            return(model);
        }
Esempio n. 6
0
        public JsonResult SaveOrderProcess(string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            OrderProcessEntity   model      = serializer.Deserialize <OrderProcessEntity>(entity);

            if (string.IsNullOrEmpty(model.ProcessID))
            {
                model.ProcessID = new SystemBusiness().CreateOrderProcess(model.ProcessName, model.ProcessType, model.CategoryID, model.PlanDays, model.IsDefault, CurrentUser.UserID, CurrentUser.UserID, CurrentUser.ClientID);
            }
            else
            {
                bool bl = new SystemBusiness().UpdateOrderProcess(model.ProcessID, model.ProcessName, model.PlanDays, CurrentUser.UserID, OperateIP, CurrentUser.ClientID);
                if (!bl)
                {
                    model.ProcessID = "";
                }
            }
            model.Owner = OrganizationBusiness.GetUserCacheByUserID(CurrentUser.UserID, CurrentUser.ClientID);
            JsonDictionary.Add("model", model);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 7
0
        /// <summary>
        /// 保存用户联系信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public JsonResult SaveAccountContact(string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();

            CloudSalesEntity.Users model = serializer.Deserialize <CloudSalesEntity.Users>(entity);


            bool flag = OrganizationBusiness.UpdateUserContactInfo(CurrentUser.UserID, model.Email, model.MobilePhone, model.OfficePhone, CurrentUser.AgentID);

            JsonDictionary.Add("Result", flag ? 1 : 0);

            if (flag)
            {
                CurrentUser.Email        = model.Email;
                CurrentUser.MobilePhone  = model.MobilePhone;
                CurrentUser.OfficePhone  = model.OfficePhone;
                Session["ClientManager"] = CurrentUser;
            }

            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 8
0
        /// <summary>
        /// 保存用户基本信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public JsonResult SaveAccountInfo(string entity, string departmentName)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();

            IntFactoryEntity.Users model = serializer.Deserialize <IntFactoryEntity.Users>(entity);

            bool flag = OrganizationBusiness.UpdateUserInfo(CurrentUser.UserID, model.Name, model.Jobs, model.Birthday, 0, model.DepartID, model.Email, model.MobilePhone, model.OfficePhone, CurrentUser.ClientID);

            JsonDictionary.Add("result", flag?1:0);

            if (flag)
            {
                CurrentUser.Name     = model.Name;
                CurrentUser.Jobs     = model.Jobs;
                CurrentUser.Birthday = model.Birthday;
                CurrentUser.Age      = model.Age;
                if (CurrentUser.DepartID != model.DepartID)
                {
                    CurrentUser.DepartID   = model.DepartID;
                    CurrentUser.Department = OrganizationBusiness.GetDepartmentByID(model.DepartID, CurrentUser.ClientID);
                }
                CurrentUser.Email        = model.Email;
                CurrentUser.MobilePhone  = model.MobilePhone;
                CurrentUser.OfficePhone  = model.OfficePhone;
                Session["ClientManager"] = CurrentUser;
            }

            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 9
0
        //绑定微信账户
        public int BindWeiXin(Users model)
        {
            int result = 0;

            if (Session["WeiXinTokenInfo"] != null)
            {
                string   tokenInfo = Session["WeiXinTokenInfo"].ToString();
                string[] tokenArr  = tokenInfo.Split('|');
                if (tokenArr.Length == 3)
                {
                    string access_token = tokenArr[0];
                    string unionid      = tokenArr[2];
                    bool   flag         = OrganizationBusiness.BindOtherAccount(EnumAccountType.WeiXin, model.UserID, unionid, model.ClientID);
                    if (flag)
                    {
                        Session["ClientManager"] = model;
                        Session.Remove("WeiXinTokenInfo");
                        result = 1;
                    }
                }
            }
            else
            {
                result = 5;
            }

            return(result);
        }
Esempio n. 10
0
        /// <summary>
        /// 设置用户头像
        /// </summary>
        /// <param name="avatar"></param>
        /// <returns></returns>
        public JsonResult SaveAccountAvatar(string avatar)
        {
            int result = 0;

            if (!string.IsNullOrEmpty(avatar))
            {
                avatar = avatar.Split(',')[1];
                MemoryStream stream    = new MemoryStream(Convert.FromBase64String(avatar));
                Bitmap       img       = new Bitmap(stream);
                string       localFile = TempPath + CurrentUser.UserID + ".png";
                img.Save(Server.MapPath(localFile));

                string key = TempPath + "User/" + CurrentUser.UserID + ".png";
                UploadAttachment(key, localFile);

                avatar = YXERP.Common.Common.QNDomianUrl + key + "?t=" + DateTime.Now.Ticks;
                bool flag = OrganizationBusiness.UpdateAccountAvatar(CurrentUser.UserID, avatar, CurrentUser.ClientID);
                if (flag)
                {
                    result                   = 1;
                    CurrentUser.Avatar       = avatar;
                    Session["ClientManager"] = CurrentUser;
                    System.IO.File.Delete(Server.MapPath(localFile));
                }
            }
            JsonDictionary.Add("result", result);
            JsonDictionary.Add("avatar", avatar);

            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 11
0
        public ActionResult Index()
        {
            string orderLevel = "0";
            string taskLevel  = "0";

            if (Session["ClientManager"] == null)
            {
                return(Redirect("/Home/Login"));
            }
            else
            {
                var currentUser = (IntFactoryEntity.Users)Session["ClientManager"];

                if (currentUser.Client.GuideStep != 0)
                {
                    return(Redirect("/Default/Index"));
                }

                var client = ClientBusiness.GetClientDetail(currentUser.ClientID);
                ViewBag.RemainDay  = Math.Ceiling((client.EndTime - DateTime.Now).TotalDays);
                ViewBag.RemainDate = client.EndTime.Date.ToString("yyyy-MM-dd");

                ViewBag.BuyPeople = client.UserQuantity;
                ViewBag.UsePeople = OrganizationBusiness.GetUsers(client.ClientID).FindAll(m => m.Status != 9).Count;

                if (currentUser.Role != null)
                {
                    //所有订单
                    if (ExpandClass.IsExistMenu("102010300"))
                    {
                        orderLevel = "-1";
                    }
                    else if (ExpandClass.IsExistMenu("102010601") || ExpandClass.IsExistMenu("102010701") || ExpandClass.IsExistMenu("102010801"))
                    {
                        orderLevel = "-1";
                    }
                    else if (ExpandClass.IsExistMenu("102010600") || ExpandClass.IsExistMenu("102010700") || ExpandClass.IsExistMenu("102010800"))
                    {
                        orderLevel = "1";
                    }

                    //所有任务
                    if (ExpandClass.IsExistMenu("109010200"))
                    {
                        taskLevel = "-1";
                    }
                    else
                    {
                        taskLevel = "1";
                    }
                }
                ViewBag.OrderMarks = SystemBusiness.BaseBusiness.GetLableColor(currentUser.ClientID, EnumMarkType.Orders);
                ViewBag.TaskMarks  = SystemBusiness.BaseBusiness.GetLableColor(currentUser.ClientID, EnumMarkType.Tasks);
                ViewBag.UserID     = currentUser.UserID;
                ViewBag.orderLevel = orderLevel;
                ViewBag.taskLevel  = taskLevel;
            }

            return(View());
        }
Esempio n. 12
0
        //微信账户注册
        public ActionResult WinXinRegisterMember()
        {
            string operateip = Common.Common.GetRequestIP();
            int    result;

            if (Session["WeiXinTokenInfo"] != null)
            {
                string   tokenInfo = Session["WeiXinTokenInfo"].ToString();
                string[] tokenArr  = tokenInfo.Split('|');
                if (tokenArr.Length == 3)
                {
                    string access_token = tokenArr[0];
                    string openid       = tokenArr[1];
                    var    memberResult = WeiXin.Sdk.Passport.GetUserInfo(access_token, openid);

                    string userid   = "";
                    var    clientid = ClientBusiness.InsertClient(EnumRegisterType.WeiXin, EnumAccountType.WeiXin, memberResult.unionid, "", memberResult.nickname, memberResult.nickname,
                                                                  "", "", "", "", "", "", "", "", out result, out userid);

                    if (!string.IsNullOrEmpty(clientid))
                    {
                        var current = OrganizationBusiness.GetUserByOtherAccount(EnumAccountType.WeiXin, memberResult.unionid, operateip);
                        Session.Remove("WeiXinTokenInfo");
                        Session["ClientManager"] = current;

                        return(Redirect("/Home/Index"));
                    }
                }
            }
            return(Redirect("/Home/Login"));
        }
Esempio n. 13
0
        /// <summary>
        /// 添加明道用户
        /// </summary>
        /// <param name="parentid">上级ID</param>
        /// <param name="mduserids">明道Id列表</param>
        /// <returns></returns>
        public JsonResult SaveMDUser(string parentid, string mduserids)
        {
            bool bl = false;

            string[] list = mduserids.Split(',');
            foreach (string mduserid in list)
            {
                if (!string.IsNullOrEmpty(mduserid) && !string.IsNullOrEmpty(CurrentUser.MDToken))
                {
                    var model = MD.SDK.UserBusiness.GetUserDetail(CurrentUser.MDToken, mduserid);
                    if (model.error_code <= 0)
                    {
                        var user = model.user;
                        int error = 0, result = 0;

                        bool isAdmin = false;//MD.SDK.Entity.App.AppBusiness.IsAppAdmin(CurrentUser.MDToken, user.id, out error);

                        OrganizationBusiness.CreateUser("", "", user.name, user.mobile_phone, user.email, "", "", "", "", "", parentid, CurrentUser.AgentID, CurrentUser.ClientID, user.id, user.project.id, isAdmin ? 1 : 0, CurrentUser.UserID, out result);
                        //添加成功
                        if (result == 1)
                        {
                            bl = true;
                        }
                    }
                }
            }

            JsonDictionary.Add("status", bl);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 14
0
        public JsonResult SavaTaskReply(string reply, string userID, string clientID, string taskID)
        {
            var    model   = JsonConvert.DeserializeObject <IntFactoryEntity.ReplyJson>(reply);
            string replyID = ReplyBusiness.CreateTaskReply(model.taskID, model.content, userID, clientID,
                                                           model.fromReplyID, model.fromReplyUserID, model.fromReplyAgentID);

            ReplyBusiness.AddTaskReplyAttachments(taskID, replyID, model.attachments, userID, clientID);

            if (!string.IsNullOrEmpty(replyID))
            {
                List <Dictionary <string, object> > replys   = new List <Dictionary <string, object> >();
                Dictionary <string, object>         replyObj = new Dictionary <string, object>();
                replyObj.Add("replyID", replyID);
                replyObj.Add("taskID", model.taskID);
                replyObj.Add("content", model.content);
                replyObj.Add("createUser", GetUserBaseObj(OrganizationBusiness.GetUserCacheByUserID(userID, clientID)));
                if (!string.IsNullOrEmpty(model.fromReplyUserID) && !string.IsNullOrEmpty(model.fromReplyAgentID))
                {
                    replyObj.Add("fromReplyUser", GetUserBaseObj(OrganizationBusiness.GetUserCacheByUserID(model.fromReplyUserID, model.fromReplyAgentID)));
                }
                replyObj.Add("attachments", model.attachments);
                replyObj.Add("createTime", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
                replys.Add(replyObj);

                JsonDictionary.Add("taskReplys", replys);
            }

            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 15
0
        public JsonResult GetUserByWeiXinMP(string unionid, string openid)
        {
            int    result    = 0;
            string operateip = Common.Common.GetRequestIP();
            Dictionary <string, object> resultObj = new Dictionary <string, object>();
            var model = OrganizationBusiness.GetUserByOtherAccount(EnumAccountType.WeiXin, unionid, operateip, openid);

            if (model != null)
            {
                //未注销
                if (model.Status.Value == 1)
                {
                    result = 1;
                    Dictionary <string, object> userObj = new Dictionary <string, object>();
                    //string domainUrl = Request.Url.Scheme + "://" + Request.Url.Host;
                    userObj.Add("userID", model.UserID);
                    userObj.Add("clientID", model.ClientID);
                    userObj.Add("name", model.Name);
                    userObj.Add("avatar", model.Avatar);
                    resultObj.Add("user", userObj);
                }
                else
                {
                    result = 2;
                }
            }
            resultObj.Add("result", result);

            return(new JsonResult
            {
                Data = resultObj,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 16
0
        /// <summary>
        /// 保存活动讨论
        /// </summary>
        public JsonResult SavaActivityReply(string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            ActivityReplyEntity  model      = serializer.Deserialize <ActivityReplyEntity>(entity);

            string replyID = string.Empty;

            replyID = ActivityBusiness.CreateActivityReply(model.ActivityID, model.Msg, CurrentUser.UserID, CurrentUser.AgentID, model.FromReplyID, model.FromReplyUserID, model.FromReplyAgentID);

            List <ActivityReplyEntity> list = new List <ActivityReplyEntity>();

            if (!string.IsNullOrEmpty(replyID))
            {
                model.ReplyID      = replyID;
                model.CreateTime   = DateTime.Now;
                model.CreateUser   = CurrentUser;
                model.CreateUserID = CurrentUser.UserID;
                model.AgentID      = CurrentUser.AgentID;
                if (!string.IsNullOrEmpty(model.FromReplyID))
                {
                    model.FromReplyUser = OrganizationBusiness.GetUserByUserID(model.FromReplyUserID, model.FromReplyAgentID);
                }
                list.Add(model);
            }
            JsonDictionary.Add("Items", list);

            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 17
0
 public ActionResult Users()
 {
     ViewBag.MDToken     = CurrentUser.MDToken;
     ViewBag.Roles       = OrganizationBusiness.GetRoles(CurrentUser.AgentID);
     ViewBag.Departments = OrganizationBusiness.GetDepartments(CurrentUser.AgentID);
     return(View());
 }
Esempio n. 18
0
        /// <summary>
        /// 保存部门
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public JsonResult SaveDepartment(string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            Department           model      = serializer.Deserialize <Department>(entity);

            string ID = "";

            if (string.IsNullOrEmpty(model.DepartID))
            {
                ID = new OrganizationBusiness().AddDepartment(model.Name, model.ParentID, model.Description, CurrentUser.UserID, CurrentUser.ClientID);
            }
            else
            {
                bool bl = new OrganizationBusiness().UpdateDepartment(model.DepartID, model.Name, model.Description, CurrentUser.UserID, OperateIP);
                if (bl)
                {
                    ID = model.DepartID;
                }
            }
            JsonDictionary.Add("ID", ID);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 19
0
        public ActionResult Index(string id)
        {
            ViewBag.Departments = OrganizationBusiness.GetDepartments(CurrentUser.AgentID);

            id             = id ?? "-1";
            ViewBag.Option = id;
            return(View());
        }
Esempio n. 20
0
        public ActionResult Users()
        {
            ViewBag.Roles = OrganizationBusiness.GetRoles();

            ViewBag.IsSysAdmin = CurrentUser.Role.IsDefault == 1 ? true : false;

            return(View());
        }
Esempio n. 21
0
        /// <summary>
        /// 获取客户订单账目列表
        /// </summary>
        public static List <ClientOrderAccount> GetClientOrderAccounts(string keyWords, string orderID, string clientID, int payType, int status, int type, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            string sqlWhere = "a.Status<>9";

            if (!string.IsNullOrEmpty(keyWords))
            {
                sqlWhere += " and ( a.OrderID like '%" + keyWords + "%'  or  a.ClientID  like '%" + keyWords + "%' )";
            }
            if (!string.IsNullOrEmpty(orderID))
            {
                sqlWhere += " and ( a.OrderID ='" + orderID + "' )";
            }
            if (!string.IsNullOrEmpty(clientID))
            {
                sqlWhere += " and ( a.ClientID ='" + clientID + "' )";
            }
            if (payType > 0)
            {
                sqlWhere += " and ( a.PayType ='" + payType + "' )";
            }
            if (type > 0)
            {
                sqlWhere += " and ( a.Type ='" + type + "' )";
            }
            if (status > 0)
            {
                sqlWhere += " and ( a.Status ='" + status + "' )";
            }
            string    sqlColumn            = @" * ";
            DataTable dt                   = CommonBusiness.GetPagerData("ClientOrderAccount a", sqlColumn, sqlWhere, "a.AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <ClientOrderAccount> list = new List <ClientOrderAccount>();
            ClientOrderAccount        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new ClientOrderAccount();
                model.FillData(item);
                if (!string.IsNullOrEmpty(model.CreateUserID))
                {
                    model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.ClientID);
                    if (string.IsNullOrEmpty(model.CreateUser.Name))
                    {
                        M_Users mUser = M_UsersBusiness.GetUserDetail(model.CreateUserID);
                        model.CreateUser.Name   = mUser != null ? mUser.Name : "";
                        model.CreateUser.UserID = model.CreateUserID;
                    }
                }
                if (!string.IsNullOrEmpty(model.CheckUserID))
                {
                    model.CheckerUser = M_UsersBusiness.GetUserDetail(model.CheckUserID);
                }
                list.Add(model);
            }

            return(list);
        }
Esempio n. 22
0
        public ActionResult Users()
        {
            ViewBag.MDToken     = string.Empty;
            ViewBag.Roles       = OrganizationBusiness.GetRoles(CurrentUser.ClientID);
            ViewBag.Departments = OrganizationBusiness.GetDepartments(CurrentUser.ClientID);

            ViewBag.IsSysAdmin = CurrentUser.Role.IsDefault == 1 ? true : false;

            return(View());
        }
Esempio n. 23
0
        /// <summary>
        /// 账号是否存在
        /// </summary>
        /// <param name="loginName"></param>
        /// <returns></returns>
        public JsonResult IsExistLoginName(string loginName)
        {
            bool bl = OrganizationBusiness.IsExistLoginName(loginName);

            JsonDictionary.Add("Result", bl);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 24
0
        public JsonResult GetUserAll()
        {
            var list = OrganizationBusiness.GetUsers(CurrentUser.AgentID).Where(m => m.Status == 1).OrderBy(m => m.FirstName).ToList();

            JsonDictionary.Add("items", list);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 25
0
        public JsonResult GetUserNoTeam()
        {
            var list = OrganizationBusiness.GetUsers(CurrentUser.AgentID).Where(m => m.TeamID == "");

            JsonDictionary.Add("items", list);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 26
0
        public JsonResult GetDepartmentByID(string id)
        {
            var model = OrganizationBusiness.GetDepartmentByID(id, CurrentUser.AgentID);

            JsonDictionary.Add("model", model);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 27
0
        /// <summary>
        /// 组织架构替换人员
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="olduserid"></param>
        /// <returns></returns>
        public JsonResult ChangeUsersParentID(string userid, string olduserid)
        {
            bool bl = new OrganizationBusiness().ChangeUsersParentID(userid, olduserid, CurrentUser.AgentID, CurrentUser.UserID, OperateIP);

            JsonDictionary.Add("status", bl);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 28
0
        /// <summary>
        /// 根据上级获取用户列表
        /// </summary>
        /// <param name="parentid"></param>
        /// <returns></returns>
        public JsonResult GetUsersByParentID(string parentid = "")
        {
            var list = OrganizationBusiness.GetUsersByParentID(parentid, CurrentUser.AgentID).OrderBy(m => m.FirstName).ToList();

            JsonDictionary.Add("items", list);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 29
0
        //编辑员工角色
        public JsonResult UpdateUserRole(string userid, string roleid)
        {
            bool bl = new OrganizationBusiness().UpdateUserRole(userid, roleid, CurrentUser.AgentID, CurrentUser.UserID, OperateIP);

            JsonDictionary.Add("status", bl);
            return(new JsonResult()
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Esempio n. 30
0
        /// <summary>
        /// 删除部门
        /// </summary>
        /// <param name="departid"></param>
        /// <returns></returns>
        public JsonResult DeleteDepartment(string departid)
        {
            var status = new OrganizationBusiness().UpdateDepartmentStatus(departid, CloudSalesEnum.EnumStatus.Delete, CurrentUser.UserID, OperateIP, CurrentUser.AgentID);

            JsonDictionary.Add("status", (int)status);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }