示例#1
0
        protected void AddUserApply()
        {
            string  content     = string.Empty;
            decimal queryString = RequestHelper.GetQueryString <decimal>("Money");
            string  str2        = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("UserNote"));

            if ((queryString <= 0M) || (str2 == string.Empty))
            {
                content = "请填写金额和备注";
            }
            else if (UserBLL.ReadUserMore(base.UserID).MoneyLeft < queryString)
            {
                content = "提现金额大于剩余金额";
            }
            else
            {
                UserApplyInfo userApply = new UserApplyInfo();
                Random        random    = new Random();
                userApply.Number          = RequestHelper.DateNow.ToString("yyMMddhh") + random.Next(0x3e8, 0x270f);
                userApply.Money           = queryString;
                userApply.UserNote        = str2;
                userApply.Status          = 1;
                userApply.ApplyDate       = RequestHelper.DateNow;
                userApply.ApplyIP         = ClientHelper.IP;
                userApply.AdminNote       = string.Empty;
                userApply.UpdateDate      = RequestHelper.DateNow;
                userApply.UpdateAdminID   = 0;
                userApply.UpdateAdminName = string.Empty;
                userApply.UserID          = base.UserID;
                userApply.UserName        = base.UserName;
                UserApplyBLL.AddUserApply(userApply);
            }
            ResponseHelper.Write(content);
            ResponseHelper.End();
        }
