Beispiel #1
0
        /// <summary>
        /// 获取新增信息数
        /// </summary>
        /// <param name="shopId">门店ID</param>
        /// <param name="userIdentity">0总后台 1总店,2分店</param>
        /// <param name="today">默认今天,否则昨天</param>
        /// <returns>System.Int32.</returns>
        public int GetNewMessageCount(int shopId, int userIdentity, bool today = true)
        {
            string strSql = "select COUNT(1) from BM_MessageManage M where CONVERT(nvarchar(10),M.CreateTime,121)=@Date and M.IsDel = 0  and IsSend=1 ";

            if (userIdentity != 0)
            {
                strSql  = @"select COUNT(1) from BM_MessageManage M 
                            inner join BM_MessageSendTarget T on T.MessageId = M.ID
                            where CONVERT(nvarchar(10),M.CreateTime,121)=@Date and M.IsDel = 0  and IsSend=1 ";
                strSql += " and T.SendTargetShopId=@ShopId";
            }
            else
            {
                strSql += " and M.IsSendBelongShopId=1 ";
            }

            DateTime dtnow = DateTime.Now;

            if (!today)
            {
                dtnow = DateTime.Now.AddDays(-1);
            }

            var param = new[] {
                new SqlParameter("@ShopId", shopId),
                new SqlParameter("@Date", dtnow.ToString("yyyy-MM-dd"))
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)));
        }
Beispiel #2
0
        /// <summary>
        /// 添加客户
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int InsertCustomerInfo(CustomerModel model)
        {
            string strSql = "insert into BM_CustomerManage (BelongOne,BelongTwo,Status,Name,Mobile,Addr,Remark,ShopId,InShop,BelongOneShopId,isSave,DataImg) values(@BelongOne,@BelongTwo,@Status,@Name,@Mobile,@Addr,@Remark,@ShopId,@InShop,@BelongOneShopId,@isSave,@DataImg);select @@IDENTITY;";
            var    param  = new[] {
                new SqlParameter("@BelongOne", model.BelongOne),
                new SqlParameter("@BelongTwo", model.BelongTwo),
                new SqlParameter("@Status", model.Status),
                new SqlParameter("@Name", model.Name),
                new SqlParameter("@Mobile", model.Mobile),
                new SqlParameter("@Addr", model.Addr),
                new SqlParameter("@Remark", model.Remark),
                new SqlParameter("@ShopId", model.ShopId),
                new SqlParameter("@InShop", model.InShop),
                new SqlParameter("@BelongOneShopId", model.BelongOneShopId),
                new SqlParameter("@isSave", model.isSave),
                new SqlParameter("@DataImg", model.DataImg)
            };
            object obj = DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param);

            if (obj != null)
            {
                return(Convert.ToInt32(obj));
            }
            return(0);
        }
