示例#1
0
        public BaseResultDto <string> ApplyBorrower(SystemBorrowerApply model)
        {
            BaseResultDto <string> result = new BaseResultDto <string>();

            try
            {
                if (helper.Add <SystemBorrowerApply>(model) > 0)
                {
                    result.ErrorMsg  = "成功";
                    result.ErrorCode = 1;
                    result.IsSeccess = true;
                }
                else
                {
                    result.ErrorMsg  = "失败";
                    result.ErrorCode = 0;
                }
            }
            catch (Exception ex)
            {
                result.ErrorMsg  = ex.Message;
                result.ErrorCode = -1;
            }
            return(result);
        }
        public BaseResultDto <string> AddDic(SystemDictionary model)
        {
            BaseResultDto <string> resultDto = new BaseResultDto <string>();

            try
            {
                resultDto.ErrorCode = helper.Add <SystemDictionary>(model);
                resultDto.ErrorMsg  = "添加成功";
            }
            catch (Exception ex)
            {
                resultDto.ErrorCode = -1;
                resultDto.ErrorMsg  = ex.Message;
            }
            return(resultDto);
        }
示例#3
0
        public BaseResultDto <string> AddSalesman(RQSalesmanDto model)
        {
            BaseResultDto <string> resultDto = new BaseResultDto <string>();

            if (!helper.IsExists <SystemUsers>(string.Format(" UserName ='******' and UserType ={1} ", model.UserName, model.UserType)))
            {
                if (!helper.IsExists <SystemUsers>(string.Format(" CellPhone ='{0}' and UserType ={1} ", model.Mobile, model.UserType)))
                {
                    if (!helper.IsExists <SystemUsers>(string.Format(" IDNumber ='{0}' and UserType ={1} ", model.IDNumber, model.UserType)))
                    {
                        SystemUsers systemUsers = new SystemUsers();
                        systemUsers.UserName                 = model.UserName;
                        systemUsers.UserPassword             = model.UserName;
                        systemUsers.CellPhone                = model.Mobile;
                        systemUsers.RealName                 = model.RealName;
                        systemUsers.IDNumber                 = model.IDNumber;
                        systemUsers.UserEmail                = model.Email;
                        systemUsers.UserAddress              = model.Address;
                        systemUsers.UserType                 = int.Parse(model.UserType);
                        systemUsers.RegTime                  = model.RegTime;
                        systemUsers.CellPahoneIsAuthenticate = true;
                        systemUsers.IDNumberIsAuthenticate   = true;

                        int Id = helper.Add <SystemUsers>(systemUsers);
                        resultDto.ErrorCode = Id;
                        if (Id > 0)
                        {
                            resultDto.ErrorMsg = "注册成功";
                        }
                        else
                        {
                            resultDto.ErrorCode = -1;
                            resultDto.ErrorMsg  = "注册失败";
                        }
                    }
                    else
                    {
                        resultDto.ErrorCode = -2;
                        resultDto.ErrorMsg  = string.Format("身份证{0}已注册", model.IDNumber);
                    }
                }
                else
                {
                    resultDto.ErrorCode = -3;
                    resultDto.ErrorMsg  = string.Format("手机号{0}已注册", model.Mobile);
                }
            }
            else
            {
                resultDto.ErrorCode = -4;
                resultDto.ErrorMsg  = string.Format("用户名{0}已注册", model.UserName);
            }
            return(resultDto);
        }
示例#4
0
 public int Add(SystemClaims model)
 {
     return(helper.Add <SystemClaims>(model));
 }