示例#2
0
 public UserApplyInfo ReadUserApply(int id, int userID)
 {
     SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@id", SqlDbType.Int), new SqlParameter("@userID", SqlDbType.Int) };
     pt[0].Value = id;
     pt[1].Value = userID;
     UserApplyInfo info = new UserApplyInfo();
     using (SqlDataReader reader = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadUserApply", pt))
     {
         if (reader.Read())
         {
             info.ID = reader.GetInt32(0);
             info.Number = reader[1].ToString();
             info.Money = reader.GetDecimal(2);
             info.UserNote = reader[3].ToString();
             info.Status = reader.GetInt32(4);
             info.ApplyDate = reader.GetDateTime(5);
             info.ApplyIP = reader[6].ToString();
             info.AdminNote = reader[7].ToString();
             info.UpdateDate = reader.GetDateTime(8);
             info.UpdateAdminID = reader.GetInt32(9);
             info.UpdateAdminName = reader[10].ToString();
             info.UserID = reader.GetInt32(11);
             info.UserName = reader[12].ToString();
         }
     }
     return info;
 }
示例#3
0
 public void UpdateUserApply(UserApplyInfo userApply)
 {
     SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@id", SqlDbType.Int), new SqlParameter("@status", SqlDbType.Int), new SqlParameter("@adminNote", SqlDbType.NVarChar), new SqlParameter("@updateDate", SqlDbType.DateTime), new SqlParameter("@updateAdminID", SqlDbType.Int), new SqlParameter("@updateAdminName", SqlDbType.NVarChar) };
     pt[0].Value = userApply.ID;
     pt[1].Value = userApply.Status;
     pt[2].Value = userApply.AdminNote;
     pt[3].Value = userApply.UpdateDate;
     pt[4].Value = userApply.UpdateAdminID;
     pt[5].Value = userApply.UpdateAdminName;
     ShopMssqlHelper.ExecuteNonQuery(ShopMssqlHelper.TablePrefix + "UpdateUserApply", pt);
 }
示例#4
0
 public int AddUserApply(UserApplyInfo userApply)
 {
     SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@number", SqlDbType.NVarChar), new SqlParameter("@money", SqlDbType.Decimal), new SqlParameter("@userNote", SqlDbType.NVarChar), new SqlParameter("@status", SqlDbType.Int), new SqlParameter("@applyDate", SqlDbType.DateTime), new SqlParameter("@applyIP", SqlDbType.NVarChar), new SqlParameter("@adminNote", SqlDbType.NVarChar), new SqlParameter("@updateDate", SqlDbType.DateTime), new SqlParameter("@updateAdminID", SqlDbType.Int), new SqlParameter("@updateAdminName", SqlDbType.NVarChar), new SqlParameter("@userID", SqlDbType.Int), new SqlParameter("@userName", SqlDbType.NVarChar) };
     pt[0].Value = userApply.Number;
     pt[1].Value = userApply.Money;
     pt[2].Value = userApply.UserNote;
     pt[3].Value = userApply.Status;
     pt[4].Value = userApply.ApplyDate;
     pt[5].Value = userApply.ApplyIP;
     pt[6].Value = userApply.AdminNote;
     pt[7].Value = userApply.UpdateDate;
     pt[8].Value = userApply.UpdateAdminID;
     pt[9].Value = userApply.UpdateAdminName;
     pt[10].Value = userApply.UserID;
     pt[11].Value = userApply.UserName;
     return Convert.ToInt32(ShopMssqlHelper.ExecuteScalar(ShopMssqlHelper.TablePrefix + "AddUserApply", pt));
 }
示例#5
0
 public void PrepareUserApplyModel(SqlDataReader dr, List<UserApplyInfo> userApplyList)
 {
     while (dr.Read())
     {
         UserApplyInfo item = new UserApplyInfo();
         item.ID = dr.GetInt32(0);
         item.Number = dr[1].ToString();
         item.Money = dr.GetDecimal(2);
         item.UserNote = dr[3].ToString();
         item.Status = dr.GetInt32(4);
         item.ApplyDate = dr.GetDateTime(5);
         item.ApplyIP = dr[6].ToString();
         item.AdminNote = dr[7].ToString();
         item.UpdateDate = dr.GetDateTime(8);
         item.UpdateAdminID = dr.GetInt32(9);
         item.UpdateAdminName = dr[10].ToString();
         item.UserID = dr.GetInt32(11);
         item.UserName = dr[12].ToString();
         userApplyList.Add(item);
     }
 }
示例#6
0
        public async Task <Pager <IQueryable <UserApplyEntity> > > List(UserApplyInfo userApplyInfo)
        {
            //判断查询参数
            Expression <Func <UserApplyEntity, bool> > where_serch      = LinqUtil.True <UserApplyEntity>();
            Expression <Func <UserEntity, bool> >      userwhere_serach = LinqUtil.True <UserEntity>();

            if (userApplyInfo.istrue != -1)
            {
                where_serch = userApplyInfo.istrue == 0 ? where_serch.AndAlso(c => c.is_true == false) : where_serch.AndAlso(c => c.is_true == true);
            }
            if (!string.IsNullOrEmpty(userApplyInfo.user_email))
            {
                userwhere_serach = userwhere_serach.AndAlso(c => c.user_email.Contains(userApplyInfo.user_email));
            }

            int pageindex = userApplyInfo.pageindex;
            int total     = await userApplyRepository.CountAsync(where_serch);

            //调用仓储方法查询分页并且响应给前台

            IQueryable <UserApplyEntity> query = (from c in await userApplyRepository.GetAllAsync(where_serch)
                                                  join o in await userRepository.GetAllAsync(userwhere_serach) on c.user_id equals o.user_id
                                                  join n in await userRepository.GetAllAsync() on c.detail_id equals n.user_id into joinTemp
                                                  from tmp in joinTemp.DefaultIfEmpty()
                                                  select new UserApplyEntity()
            {
                //使用申请人用户Id和处理人用户Id返回用户邮箱信息
                user_id = o.user_email,
                createtime = c.createtime,
                detail_id = tmp == null ? "" : tmp.full_name,
                apply_id = c.apply_id,
                apply_reason = c.apply_reason,
                apply_desc = c.apply_desc,
                row_number = c.row_number,
                is_true = c.is_true
            }).OrderByDescending(c => c.createtime).Skip((--pageindex * userApplyInfo.pagesize)).Take(userApplyInfo.pagesize);

            return(new Pager <IQueryable <UserApplyEntity> >(total, query));
        }
示例#7
0
        /// <summary>
        /// 添加提现申请
        /// </summary>
        protected void AddUserApply()
        {
            string  result   = string.Empty;
            decimal money    = RequestHelper.GetQueryString <decimal>("Money");
            string  userNote = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("UserNote"));

            if (money <= 0 || userNote == string.Empty)
            {
                result = "请填写金额和备注";
            }
            else
            {
                UserInfo user = UserBLL.ReadUserMore(base.UserID);
                if (user.MoneyLeft < money)
                {
                    result = "提现金额大于剩余金额";
                }
                else
                {
                    UserApplyInfo userApply = new UserApplyInfo();
                    Random        rd        = new Random();
                    userApply.Number          = RequestHelper.DateNow.ToString("yyMMddhh") + rd.Next(1000, 9999);
                    userApply.Money           = money;
                    userApply.UserNote        = userNote;
                    userApply.Status          = (int)ApplyStatus.Indeterminate;
                    userApply.ApplyDate       = RequestHelper.DateNow;
                    userApply.ApplyIP         = ClientHelper.IP;
                    userApply.AdminNote       = string.Empty;
                    userApply.UpdateDate      = RequestHelper.DateNow;
                    userApply.UpdateAdminID   = 0;
                    userApply.UpdateAdminName = string.Empty;
                    userApply.UserID          = base.UserID;
                    userApply.UserName        = base.UserName;
                    UserApplyBLL.AddUserApply(userApply);
                }
            }
            ResponseHelper.Write(result);
            ResponseHelper.End();
        }
示例#8
0
        public async Task <IActionResult> List(UserApplyInfo userApplyInfo)
        {
            var data = await userApplyService.List(userApplyInfo);

            return(JsonDateTime(data));
        }
示例#9
0
 public static void UpdateUserApply(UserApplyInfo userApply)
 {
     dal.UpdateUserApply(userApply);
 }
示例#10
0
 public static int AddUserApply(UserApplyInfo userApply)
 {
     userApply.ID = dal.AddUserApply(userApply);
     return(userApply.ID);
 }