Beispiel #3
0
        /// <summary>
        /// 添加等级
        /// 作者:郭孟稳
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int InsertLevel(MallUserLevelModel model)
        {
            string strsql = @"insert into Mall_UserLevel (UL_Level,UL_LevelName,UL_Type,UL_CustomerID,UL_Description,UL_DefaultLevel,UL_Integral
                                ,UL_MemberNum,UL_DirectTeamNum,UL_IndirectTeamNum,UL_Money,UL_OpenLevel_One,UL_BelongOne_Content,UL_OpenLevel_Two,UL_BelongTwo_Content,UL_GuidetLevel,UL_Gold)
                                values (@UL_Level,@UL_LevelName,@UL_Type,@UL_CustomerID,@UL_Description,@UL_DefaultLevel,@UL_Integral
                                ,@UL_MemberNum,@UL_DirectTeamNum,@UL_IndirectTeamNum,@UL_Money,@UL_OpenLevel_One,@UL_BelongOne_Content,@UL_OpenLevel_Two,@UL_BelongTwo_Content,@UL_GuidetLevel,@UL_Gold)
                                select @@IDENTITY";

            SqlParameter[] parm =
            {
                new SqlParameter("@UL_Level",             model.UL_Level),
                new SqlParameter("@UL_LevelName",         model.UL_LevelName),
                new SqlParameter("@UL_Type",              model.UL_Type),
                new SqlParameter("@UL_CustomerID",        model.UL_CustomerID),
                new SqlParameter("@UL_Description",       model.UL_Description),
                new SqlParameter("@UL_DefaultLevel",      model.UL_DefaultLevel),
                new SqlParameter("@UL_Integral",          model.UL_Integral),
                new SqlParameter("@UL_MemberNum",         model.UL_MemberNum),
                new SqlParameter("@UL_DirectTeamNum",     model.UL_DirectTeamNum),
                new SqlParameter("@UL_IndirectTeamNum",   model.UL_IndirectTeamNum),
                new SqlParameter("@UL_Money",             model.UL_Money),
                new SqlParameter("@UL_OpenLevel_One",     model.UL_OpenLevel_One),
                new SqlParameter("@UL_BelongOne_Content", model.UL_BelongOne_Content),
                new SqlParameter("@UL_OpenLevel_Two",     model.UL_OpenLevel_Two),
                new SqlParameter("@UL_BelongTwo_Content", model.UL_BelongTwo_Content),
                new SqlParameter("@UL_GuidetLevel",       model.UL_GuidetLevel),
                new SqlParameter("@UL_Gold",              model.UL_Gold)
            };
            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strsql, parm)));
        }
Beispiel #4
0
        /// <summary>
        /// 获取新增审核资讯数(此方法只有总后台调用)
        /// </summary>
        /// <param name="shopId">门店ID</param>
        /// <param name="userIdentity">0总后台 1总店,2分店</param>
        /// <param name="today">默认今天,否则昨天</param>
        /// <returns>System.Int32.</returns>
        public int GetNewArticleCount(int shopId, int userIdentity, bool today = true)
        {
            string strSql = "select COUNT(1) from BM_ArticleList where  CONVERT(nvarchar(10),CreateTime,121)=@Date  and IsDel=0 ";

            if (userIdentity != 0)
            {
                strSql += " and AuthorId=@ShopId and AuthorIdentity=@AuthorIdentity";
            }
            else
            {
                strSql += " and AuthorIdentity in (1,2)";
            }

            DateTime dtnow = DateTime.Now;

            if (!today)
            {
                dtnow = DateTime.Now.AddDays(-1);
            }

            var param = new[] {
                new SqlParameter("@ShopId", shopId),
                new SqlParameter("@AuthorIdentity", userIdentity),
                new SqlParameter("@Date", dtnow.ToString("yyyy-MM-dd"))
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)));
        }
Beispiel #5
0
        /// <summary>
        /// 根据多个门店ID,获取门店名称,并拼接在一起
        /// </summary>
        /// <param name="ids">The ids.</param>
        /// <returns>System.String.</returns>
        private string GetMessageShopName(string ids)
        {
            var    arr    = ids.Split(',');
            string strSql = string.Format("select stuff((select '/'+ShopName from BM_ShopManage where ShopID in ({0}) for xml path('')),1,1,'')", string.Join(",", arr));

            return(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql).ToString());
        }
Beispiel #6
0
        /// <summary>
        /// 添加站内信息
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns>System.Int32.</returns>
        public int AddMailInfo(MailModel model)
        {
            string strSql = @"insert into BM_Mail(AuthorId,AuthorName,SendType,Title,BodyContent,CoverUrl,ReplyUserId,ReplyPid,PhoneModel) values(@AuthorId,@AuthorName,@SendType,@Title,@BodyContent,@CoverUrl,@ReplyUserId,@ReplyPid,@PhoneModel);select @@IDENTITY";
            var    param  = new[] {
                new SqlParameter("@AuthorId", model.AuthorId),
                new SqlParameter("@AuthorName", model.AuthorName),
                new SqlParameter("@SendType", model.SendType),
                new SqlParameter("@Title", model.Title),
                new SqlParameter("@BodyContent", model.BodyContent),
                new SqlParameter("@CoverUrl", model.CoverUrl),
                new SqlParameter("@ReplyUserId", model.ReplyUserId),
                new SqlParameter("@ReplyPid", model.ReplyPid),
                new SqlParameter("@PhoneModel", model.PhoneModel)
            };
            object obj = DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), param);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Beispiel #7
