Ejemplo n.º 1
0
        /// <summary>
        /// 根据类型得到分页的日志数据
        /// </summary>
        /// <param name="page"></param>
        /// <param name="pagesize"></param>
        /// <param name="type"></param>
        /// <param name="totalcount"></param>
        /// <returns></returns>
        public static List <AmountChangeLogModel> GetAmountChangeLogByTypeForPage(int pageindex, int pagesize, int type, int memberid, out int totalrowcount)
        {
            List <AmountChangeLogModel> list = new List <AmountChangeLogModel>();
            string columms = @"ID ,MemberID ,MemberPhone ,MemberName ,ProduceMoney ,Remark ,AddTime ,OrderID ,[Type] ,OrderCode";

            string where = "";
            if (type > 0)
            {
                where += " [Type]=" + type.ToString();
            }
            if (memberid > 0)
            {
                where += " [MemberID]=" + memberid.ToString();
            }
            PageProModel page = new PageProModel();

            page.colums    = columms;
            page.orderby   = "AddTime";
            page.pageindex = pageindex;
            page.pagesize  = pagesize;
            page.tablename = @"dbo.AmountChangeLog";
            page.where     = where;
            DataTable dt = PublicHelperDAL.GetTable(page, out totalrowcount);

            foreach (DataRow item in dt.Rows)
            {
                AmountChangeLogModel model = new AmountChangeLogModel();
                if (item["ID"].ToString() != "")
                {
                    model.ID = int.Parse(item["ID"].ToString());
                }
                if (item["AddTime"].ToString() != "")
                {
                    model.AddTime = DateTime.Parse(item["AddTime"].ToString());
                }
                if (item["MemberID"].ToString() != "")
                {
                    model.MemberID = int.Parse(item["MemberID"].ToString());
                }
                model.MemberPhone = item["MemberPhone"].ToString();
                if (item["ProduceMoney"].ToString() != "")
                {
                    model.ProduceMoney = decimal.Parse(item["ProduceMoney"].ToString());
                }
                model.MemberName = item["MemberName"].ToString();
                if (item["AddTime"].ToString() != "")
                {
                    model.AddTime = DateTime.Parse(item["AddTime"].ToString());
                }
                model.Remark = item["Remark"].ToString();
                if (item["OrderID"].ToString() != "")
                {
                    model.OrderID = int.Parse(item["OrderID"].ToString());
                }
                model.OrderCode = item["OrderCode"].ToString();
                model.Type      = int.Parse(item["Type"].ToString());
                list.Add(model);
            }
            return(list);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 得到会员的分类激活码信息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="totalrowcount"></param>
        /// <returns></returns>
        public List <MemberActiveCodeModel> GetMemberActiveCodeListForPage(int memberid, int typeid, int pageindex, int pagesize, out int totalrowcount)
        {
            List <MemberActiveCodeModel> list = new List <MemberActiveCodeModel>();
            string columms = @"ID,ActiveCode,AMType,MemberID,MemberPhone,MemberName,AMStatus,Addtime,UseCode,UserTime,CASE AMStatus WHEN 1 THEN '未使用' WHEN 2 THEN '已使用' WHEN 3 THEN '已过期' END AS AMStatusName";

            string where = "";
            if (memberid > 0)
            {
                where = " MemberID=" + memberid.ToString() + " AND AMType=" + typeid.ToString();
            }
            PageProModel page = new PageProModel();

            page.colums    = columms;
            page.orderby   = "Addtime";
            page.pageindex = pageindex;
            page.pagesize  = pagesize;
            page.tablename = @"dbo.MemberActiveCode";
            page.where     = where;
            DataTable dt = PublicHelperDAL.GetTable(page, out totalrowcount);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow item in dt.Rows)
                {
                    MemberActiveCodeModel activecode = new MemberActiveCodeModel();
                    if (item["ID"].ToString() != "")
                    {
                        activecode.ID = int.Parse(item["ID"].ToString());
                    }
                    if (item["UserTime"].ToString() != "")
                    {
                        activecode.UserTime = DateTime.Parse(item["UserTime"].ToString());
                    }
                    activecode.ActiveCode = item["ActiveCode"].ToString();
                    if (item["AMType"].ToString() != "")
                    {
                        activecode.AMType = int.Parse(item["AMType"].ToString());
                    }
                    if (item["MemberID"].ToString() != "")
                    {
                        activecode.MemberID = int.Parse(item["MemberID"].ToString());
                    }
                    activecode.MemberPhone = item["MemberPhone"].ToString();
                    activecode.MemberName  = item["MemberName"].ToString();
                    if (item["AMStatus"].ToString() != "")
                    {
                        activecode.AMStatus = int.Parse(item["AMStatus"].ToString());
                    }
                    if (item["Addtime"].ToString() != "")
                    {
                        activecode.Addtime = DateTime.Parse(item["Addtime"].ToString());
                    }
                    activecode.UseCode      = item["UseCode"].ToString();
                    activecode.AMStatusName = item["AMStatusName"].ToString();
                    list.Add(activecode);
                }
            }
            return(list);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 查询所有的待匹配的接受帮助订单
        /// </summary>
        /// <returns></returns>
        public List <AcceptHelpOrderModel> GetWaitAcceptOrderListForPage(AcceptHelpOrderModel model, out int totalrowcount)
        {
            List <AcceptHelpOrderModel> list = new List <AcceptHelpOrderModel>();
            string columms = @" ID, AddTime, AStatus, SortIndex, OrderCode, MemberID, MemberPhone, MemberName, Amount, PayType, MatchedAmount, TurnOutOrder,CASE AStatus WHEN 0 THEN '未匹配' WHEN 1 THEN '部分匹配' WHEN 2 THEN '全部匹配' WHEN 3 THEN '已撤销' WHEN 4 THEN '对方已打款' WHEN 5 THEN '已完成' END AS AStatusName,DATEDIFF(DAY,AddTime,GETDATE()) AS diffday ";

            string where = " AStatus not in (3,5) and (Amount-MatchedAmount)>0 ";
            PageProModel page = new PageProModel();

            page.colums    = columms;
            page.orderby   = " (DATEDIFF(DAY,AddTime,GETDATE())) ";
            page.pageindex = model.PageIndex;
            page.pagesize  = model.PageSize;
            page.tablename = @"dbo.AcceptHelpOrder";
            page.where     = where;
            DataTable dt = PublicHelperDAL.GetTable(page, out totalrowcount);

            foreach (DataRow item in dt.Rows)
            {
                AcceptHelpOrderModel acceptordermodel = new AcceptHelpOrderModel();
                if (item["ID"].ToString() != "")
                {
                    acceptordermodel.ID = int.Parse(item["ID"].ToString());
                }
                if (item["AddTime"].ToString() != "")
                {
                    acceptordermodel.AddTime = DateTime.Parse(item["AddTime"].ToString());
                }
                if (item["AStatus"].ToString() != "")
                {
                    acceptordermodel.AStatus = int.Parse(item["AStatus"].ToString());
                }
                if (item["SortIndex"].ToString() != "")
                {
                    acceptordermodel.SortIndex = int.Parse(item["SortIndex"].ToString());
                }
                acceptordermodel.OrderCode = item["OrderCode"].ToString();
                if (item["MemberID"].ToString() != "")
                {
                    acceptordermodel.MemberID = int.Parse(item["MemberID"].ToString());
                }
                acceptordermodel.MemberPhone = item["MemberPhone"].ToString();
                acceptordermodel.MemberName  = item["MemberName"].ToString();
                if (item["Amount"].ToString() != "")
                {
                    acceptordermodel.Amount = decimal.Parse(item["Amount"].ToString());
                }
                acceptordermodel.PayType = item["PayType"].ToString();
                if (item["MatchedAmount"].ToString() != "")
                {
                    acceptordermodel.MatchedAmount = decimal.Parse(item["MatchedAmount"].ToString());
                }
                acceptordermodel.TurnOutOrder = item["TurnOutOrder"].ToString();
                acceptordermodel.AStatusName  = item["AStatusName"].ToString();
                acceptordermodel.DiffDay      = int.Parse(item["diffday"].ToString());
                list.Add(acceptordermodel);
            }
            return(list);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 得到会员的激活码使用信息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="totalrowcount"></param>
        /// <returns></returns>
        public List <ActiveCodeLogModel> GetActiveCodeLogListForPage(int memberid, int pageindex, int pagesize, out int totalrowcount)
        {
            List <ActiveCodeLogModel> list = new List <ActiveCodeLogModel>();
            string columms = @"ID ,MemberID ,MemberName ,MemberPhone ,ActiveCode ,AID ,Remark ,Addtime";

            string where = "";
            if (memberid > 0)
            {
                where = " MemberID=" + memberid.ToString();
            }
            PageProModel page = new PageProModel();

            page.colums    = columms;
            page.orderby   = "Addtime";
            page.pageindex = pageindex;
            page.pagesize  = pagesize;
            page.tablename = @"dbo.ActiveCodeLog";
            page.where     = where;
            DataTable dt = PublicHelperDAL.GetTable(page, out totalrowcount);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow item in dt.Rows)
                {
                    ActiveCodeLogModel activelog = new ActiveCodeLogModel();
                    if (item["ID"].ToString() != "")
                    {
                        activelog.ID = int.Parse(item["ID"].ToString());
                    }
                    activelog.ActiveCode = item["ActiveCode"].ToString();
                    if (item["MemberID"].ToString() != "")
                    {
                        activelog.MemberID = int.Parse(item["MemberID"].ToString());
                    }
                    activelog.MemberPhone = item["MemberPhone"].ToString();
                    activelog.MemberName  = item["MemberName"].ToString();
                    if (item["AID"].ToString() != "")
                    {
                        activelog.AID = int.Parse(item["AID"].ToString());
                    }
                    if (item["Addtime"].ToString() != "")
                    {
                        activelog.Addtime = DateTime.Parse(item["Addtime"].ToString());
                    }
                    activelog.Remark = item["Remark"].ToString();
                    list.Add(activelog);
                }
            }
            return(list);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 分页查询方法
        /// </summary>
        /// <param name="page"></param>
        /// <param name="totalrowcount"></param>
        /// <returns></returns>
        public static DataTable GetTable(PageProModel page, out int totalrowcount)
        {
            totalrowcount = 0;
            var totalrowcountpram = new SqlParameter("@totalrecord", System.Data.SqlDbType.Int);

            totalrowcountpram.Direction = System.Data.ParameterDirection.Output;
            SqlParameter[] paramter = new[] {
                new SqlParameter("@orderby", page.orderby),
                new SqlParameter("@tablename", page.tablename),
                new SqlParameter("@colums", page.colums),
                new SqlParameter("@where", page.where),
                new SqlParameter("@pageindex", page.pageindex),
                new SqlParameter("@pagesize", page.pagesize),
                totalrowcountpram
            };
            DataSet ds = helper.RunProcedureDataSet("PagePro", paramter);

            totalrowcount = Convert.ToInt32(totalrowcountpram.Value);
            return(ds.Tables[0]);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 查询所有的帮助订单
        /// </summary>
        /// <returns></returns>
        public List <AcceptHelpOrderModel> GetAllAcceptOrderListForPage(AcceptHelpOrderModel model, out int totalrowcount)
        {
            List <AcceptHelpOrderModel> list = new List <AcceptHelpOrderModel>();
            string columms = @"ID, AddTime, AStatus, SourceType,SortIndex, OrderCode, MemberID, MemberPhone, MemberName, Amount, PayType, MatchedAmount, TurnOutOrder,CASE AStatus WHEN 0 THEN '未匹配' WHEN 1 THEN '部分匹配' WHEN 2 THEN '全部匹配' WHEN 3 THEN '已撤销' WHEN 4 THEN '对方已打款' WHEN 5 THEN '已完成' END AS AStatusName,CASE SourceType WHEN 1 THEN '静态资金' WHEN 2 THEN '动态资金' END AS SourceTypeName ";

            string where = "";
            if (model != null)
            {
                if (!string.IsNullOrWhiteSpace(model.OrderCode))
                {
                    where += "OrderCode='" + model.OrderCode + "'";
                }
                if (model.MemberID > 0 && string.IsNullOrWhiteSpace(where))
                {
                    where += @" MemberID =" + model.MemberID;
                }
                else if (model.MemberID > 0 && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND MemberID =" + model.MemberID;
                }
                if (!string.IsNullOrWhiteSpace(model.MemberPhone) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" MemberPhone Like '%" + model.MemberPhone + "%'";
                }
                else if (!string.IsNullOrWhiteSpace(model.MemberPhone) && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND MemberPhone Like '%" + model.MemberPhone + "%'";
                }
                if (!string.IsNullOrWhiteSpace(model.MemberName) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" MemberName ='" + model.MemberName + "'";
                }
                else if (!string.IsNullOrWhiteSpace(model.MemberName) && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND MemberName ='" + model.MemberName + "'";
                }
                if (model.AStatus > 0 && string.IsNullOrWhiteSpace(where))
                {
                    where += @" AStatus =" + model.AStatus;
                }
                else if (model.AStatus > 0 && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND AStatus =" + model.AStatus;
                }
            }
            PageProModel page = new PageProModel();

            page.colums    = columms;
            page.orderby   = "SortIndex";
            page.pageindex = model.PageIndex;
            page.pagesize  = model.PageSize;
            page.tablename = @"dbo.AcceptHelpOrder";
            page.where     = where;
            DataTable dt = PublicHelperDAL.GetTable(page, out totalrowcount);

            foreach (DataRow item in dt.Rows)
            {
                AcceptHelpOrderModel helpeordermodel = new AcceptHelpOrderModel();
                if (item["ID"].ToString() != "")
                {
                    helpeordermodel.ID = int.Parse(item["ID"].ToString());
                }
                if (item["AddTime"].ToString() != "")
                {
                    helpeordermodel.AddTime = DateTime.Parse(item["AddTime"].ToString());
                }
                if (item["AStatus"].ToString() != "")
                {
                    helpeordermodel.AStatus = int.Parse(item["AStatus"].ToString());
                }
                if (item["SortIndex"].ToString() != "")
                {
                    helpeordermodel.SortIndex = int.Parse(item["SortIndex"].ToString());
                }
                helpeordermodel.OrderCode = item["OrderCode"].ToString();
                if (item["MemberID"].ToString() != "")
                {
                    helpeordermodel.MemberID = int.Parse(item["MemberID"].ToString());
                }
                helpeordermodel.MemberPhone = item["MemberPhone"].ToString();
                helpeordermodel.MemberName  = item["MemberName"].ToString();
                if (item["Amount"].ToString() != "")
                {
                    helpeordermodel.Amount = decimal.Parse(item["Amount"].ToString());
                }
                model.PayType = item["PayType"].ToString();
                if (item["MatchedAmount"].ToString() != "")
                {
                    helpeordermodel.MatchedAmount = decimal.Parse(item["MatchedAmount"].ToString());
                }
                if (item["SourceType"].ToString() != "")
                {
                    helpeordermodel.SourceType = item["SourceType"].ToString().ParseToInt(0);
                }
                helpeordermodel.SourceTypeName = item["SourceTypeName"].ToString();
                helpeordermodel.TurnOutOrder   = item["TurnOutOrder"].ToString();
                helpeordermodel.AStatusName    = item["AStatusName"].ToString();
                list.Add(helpeordermodel);
            }
            return(list);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 得到分页数据
        /// </summary>
        /// <param name="model"></param>
        /// <param name="totalrowcount"></param>
        /// <returns></returns>
        public List <ActiveCodeModel> GetActiveCodeListForPage(ActiveCodeModel model, out int totalrowcount)
        {
            List <ActiveCodeModel> list = new List <ActiveCodeModel>();
            string columms = @"ID,ActivationCode,AType,CASE AType WHEN 1 THEN '激活码' WHEN 2 THEN '排单币' END ATypeName,AStatus,AddTime,CASE AStatus WHEN 20 THEN '未使用' WHEN 15 THEN '已分配'  WHEN 10 THEN '已使用' END AStatusName ";

            string where = "";
            if (model != null)
            {
                if (model.AStatus > 0)
                {
                    where += " AStatus= " + model.AStatus;
                }
                if (!string.IsNullOrWhiteSpace(model.ActivationCode) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" ActivationCode Like '%" + model.ActivationCode + "%'";
                }
                else if (!string.IsNullOrWhiteSpace(model.ActivationCode) && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND ActivationCode Like '%" + model.ActivationCode + "%'";
                }
                if (model.AType > 0 && string.IsNullOrWhiteSpace(where))
                {
                    where += @" AType =" + model.AType;
                }
                else if (model.AType > 0 && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND AType =" + model.AType;
                }
            }
            PageProModel page = new PageProModel();

            page.colums    = columms;
            page.orderby   = "ID";
            page.pageindex = model.PageIndex;
            page.pagesize  = model.PageSize;
            page.tablename = @"dbo.ActiveCode";
            page.where     = where;
            DataTable dt = PublicHelperDAL.GetTable(page, out totalrowcount);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow item in dt.Rows)
                {
                    ActiveCodeModel active = new ActiveCodeModel();
                    if (item["ID"].ToString() != "")
                    {
                        active.ID = int.Parse(item["ID"].ToString());
                    }
                    active.ActivationCode = item["ActivationCode"].ToString();
                    if (item["AType"].ToString() != "")
                    {
                        active.AType = int.Parse(item["AType"].ToString());
                    }
                    if (item["AStatus"].ToString() != "")
                    {
                        active.AStatus = int.Parse(item["AStatus"].ToString());
                    }
                    if (item["AddTime"].ToString() != "")
                    {
                        active.AddTime = DateTime.Parse(item["AddTime"].ToString());
                    }
                    active.AStatusName = item["AStatusName"].ToString();
                    active.ATypeName   = item["ATypeName"].ToString();
                    list.Add(active);
                }
            }
            return(list);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 得到会员的激活码信息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="totalrowcount"></param>
        /// <returns></returns>
        public List <MemberActiveCodeModel> GetMemberActiveCodeListForPage(MemberActiveCodeModel model, out int totalrowcount)
        {
            List <MemberActiveCodeModel> list = new List <MemberActiveCodeModel>();
            string columms = @"ID ,ActiveCode ,AMType,CASE AMType WHEN 1 THEN '激活账户' WHEN 2 THEN '排单专用' END AMTypeName ,MemberID ,MemberPhone ,MemberName ,AMStatus ,Addtime,CASE AMStatus WHEN 1 THEN '未使用' WHEN 2 THEN '已使用'  WHEN 3 THEN '已过期' END AMStatusName";

            string where = "";
            if (model != null)
            {
                if (model.AMStatus > 0)
                {
                    where += " AMStatus= " + model.AMStatus;
                }
                if (!string.IsNullOrWhiteSpace(model.MemberPhone) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" MemberPhone Like '%" + model.MemberPhone + "%'";
                }
                else if (!string.IsNullOrWhiteSpace(model.MemberPhone) && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND MemberPhone Like '%" + model.MemberPhone + "%'";
                }
                if (!string.IsNullOrWhiteSpace(model.ActiveCode) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" ActiveCode ='" + model.ActiveCode + "'";
                }
                else if (!string.IsNullOrWhiteSpace(model.ActiveCode) && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND ActiveCode ='" + model.ActiveCode + "'";
                }
            }
            PageProModel page = new PageProModel();

            page.colums    = columms;
            page.orderby   = "Addtime";
            page.pageindex = model.PageIndex;
            page.pagesize  = model.PageSize;
            page.tablename = @"dbo.MemberActiveCode";
            page.where     = where;
            DataTable dt = PublicHelperDAL.GetTable(page, out totalrowcount);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow item in dt.Rows)
                {
                    MemberActiveCodeModel memberactive = new MemberActiveCodeModel();
                    if (item["ID"].ToString() != "")
                    {
                        memberactive.ID = int.Parse(item["ID"].ToString());
                    }
                    memberactive.ActiveCode = item["ActiveCode"].ToString();
                    if (item["MemberID"].ToString() != "")
                    {
                        memberactive.MemberID = int.Parse(item["MemberID"].ToString());
                    }
                    memberactive.MemberPhone = item["MemberPhone"].ToString();
                    memberactive.MemberName  = item["MemberName"].ToString();
                    if (item["AMStatus"].ToString() != "")
                    {
                        memberactive.AMStatus = int.Parse(item["AMStatus"].ToString());
                    }
                    if (item["Addtime"].ToString() != "")
                    {
                        memberactive.Addtime = DateTime.Parse(item["Addtime"].ToString());
                    }
                    memberactive.AMStatusName = item["AMStatusName"].ToString();
                    memberactive.AMTypeName   = item["AMTypeName"].ToString();
                    list.Add(memberactive);
                }
            }
            return(list);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 按页查询匹配的单据信息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="totalrowcount"></param>
        /// <returns></returns>
        public static List <MatchOrderModel> GetMatchedOrderListByPage(MatchOrderModel model, out int totalrowcount)
        {
            List <MatchOrderModel> list = new List <MatchOrderModel>();
            string columms = @" ID,HelperOrderID,HelperOrderCode,HelperMemberID,AcceptOrderID,AcceptOrderCode,AcceptMemberID,MatchedMoney,MatchTime,MatchStatus,LastUpdateTime,CASE MatchStatus WHEN 1 THEN '已匹配' WHEN 2 THEN '已取消' WHEN 3 THEN '已打款'  WHEN 4 THEN '已完成' END AS MatchStatusName,HelperMemberName,HelperMemberPhone,AcceptMemberName,AcceptMemberPhone ";

            string where = "";
            if (model != null)
            {
                if (model.MatchStatus > 0)
                {
                    where += "MatchStatus='" + model.MatchStatus + "'";
                }
                if (!string.IsNullOrWhiteSpace(model.HelperOrderCode) && string.IsNullOrWhiteSpace(where))
                {
                    where += " HelperOrderCode='" + model.HelperOrderCode.ToString() + "'";
                }
                else if (!string.IsNullOrWhiteSpace(where) && !string.IsNullOrWhiteSpace(model.HelperOrderCode))
                {
                    where += @" AND HelperOrderCode='" + model.HelperOrderCode.ToString() + "'";
                }
                if (!string.IsNullOrWhiteSpace(model.AcceptOrderCode) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" AcceptOrderCode = '" + model.AcceptOrderCode + "'";
                }
                else if (!string.IsNullOrWhiteSpace(model.AcceptOrderCode) && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND AcceptOrderCode = '" + model.AcceptOrderCode + "'";
                }
            }
            PageProModel page = new PageProModel();

            page.colums    = columms;
            page.orderby   = "ID";
            page.pageindex = model.PageIndex;
            page.pagesize  = model.PageSize;
            page.tablename = @"dbo.MatchOrder";
            page.where     = where;
            DataTable dt = PublicHelperDAL.GetTable(page, out totalrowcount);

            foreach (DataRow item in dt.Rows)
            {
                MatchOrderModel matchordermodel = new MatchOrderModel();

                if (item["ID"].ToString() != "")
                {
                    matchordermodel.ID = int.Parse(item["ID"].ToString());
                }
                if (item["MatchStatus"].ToString() != "")
                {
                    matchordermodel.MatchStatus = int.Parse(item["MatchStatus"].ToString());
                }
                if (item["LastUpdateTime"].ToString() != "")
                {
                    matchordermodel.LastUpdateTime = DateTime.Parse(item["LastUpdateTime"].ToString());
                }
                if (item["HelperOrderID"].ToString() != "")
                {
                    matchordermodel.HelperOrderID = int.Parse(item["HelperOrderID"].ToString());
                }
                matchordermodel.HelperOrderCode   = item["HelperOrderCode"].ToString();
                matchordermodel.HelperMemberName  = item["HelperMemberName"].ToString();
                matchordermodel.HelperMemberPhone = item["HelperMemberPhone"].ToString();
                matchordermodel.AcceptMemberName  = item["AcceptMemberName"].ToString();
                matchordermodel.AcceptMemberPhone = item["AcceptMemberPhone"].ToString();
                if (item["HelperMemberID"].ToString() != "")
                {
                    matchordermodel.HelperMemberID = int.Parse(item["HelperMemberID"].ToString());
                }
                if (item["AcceptOrderID"].ToString() != "")
                {
                    matchordermodel.AcceptOrderID = int.Parse(item["AcceptOrderID"].ToString());
                }
                matchordermodel.AcceptOrderCode = item["AcceptOrderCode"].ToString();
                if (item["AcceptMemberID"].ToString() != "")
                {
                    matchordermodel.AcceptMemberID = int.Parse(item["AcceptMemberID"].ToString());
                }
                if (item["MatchedMoney"].ToString() != "")
                {
                    matchordermodel.MatchedMoney = decimal.Parse(item["MatchedMoney"].ToString());
                }
                if (item["MatchTime"].ToString() != "")
                {
                    matchordermodel.MatchTime = DateTime.Parse(item["MatchTime"].ToString());
                }
                matchordermodel.MatchStatusName = item["MatchStatusName"].ToString();
                list.Add(matchordermodel);
            }
            return(list);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 查询用户操作数据
        /// </summary>
        /// <param name="model"></param>
        /// <param name="totalrowcount"></param>
        /// <returns></returns>
        public static List <UserBehaviorLogModel> GetUserBehaviorLogByPage(UserBehaviorLogModel model, out int totalrowcount)
        {
            List <UserBehaviorLogModel> list = new List <UserBehaviorLogModel>();
            string columms = @" ID,MemberID,MemberPhone,MemberName,BehaviorSource,BehaviorType,ProcAmount,HOrderCode,AOrderCode,Remark,AddTime,CASE BehaviorType WHEN 1 THEN '登陆' WHEN  2 THEN '提供帮助' WHEN  3 THEN '接受帮助' WHEN 4  THEN '变更打款'  WHEN 5  THEN '确认单据'  WHEN 6  THEN '撤销单据'  WHEN 7  THEN '发放排单币'  WHEN 8  THEN '发放激活币'  WHEN 9  THEN '奖励会员'  WHEN 10  THEN '惩罚会员'  WHEN 11  THEN '系统派息' END AS BehaviorTypeName,CASE BehaviorSource WHEN 1 THEN '前端' WHEN 2 THEN '后台' END AS BehaviorSourceName ";

            string where = "";
            if (model != null)
            {
                if (model.BehaviorType > 0)
                {
                    where += @"BehaviorType='" + model.BehaviorType + "'";
                }
                if (!string.IsNullOrWhiteSpace(model.MemberName) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" MemberName=" + model.MemberID.ToString();
                }
                else if (!string.IsNullOrWhiteSpace(where) && !string.IsNullOrWhiteSpace(model.MemberName))
                {
                    where += @" AND MemberName=" + model.MemberID.ToString();
                }
                if (!string.IsNullOrWhiteSpace(model.MemberPhone) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" MemberPhone = '" + model.MemberPhone + "'";
                }
                else if (!string.IsNullOrWhiteSpace(model.MemberPhone) && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND MemberPhone = '" + model.MemberPhone + "'";
                }
            }
            PageProModel page = new PageProModel();

            page.colums    = columms;
            page.orderby   = "ID";
            page.pageindex = model.PageIndex;
            page.pagesize  = model.PageSize;
            page.tablename = @"dbo.UserBehaviorLog";
            page.where     = where;
            DataTable dt = PublicHelperDAL.GetTable(page, out totalrowcount);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow item in dt.Rows)
                {
                    UserBehaviorLogModel usermodel = new UserBehaviorLogModel();
                    if (item["ID"].ToString() != "")
                    {
                        usermodel.ID = int.Parse(item["ID"].ToString());
                    }
                    usermodel.Remark = item["Remark"].ToString();
                    if (item["AddTime"].ToString() != "")
                    {
                        usermodel.AddTime = DateTime.Parse(item["AddTime"].ToString());
                    }
                    if (item["MemberID"].ToString() != "")
                    {
                        usermodel.MemberID = int.Parse(item["MemberID"].ToString());
                    }
                    usermodel.MemberPhone = item["MemberPhone"].ToString();
                    usermodel.MemberName  = item["MemberName"].ToString();
                    if (item["BehaviorSource"].ToString() != "")
                    {
                        usermodel.BehaviorSource = int.Parse(item["BehaviorSource"].ToString());
                    }
                    if (item["BehaviorType"].ToString() != "")
                    {
                        usermodel.BehaviorType = int.Parse(item["BehaviorType"].ToString());
                    }
                    if (item["ProcAmount"].ToString() != "")
                    {
                        usermodel.ProcAmount = decimal.Parse(item["ProcAmount"].ToString());
                    }
                    usermodel.HOrderCode         = item["HOrderCode"].ToString();
                    usermodel.AOrderCode         = item["AOrderCode"].ToString();
                    usermodel.BehaviorSourceName = item["BehaviorSourceName"].ToString();
                    usermodel.BehaviorTypeName   = item["BehaviorTypeName"].ToString();
                    list.Add(usermodel);
                }
            }
            return(list);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 查询所有的帮助订单
        /// </summary>
        /// <returns></returns>
        public List <HelpeOrderModel> GetAllHelpeOrderListForPage(HelpeOrderModel model, out int totalrowcount)
        {
            List <HelpeOrderModel> list = new List <HelpeOrderModel>();
            string columms = @"ID, MatchedAmount, AddTime, SortIndex, ActiveCode,OrderCode, MemberID, MemberPhone, MemberName, Amount, Interest, PayType, HStatus,CASE HStatus WHEN 0 THEN '未匹配' WHEN 1 THEN '部分匹配' WHEN 2 THEN '全部匹配' WHEN 3 THEN '已撤销'  WHEN 4 THEN '已打款'  WHEN 5 THEN '已确认' END AS HStatusName";

            string where = "";
            if (model != null)
            {
                if (!string.IsNullOrWhiteSpace(model.OrderCode))
                {
                    where += "OrderCode='" + model.OrderCode + "'";
                }
                if (model.MemberID > 0 && string.IsNullOrWhiteSpace(where))
                {
                    where += " MemberID=" + model.MemberID.ToString();
                }
                else if (!string.IsNullOrWhiteSpace(where) && model.MemberID > 0)
                {
                    where += @" AND MemberID=" + model.MemberID.ToString();
                }
                if (!string.IsNullOrWhiteSpace(model.MemberPhone) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" MemberPhone Like '%" + model.MemberPhone + "%'";
                }
                else if (!string.IsNullOrWhiteSpace(model.MemberPhone) && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND MemberPhone Like '%" + model.MemberPhone + "%'";
                }
                if (!string.IsNullOrWhiteSpace(model.MemberName) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" MemberName ='" + model.MemberName + "'";
                }
                else if (!string.IsNullOrWhiteSpace(model.MemberName) && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND MemberName ='" + model.MemberName + "'";
                }
                if (model.HStatus > -10 && string.IsNullOrWhiteSpace(where))
                {
                    where += @" HStatus =" + model.HStatus;
                }
                else if (model.HStatus > -10 && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND HStatus =" + model.HStatus;
                }
            }
            PageProModel page = new PageProModel();

            page.colums    = columms;
            page.orderby   = "SortIndex";
            page.pageindex = model.PageIndex;
            page.pagesize  = model.PageSize;
            page.tablename = @"dbo.HelpeOrder";
            page.where     = where;
            DataTable dt = PublicHelperDAL.GetTable(page, out totalrowcount);

            foreach (DataRow item in dt.Rows)
            {
                HelpeOrderModel helpeordermodel = new HelpeOrderModel();
                if (item["ID"].ToString() != "")
                {
                    helpeordermodel.ID = int.Parse(item["ID"].ToString());
                }
                if (item["MatchedAmount"].ToString() != "")
                {
                    helpeordermodel.MatchedAmount = decimal.Parse(item["MatchedAmount"].ToString());
                }
                if (item["AddTime"].ToString() != "")
                {
                    helpeordermodel.AddTime = DateTime.Parse(item["AddTime"].ToString());
                }
                if (item["SortIndex"].ToString() != "")
                {
                    helpeordermodel.SortIndex = int.Parse(item["SortIndex"].ToString());
                }
                helpeordermodel.OrderCode = item["OrderCode"].ToString();
                if (item["MemberID"].ToString() != "")
                {
                    helpeordermodel.MemberID = int.Parse(item["MemberID"].ToString());
                }
                helpeordermodel.MemberPhone = item["MemberPhone"].ToString();
                helpeordermodel.MemberName  = item["MemberName"].ToString();
                if (item["Amount"].ToString() != "")
                {
                    helpeordermodel.Amount = decimal.Parse(item["Amount"].ToString());
                }
                if (item["Interest"].ToString() != "")
                {
                    helpeordermodel.Interest = decimal.Parse(item["Interest"].ToString());
                }
                helpeordermodel.PayType = item["PayType"].ToString();
                if (item["HStatus"].ToString() != "")
                {
                    helpeordermodel.HStatus = int.Parse(item["HStatus"].ToString());
                }
                helpeordermodel.HStatusName = item["HStatusName"].ToString();
                helpeordermodel.ActiveCode  = item["ActiveCode"].ToString();
                list.Add(helpeordermodel);
            }
            return(list);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 得到分页数据
        /// </summary>
        /// <param name="model"></param>
        /// <param name="totalrowcount"></param>
        /// <returns></returns>
        public List <MemberInfoModel> GetMemberInfoListForPage(MemberInfoModel model, out int totalrowcount)
        {
            List <MemberInfoModel> list = new List <MemberInfoModel>();
            string columms = @"ID,TruethName,Sex,TelPhone,MobileNum,Email,IdentificationID,Province,City,Area,ADDRESS,WeixinNum,AliPayName,AliPayNum,SecurityQuestion,SecurityAnswer,MStatus,AddTime,CASE MStatus WHEN 1 THEN '待激活' WHEN 2 THEN '已激活' WHEN 3 THEN '已冻结' END MStatusName";

            string where = "";
            if (model != null)
            {
                if (model.ID > 0)
                {
                    where += "ID=" + model.ID;
                }
                if (!string.IsNullOrWhiteSpace(model.MobileNum) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" MobileNum Like '%" + model.MobileNum + "%'";
                }
                else if (!string.IsNullOrWhiteSpace(model.MobileNum) && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND MobileNum Like '%" + model.MobileNum + "%'";
                }
                if (!string.IsNullOrWhiteSpace(model.TruethName) && string.IsNullOrWhiteSpace(where))
                {
                    where += @" TruethName ='" + model.TruethName + "'";
                }
                else if (!string.IsNullOrWhiteSpace(model.TruethName) && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND TruethName ='" + model.TruethName + "'";
                }
                if (model.MStatus > 0 && string.IsNullOrWhiteSpace(where))
                {
                    where += @" MStatus =" + model.MStatus;
                }
                else if (model.MStatus > 0 && !string.IsNullOrWhiteSpace(where))
                {
                    where += @" AND MStatus =" + model.MStatus;
                }
            }
            PageProModel page = new PageProModel();

            page.colums    = columms;
            page.orderby   = "ID";
            page.pageindex = model.PageIndex;
            page.pagesize  = model.PageSize;
            page.tablename = @"dbo.MemberInfo";
            page.where     = where;
            DataTable dt = PublicHelperDAL.GetTable(page, out totalrowcount);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow item in dt.Rows)
                {
                    MemberInfoModel memberModel = new MemberInfoModel();
                    if (item["ID"].ToString() != "")
                    {
                        memberModel.ID = int.Parse(item["ID"].ToString());
                    }
                    memberModel.TruethName = item["TruethName"].ToString();
                    if (item["Sex"].ToString() != "")
                    {
                        memberModel.Sex = int.Parse(item["Sex"].ToString());
                    }
                    if (item["MStatus"].ToString() != "")
                    {
                        memberModel.MStatus = int.Parse(item["MStatus"].ToString());
                    }
                    memberModel.TelPhone = item["TelPhone"].ToString();
                    if (item["AddTime"].ToString() != "")
                    {
                        memberModel.AddTime = DateTime.Parse(item["AddTime"].ToString());
                    }
                    memberModel.MobileNum        = item["MobileNum"].ToString();
                    memberModel.Email            = item["Email"].ToString();
                    memberModel.IdentificationID = item["IdentificationID"].ToString();
                    memberModel.Province         = item["Province"].ToString();
                    memberModel.City             = item["City"].ToString();
                    memberModel.Area             = item["Area"].ToString();
                    memberModel.Address          = item["ADDRESS"].ToString();
                    memberModel.AliPayName       = item["AliPayName"].ToString();
                    memberModel.AliPayNum        = item["AliPayNum"].ToString();
                    memberModel.SecurityQuestion = item["SecurityQuestion"].ToString();
                    memberModel.WeixinNum        = item["WeixinNum"].ToString();
                    memberModel.SecurityAnswer   = item["SecurityAnswer"].ToString();
                    memberModel.MStatusName      = item["MStatusName"].ToString();
                    list.Add(memberModel);
                }
            }
            return(list);
        }