Exemplo n.º 1
0
        /// <summary>
        /// 修改负责人
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool EditManager(ManagerAccount model)
        {
            try
            {
                Manager entity = ManagerRepository.GetManagerById(model.ManagerId);
                if (entity == null)
                {
                    return(false);
                }
                entity.ManagerName  = model.ManagerName;
                entity.ManagerEmail = model.ManagerEmail;
                entity.MobilePhone  = model.MobilePhone;
                entity.IdCardNo     = model.IdCardNo;
                entity.ChannelId    = model.ChannelId;
                entity.CId          = model.CityId;
                entity.ModifiedTime = DateTime.Now;
                entity.IsActive     = Convert.ToInt32(Enum.Parse(typeof(Status), model.IsActiveStr));

                if (ManagerRepository.EditManager(entity) == 1)
                {
                    return(true);
                }
                return(false);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 激活或停用
        /// </summary>
        /// <param name="managerId"></param>
        /// <returns></returns>
        public bool ChangeAccountStatus(Int64 managerId)
        {
            try
            {
                Manager entity = ManagerRepository.GetManagerById(managerId);
                if (entity == null)
                {
                    return(false);
                }
                entity.ModifiedTime = DateTime.Now;
                entity.IsActive     = entity.IsActive == 1 ? 2 : 1;

                if (ManagerRepository.EditManager(entity) == 1)
                {
                    return(true);
                }
                return(false);
            }
            catch (Exception)
            {
                return(false);
            }
        }