0
        /// <summary>
        /// 获取新增盟友数
        /// </summary>
        /// <param name="shopId">门店ID</param>
        /// <param name="userIdentity">0总后台 1总店,2分店</param>
        /// <param name="today">默认今天,否则昨天</param>
        /// <returns>System.Int32.</returns>
        public int GetNewAllyCount(int shopId, int userIdentity, bool today = true)
        {
            string strSql = "select count(1) from BM_User_extend where  CONVERT(nvarchar(10),CreateTime,121)=@Date and UserIdentity=0 ";

            if (shopId > 0)
            {
                if (userIdentity == 1)
                {
                    strSql += " and BelongShopId=@ShopId";
                }
                else if (userIdentity == 2)
                {
                    strSql += " and ShopId=@ShopId";
                }
            }

            DateTime dtnow = DateTime.Now;

            if (!today)
            {
                dtnow = DateTime.Now.AddDays(-1);
            }

            var param = new[] {
                new SqlParameter("@ShopId", shopId),
                new SqlParameter("@Date", dtnow.ToString("yyyy-MM-dd"))
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)));
        }
Beispiel #8
0
        //public int GetNotReadMessageCount(int userId)
        //{
        //    string strSql = @"select COUNT(1) from BM_MailReadLog r
        //                    left join BM_Mail a on a.ID=r.MailId
        //                     where a.SendType<>2 and r.IsRead=0 and r.UserId=@UserId";
        //    var param = new[] {
        //        new SqlParameter("@UserId",userId)
        //    };
        //    return Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param));
        //}

        /// <summary>
        /// 获取未读消息数量
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="sendType">0我发的消息 1 我接收的消息,2我的留言</param>
        /// <returns>System.Int32.</returns>
        public int GetNotReadMessageCount(int userId, int sendType)
        {
            string strSql = @"select COUNT(1) from BM_MailReadLog r
                            left join BM_Mail a on a.ID=r.MailId
                             where r.IsRead=0 and r.UserId=@UserId";

            if (sendType == 2)
            {
                strSql += " and a.SendType=@SendType ";
            }
            else
            {
                strSql += " and a.SendType<>2 ";
            }

            if (sendType == 0 || sendType == 2)
            {
                strSql += " and a.AuthorId=@UserId ";
            }
            else
            {
                strSql += " and A.AuthorId<>@UserId ";
            }

            var param = new[] {
                new SqlParameter("@UserId", userId),
                new SqlParameter("@SendType", sendType)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)));
        }
Beispiel #9
0
        /// <summary>
        /// 获取分页数据集合
        /// </summary>
        /// <typeparam name="T"></typeparam>
        ///<param name="PageSize"></param>
        ///<param name="PageIndex"></param>
        /// <param name="strSql"></param>
        ///<param name="orderbyField">排序字段</param>
        /// <param name="commandParameters"></param>
        /// <param name="callback">回调处理函数</param>
        /// <returns></returns>
        public ResultPageModel getPageData <T>(int PageSize, int PageIndex, string strSql, string orderbyField, SqlParameter[] commandParameters, Action <List <T> > callback, bool orderby = false) where T : new()
        {
            string querySql       = DbHelperSQLP.buildPageSql(PageIndex, PageSize, strSql, orderbyField, orderby);
            string recordCountSql = DbHelperSQLP.buildRecordCountSql(strSql);

            ResultPageModel result      = new ResultPageModel();
            int             recordCount = Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, recordCountSql, commandParameters));
            List <T>        lst         = new List <T>();

            using (SqlDataReader dr = DbHelperSQLP.ExecuteReader(WebConfig.getConnectionString(), CommandType.Text, querySql, commandParameters))
            {
                lst = DbHelperSQLP.GetEntityList <T>(dr);
                callback?.Invoke(lst);
            }

            int pageCount = recordCount / PageSize;

            if (recordCount % PageSize != 0)
            {
                ++pageCount;
            }
            result.PageIndex = PageIndex;
            result.PageSize  = PageSize;
            result.Total     = recordCount;
            result.PageCount = pageCount;
            result.Rows      = lst;
            return(result);
        }
