Пример #1
0
        public int Update(string person, string Role)
        {
            T_PERSON user   = JSONHelper.FromJson <T_PERSON>(person);
            int      result = 0;

            try
            {
                var list = personRoleVM.GetListAll().Where(x => x.S_PERSONID == user.S_ID).ToList();
                if (list != null && list.Count > 0)
                {
                    list.ForEach(x => personRoleVM.Delete(x));
                }

                if (!string.IsNullOrEmpty(Role))
                {
                    var arr = Role.Split(',');
                    foreach (var item in arr)
                    {
                        T_Person_Role _personRole = new T_Person_Role();
                        _personRole.S_Id         = Common.Utilities.UniqueNumber.GuidNumber();
                        _personRole.S_PERSONID   = user.S_POLICENUM;
                        _personRole.S_ROLE_ID    = item;
                        _personRole.D_UPDATETIME = DateTime.Now;
                        personRoleVM.Add(_personRole);
                    }
                }
                result = userVM.Update(user);
                result = 1;
            }
            catch (Exception ex)
            {
            }
            return(result);
        }
Пример #2
0
        public int PersonAdd(string person, string Role)
        {
            T_PERSON user   = JSONHelper.FromJson <T_PERSON>(person);
            int      result = 0;

            try
            {
                if (!string.IsNullOrEmpty(Role))
                {
                    var arr = Role.Split(',');
                    foreach (var item in arr)
                    {
                        T_Person_Role _personRole = new T_Person_Role();
                        _personRole.S_Id         = Common.Utilities.UniqueNumber.GuidNumber();
                        _personRole.S_PERSONID   = user.S_POLICENUM;
                        _personRole.S_ROLE_ID    = item;
                        _personRole.D_UPDATETIME = DateTime.Now;
                        personRoleVM.Add(_personRole);
                    }
                }
                result = userVM.Add(user);
                result = 1;
            }
            catch (Exception ex)
            {
            }
            return(result);
        }
Пример #3
0
 public int Update(T_PERSON model)
 {
     return(_UserOperate.Update(model));
 }
Пример #4
0
 public int Add(T_PERSON model)
 {
     return(_UserOperate.Add(model));
 }
Пример #5
0
        public T_PERSON GetLoginInfo(string userId, string pwd)
        {
            T_PERSON _PERSON = _UserOperate.LoginInfo(userId, pwd);

            return(_PERSON);
        }