Beispiel #10
0
        /// <summary>
        /// 判断用户名是否存在
        /// </summary>
        /// <param name="loginName">Name of the login.</param>
        /// <returns>true if the specified login name is exist; otherwise, false.</returns>
        public bool IsExist(string loginName)
        {
            string strSql = "select COUNT(1) from BM_ShopManage where LoginName=@LoginName";
            var    param  = new[] {
                new SqlParameter("@LoginName", loginName)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)) > 0);
        }
Beispiel #11
0
        /// <summary>
        /// 根据总店ID,判断其所有分店是否全部冻结
        /// </summary>
        /// <param name="shopId">The shop identifier.</param>
        /// <returns>true if [is all disable by shop identifier] [the specified shop identifier]; otherwise, false.</returns>
        public bool IsAllDisableByShopID(int shopId)
        {
            string strSql = "select COUNT(1) from BM_ShopManage where ShopBelongId=@ShopID and IsActive=1  and IsDel=0";
            var    param  = new[] {
                new SqlParameter("@ShopID", shopId)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)) == 0);
        }
Beispiel #12
0
        /// <summary>
        /// 根据门店ID,获取门店名称
        /// </summary>
        /// <param name="shopId">The shop identifier.</param>
        /// <returns>System.String.</returns>
        private string GetMessageShopName(int shopId)
        {
            string strSql = "select ShopName from BM_ShopManage where ShopID=@ShopID";
            var    parms  = new[] {
                new SqlParameter("@ShopID", shopId)
            };

            return(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, parms).ToString());
        }
Beispiel #13
0
        /// <summary>
        /// 我的现金券数量
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <returns>System.Int32.</returns>
        public int GetMyCashCouponCount(int userId)
        {
            string strSql = "select COUNT(1) from BM_GetCashCouponLog where UserId=@UserId and IsGet=0 ";
            var    param  = new[] {
                new SqlParameter("@UserId", userId)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)));
        }
Beispiel #14
0
        /// <summary>
        /// 计算订单数
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public int CountOrders(int userId)
        {
            string strSql = "select count(*) from BM_Orders where UserId=@UserId";
            var    param  = new[] {
                new SqlParameter("@UserId", userId)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)));
        }
Beispiel #15
0
        /// <summary>
        /// 判断是否存在
        /// </summary>
        /// <param name="mobile"></param>
        /// <param name="addr"></param>
        /// <returns></returns>
        public bool IsExist(string mobile, string addr)
        {
            string strSql = "select COUNT(1) from BM_CustomerManage where IsDel=0 and Status<>2 and  Mobile =@Mobile or Addr =@Addr";
            var    param  = new[] {
                new SqlParameter("@Mobile", mobile),
                new SqlParameter("@Addr", addr)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)) > 0);
        }
Beispiel #16
0
        /// <summary>
        /// 判断用户是否存在
        /// </summary>
        /// <param name="mobile"></param>
        /// <param name="storeId"></param>
        /// <returns></returns>
        private bool UserExist(string mobile, int storeId)
        {
            string strSql = "select COUNT(1) from Hot_UserBaseInfo with(nolock) where UB_UserLoginName=@LoginName and UB_CustomerID=@CustomerID";
            var    param  = new[] {
                new SqlParameter("@LoginName", mobile),
                new SqlParameter("@CustomerID", storeId)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)) > 0);
        }
Beispiel #17
0
        /// <summary>
        /// 根据用户ID判断当前资讯是否已阅读
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="articleId">The article identifier.</param>
        /// <returns>true if the specified user identifier is read; otherwise, false.</returns>
        public bool IsRead(int userId, int articleId)
        {
            string strSql = "select COUNT(1) from BM_ReadLog where ArticleId=@ArticleId and UserId=@UserId";
            var    param  = new[] {
                new SqlParameter("@ArticleId", articleId),
                new SqlParameter("@UserId", userId)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)) > 0);
        }
Beispiel #18
0
        /// <summary>
        ///判断用户是否已转发
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="couponId">The coupon identifier.</param>
        /// <returns>true if [is send coupon by user identifier] [the specified user identifier]; otherwise, false.</returns>
        public bool IsSendCouponByUserId(int userId, int couponId)
        {
            string strSql = "select COUNT(1) from BM_CouponSend where UserId=@UserId and CouponId=@CouponId";
            var    parm   = new[] {
                new SqlParameter("@UserId", userId),
                new SqlParameter("@CouponId", couponId)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parm)) > 0);
        }
Beispiel #19
0
        /// <summary>
        /// 判断授权token是否存在
        /// </summary>
        /// <param name="UserId">The user identifier.</param>
        /// <returns>true if [is authentication token exist] [the specified user identifier]; otherwise, false.</returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public bool IsAuthTokenExist(int UserId)
        {
            string strSql = "select COUNT(1) from BM_AuthToken where UserId=@UserId";

            SqlParameter[] parm =
            {
                new SqlParameter("@UserId", UserId),
            };
            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, parm)) > 0);
        }
Beispiel #20
0
        public bool IsExist(string loginName)
        {
            string strSql = "select COUNT(1) from Hot_UserBaseInfo U with(nolock) where U.UB_UserLoginName=@UB_UserLoginName and U.UB_CustomerID=@UB_CustomerID";
            var    param  = new[] {
                new SqlParameter("@UB_UserLoginName", loginName),
                new SqlParameter("@UB_CustomerID", ConstConfig.storeId),
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)) > 0);
        }
Beispiel #21
0
        /// <summary>
        /// 更新用户阅读状态
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="articleId">The article identifier.</param>
        /// <returns>true if XXXX, false otherwise.</returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public bool UpdateReadStatus(int userId, int articleId)
        {
            string strSql = "update BM_ReadLog set IsRead=1 where UserId=@UserId and ArticleId=@ArticleId";
            var    param  = new[] {
                new SqlParameter("@ArticleId", articleId),
                new SqlParameter("@UserId", userId)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)) > 0);
        }
Beispiel #22
0
        /// <summary>
        /// 判断是否通过验证
        /// </summary>
        /// <param name="verifyCode"></param>
        /// <returns></returns>
        public bool IsPassVerify(string verifyCode, string phone)
        {
            string strSql     = "select count(1) from Swt_SmsVerification where SSV_Verification=@SSV_Verification and SSV_IsInvalid=0 and SSV_Phone=@SSV_Phone and DATEDIFF(SECOND,SSV_AddTime,GETDATE()) < 600 ";
            var    parameters = new[] {
                new SqlParameter("@SSV_Verification", verifyCode),
                new SqlParameter("@SSV_Phone", phone)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, parameters)) > 0);
        }
Beispiel #23
0
        /// <summary>
        ///添加工作汇报内容
        /// </summary>
        /// <param name="title">The title.</param>
        /// <returns>System.Int32.</returns>
        public int AddWorkReport(string title)
        {
            string strSql = "insert into BM_WorkReport(WorkTitle) values(@WorkTitle);select @@IDENTITY";

            var param = new[] {
                new SqlParameter("@WorkTitle", title),
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)));
        }
Beispiel #24
0
        /// <summary>
        /// 判断当前盟主的盟友奖励是否存在
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <returns>true if [is rewar exist] [the specified user identifier]; otherwise, false.</returns>
        public bool IsRewarExist(int userId)
        {
            string strSql = "select COUNT(1) from BM_RewardsSetting where UserId=@UserId";

            SqlParameter[] param =
            {
                new SqlParameter("@UserId", userId)
            };
            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)) > 0);
        }
Beispiel #25
0
        /// <summary>
        /// 根据盟友ID,获取盟友的订单数量
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="orderStatus">0 未成交 1 已成交 2退单</param>
        /// <returns>System.Int32.</returns>
        public int CountOrdersByAllyUserId(int userId, int orderStatus)
        {
            string strSql = "select count(*) from BM_Orders where Ct_BelongId=@UserId and OrderStatus=@OrderStatus";
            var    param  = new[] {
                new SqlParameter("@UserId", userId),
                new SqlParameter("@OrderStatus", orderStatus)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)));
        }
Beispiel #26
0
        /// <summary>
        /// 根据条件,修改阅读状态为未读
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="mailId">The mail identifier.</param>
        /// <returns>true if XXXX, false otherwise.</returns>
        public bool UpdateMailNotReadStatus(int userId, int mailId)
        {
            string strSql = "update BM_MailReadLog set IsRead=0 where UserId<>@UserId and MailId=@MailId and IsRead=1";
            var    param  = new[] {
                new SqlParameter("@MailId", mailId),
                new SqlParameter("@UserId", userId)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param)) > 0);
        }
Beispiel #27
0
        /// <summary>
        /// 获取当前发送次数
        /// </summary>
        /// <param name="phone">The phone.</param>
        /// <param name="customerid">The customerid.</param>
        /// <returns>System.Int32.</returns>
        public int TodaySendCount(string phone, int customerid)
        {
            string sql        = "SELECT COUNT(1) FROM Swt_SmsVerification WHERE SSV_Phone=@Mobile AND SSV_CustomerId=@StoreId and CONVERT(nvarchar(10),SSV_AddTime,121)=CONVERT(nvarchar(10),GETDATE(),121)";
            var    parameters = new[] {
                new SqlParameter("@Mobile", phone),
                new SqlParameter("@StoreId", customerid)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, sql, parameters)));
        }
Beispiel #28
0
        /// <summary>
        /// 获取商户的等级数量
        /// 作者:郭孟稳
        /// </summary>
        /// <param name="storeId"></param>
        /// <returns></returns>
        public int GetLevelCount(int storeId, int type)
        {
            string strSql = "select COUNT(*) from Mall_UserLevel where UL_CustomerID=@UL_CustomerID and UL_Type=@UL_Type";

            SqlParameter[] parm =
            {
                new SqlParameter("@UL_CustomerID", storeId),
                new SqlParameter("@UL_Type",       type)
            };
            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, parm)));
        }
Beispiel #29
0
        /// <summary>
        /// 获取当前最大等级级别
        /// 作者:郭孟稳
        /// </summary>
        /// <param name="storeId"></param>
        /// <returns></returns>
        public int GetMaxLevel(int storeId, int type)
        {
            string strSql = "select top 1 UL_Level from Mall_UserLevel where UL_CustomerID=@UL_CustomerID  and UL_Type=@UL_Type order by UL_Level desc";

            SqlParameter[] parm =
            {
                new SqlParameter("@UL_CustomerID", storeId),
                new SqlParameter("@UL_Type",       type)
            };
            object obj = DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, parm);

            return(obj == null ? 0 : Convert.ToInt32(obj));
        }
Beispiel #30
0
        public bool Exists(string verifyCode)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) from Swt_SmsVerification");
            strSql.Append(" where ");
            strSql.Append(" SSV_Verification = @SSV_Verification and SSV_IsInvalid=0");
            var parameters = new[] {
                new SqlParameter("@SSV_Verification", verifyCode)
            };

            return(Convert.ToInt32(DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parameters)) > 0);
        }