Пример #1
0
        /// <summary>
        /// 修改客户
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateCustomerInfo(CustomerModel model)
        {
            string strSql = "update BM_CustomerManage set Name=@Name,Mobile=@Mobile,Addr=@Addr,Remark=@Remark,Status=@Status where ID=@ID";
            var    param  = new[] {
                new SqlParameter("@Name", model.Name),
                new SqlParameter("@Mobile", model.Mobile),
                new SqlParameter("@Addr", model.Addr),
                new SqlParameter("@Remark", model.Remark),
                new SqlParameter("@Status", model.Status),
                new SqlParameter("@ID", model.ID)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }
Пример #2
0
        /// <summary>
        /// 添加焦点广告图
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns>System.Int32.</returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public int AddFocusPic(FocusPicModel model)
        {
            string strSql = @"insert into BM_BannerManage(Type,Title,PicUrl,Description,IsEnable,Sort,LinkUrl) values(@Type,@Title,@PicUrl,@Description,@IsEnable,@Sort,@LinkUrl)";
            var    param  = new[] {
                new SqlParameter("@Title", model.Title),
                new SqlParameter("@PicUrl", model.PicUrl),
                new SqlParameter("@Description", model.Description),
                new SqlParameter("@IsEnable", model.IsEnable),
                new SqlParameter("@Sort", model.Sort),
                new SqlParameter("@LinkUrl", model.LinkUrl),
                new SqlParameter("@Type", model.Type)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param));
        }
Пример #3
0
        /// <summary>
        /// 修改现金券
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns>true if XXXX, false otherwise.</returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public bool UpdateCashCoupon(CashCouponModel model)
        {
            string strSql = "update BM_CashCoupon set Title=@Title,Money=@Money,StartTime=@StartTime,EndTime=@EndTime,IsEnable=@IsEnable,Remark=@Remark where CouponId=@CouponId";
            var    parm   = new[] {
                new SqlParameter("@Title", model.Title),
                new SqlParameter("@Money", model.Money),
                new SqlParameter("@StartTime", model.StartTime),
                new SqlParameter("@EndTime", model.EndTime),
                new SqlParameter("@IsEnable", model.IsEnable),
                new SqlParameter("@CouponId", model.CouponId),
                new SqlParameter("@Remark", model.Remark)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parm) > 0);
        }
Пример #4
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public int Update(string orderId, int status)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update BM_Orders set ");
            strSql.Append(" OrderStatus=@OrderStatus,FinishedTime=@FinishedTime");
            strSql.Append(" where orderId=@orderId ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@OrderStatus",  status),
                new SqlParameter("@FinishedTime", DateTime.Now),
                new SqlParameter("@orderId",      orderId)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parameters));
        }
Пример #5
0
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="oldPassword">The old password.</param>
        /// <param name="password">The password.</param>
        /// <returns>true if XXXX, false otherwise.</returns>
        public bool ChanagePassword(int userId, int useridentity, string oldPassword, string password)
        {
            string strSql = "update BM_Manager set LoginPassword=@NewLoginPassword where ID=@ID and LoginPassword=@OldLoginPassword";

            if (useridentity != 0)
            {
                strSql = "update BM_ShopManage set LoginPassword=@NewLoginPassword where ShopID=@ID and LoginPassword=@OldLoginPassword";
            }
            SqlParameter[] param =
            {
                new SqlParameter("@NewLoginPassword", EncryptHelper.MD5(password)),
                new SqlParameter("@ID",               userId),
                new SqlParameter("@OldLoginPassword", EncryptHelper.MD5(oldPassword))
            };
            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }
Пример #6
0
        /// <summary>
        /// 更新焦点广告图
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public bool UpdateFocusPic(FocusPicModel model)
        {
            string strSql = @"update BM_BannerManage set 
                            Title = @Title,PicUrl = @PicUrl,Description = @Description,IsEnable = @IsEnable,Sort = @Sort,LinkUrl = @LinkUrl
                            where ID = @ID";
            var    param  = new[] {
                new SqlParameter("@Title", model.Title),
                new SqlParameter("@PicUrl", model.PicUrl),
                new SqlParameter("@Description", model.Description),
                new SqlParameter("@IsEnable", model.IsEnable),
                new SqlParameter("@Sort", model.Sort),
                new SqlParameter("@LinkUrl", model.LinkUrl),
                new SqlParameter("@ID", model.ID)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }
Пример #7
0
        /// <summary>
        /// Inserts the specified model.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns>System.Int32.</returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public int Insert(AdminLoginModel model)
        {
            string strSql = "insert into BM_Manager(LoginName,LoginPassword,RoleId,UserName,UserMobile,UserEmail,UserStatus,LastLoginTime) values(@LoginName,@LoginPassword,@RoleId,@UserName,@UserMobile,@UserEmail,@UserStatus,@LastLoginTime)";

            SqlParameter[] param =
            {
                new SqlParameter("@LoginName",     model.LoginName),
                new SqlParameter("@LoginPassword", model.LoginPassword),
                new SqlParameter("@RoleId",        model.RoleId),
                new SqlParameter("@UserName",      model.UserName),
                new SqlParameter("@UserMobile",    model.UserMobile),
                new SqlParameter("@UserEmail",     model.UserEmail),
                new SqlParameter("@UserStatus",    model.UserStatus),
                new SqlParameter("@LastLoginTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
            };
            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param));
        }
Пример #8
0
        /// <summary>
        /// 添加门店客户维护提醒时间
        /// </summary>
        /// <param name="shopId"></param>
        /// <param name="tipHours"></param>
        /// <returns></returns>
        public int AddShopTipHours(int shopId, int tipHours)
        {
            string strSql = @"IF EXISTS (SELECT * FROM BM_ShopConfig WHERE ShopId=@ShopId)  
                                            BEGIN
                                                UPDATE BM_ShopConfig set TipHours=@TipHours where ShopId=@ShopId
                                            END
                                            ELSE 
                                            BEGIN
                                                INSERT INTO BM_ShopConfig(TipHours,ShopId) VALUES(@TipHours,@ShopId)
                                            END";
            var    param  = new[] {
                new SqlParameter("@ShopID", shopId),
                new SqlParameter("@TipHours", tipHours)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param));
        }
Пример #9
0
        /// <summary>
        /// 设置资讯发布状态
        /// </summary>
        /// <param name="articleId"></param>
        /// <param name="enable"></param>
        /// <returns></returns>
        public bool SetArticleEnablePublish(int articleId, bool enable)
        {
            string strSql = "update BM_ArticleList set EnablePublish=@EnablePublish";

            if (enable)
            {
                strSql += ",PublishTime=@PublishTime ";
            }

            strSql += " where ArticleId=@ArticleId";

            var param = new[] {
                new SqlParameter("@EnablePublish", enable ? 1 : 0),
                new SqlParameter("@PublishTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                new SqlParameter("@ArticleId", articleId)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }
Пример #10
0
        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateUserInfo(UserRegisterModel model)
        {
            string strSql = "update Hot_UserBaseInfo set UB_UserRealName=@UB_UserRealName,UB_UserNickName=@UB_UserNickName,UB_UserMobile=@UB_UserMobile";

            if (!string.IsNullOrEmpty(model.loginPassword))
            {
                strSql += ",UB_UserLoginPassword =@UB_UserLoginPassword";
            }
            strSql += " where UB_UserID=@UserID";
            var parm = new[] {
                new SqlParameter("@UB_UserRealName", model.username),
                new SqlParameter("@UB_UserNickName", model.nickname),
                new SqlParameter("@UB_UserMobile", model.mobile),
                new SqlParameter("@UB_UserLoginPassword", model.loginPassword),
                new SqlParameter("@UserID", model.UserId),
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parm) > 0);
        }
Пример #11
0
 /// <summary>
 /// 添加客户
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int InsertCustomerInfo(CustomerModel model)
 {
     if (!IsExist(model.Mobile, model.Addr))
     {
         string strSql = "insert into BM_CustomerManage (BelongOne,BelongTwo,Status,Name,Mobile,Addr,Remark,ShopId,InShop) values(@BelongOne,@BelongTwo,@Status,@Name,@Mobile,@Addr,@Remark,@ShopId,@InShop)";
         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)
         };
         return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param));
     }
     return(0);
 }
Пример #12
0
        /// <summary>
        /// 删除消息
        /// </summary>
        /// <param name="messageId">The message identifier.</param>
        /// <param name="shopId">The shop identifier.</param>
        /// <param name="type">The type.</param>
        /// <returns>System.Int32.</returns>
        /// <exception cref="NotImplementedException"></exception>
        public bool DeleteMessageInfo(int messageId, int shopId, int type)
        {
            string strSql = string.Empty;

            if (type == 1)
            {
                strSql = "update BM_MessageManage  set IsDel=1 where  ID=@ID";
            }
            else
            {
                strSql = "delete from BM_MessageSendTarget where MessageId=@ID and SendTargetShopId=@ShopID";
            }


            var parm = new[] {
                new SqlParameter("@ID", messageId),
                new SqlParameter("@ShopID", shopId)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parm) > 0);
        }
Пример #13
0
        /// <summary>
        /// 设置资讯置顶状态
        /// </summary>
        /// <param name="articleId"></param>
        /// <param name="enable"></param>
        /// <returns></returns>
        public bool SetArticleEnableTop(int articleId, bool enable, int useridentity)
        {
            DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, string.Format("update BM_ArticleList set EnableTop=0 where AuthorIdentity={0}", useridentity));

            string strSql = "update BM_ArticleList set EnableTop=@EnableTop";

            if (enable)
            {
                strSql += ",TopTime=@TopTime ";
            }

            strSql += " where ArticleId=@ArticleId";

            var param = new[] {
                new SqlParameter("@EnableTop", enable ? 1 : 0),
                new SqlParameter("@TopTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                new SqlParameter("@ArticleId", articleId)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }
Пример #14
0
        /// <summary>
        /// 修改资讯
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateArticle(ArticleModel model)
        {
            string strSql = @"update BM_ArticleList set SendTargetId=@SendTargetId,SendType=@SendType,ArticleSort=@ArticleSort,ArticleType=@ArticleType,ArticleClassify=@ArticleClassify
                            ,ArticleTitle=@ArticleTitle,ArticleIntro=@ArticleIntro,ArticleCover=@ArticleCover,ArticleBody=@ArticleBody,EnableTop=@EnableTop,EnablePublish=@EnablePublish,ArticleStatus=@ArticleStatus,UpdateTime=@UpdateTime";

            if (model.EnablePublish == 1)
            {
                strSql += ",PublishTime=@PublishTime";
            }

            if (model.EnableTop == 1)
            {
                strSql += ",TopTime=@TopTime";
            }

            strSql += " where ArticleId=@ArticleId";
            var param = new[] {
                new SqlParameter("@SendTargetId", model.SendTargetId),
                new SqlParameter("@SendType", model.SendType),
                new SqlParameter("@ArticleSort", model.ArticleSort),
                new SqlParameter("@ArticleType", model.ArticleType),
                new SqlParameter("@ArticleClassify", model.ArticleClassify),
                new SqlParameter("@ArticleTitle", model.ArticleTitle),
                new SqlParameter("@ArticleIntro", model.ArticleIntro),
                new SqlParameter("@ArticleCover", model.ArticleCover),
                new SqlParameter("@ArticleBody", model.ArticleBody),
                new SqlParameter("@EnableTop", model.EnableTop),
                new SqlParameter("@EnablePublish", model.EnablePublish),
                new SqlParameter("@ArticleStatus", model.ArticleStatus),
                new SqlParameter("@TopTime", model.TopTime),
                new SqlParameter("@PublishTime", model.PublishTime),
                new SqlParameter("@UpdateTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                new SqlParameter("@ArticleId", model.ArticleId)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }
Пример #15
0
        /// <summary>
        /// 更新成交信息
        /// </summary>
        /// <param name="orderId">The order identifier.</param>
        /// <param name="customer">The customer.</param>
        /// <param name="mobile">The mobile.</param>
        /// <param name="price">The price.</param>
        /// <param name="note">The note.</param>
        /// <param name="fileName">Name of the file.</param>
        /// <returns>System.Int32.</returns>
        public int UploadVoucher(string orderId, string customer
                                 , string mobile, decimal price, string note, string fileName, string fileName2, string fileName3, string fileName4, string fileName5)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update BM_Orders set ");
            strSql.Append("Note=@Note,Ct_Mobile=@Ct_Mobile,Ct_Name=@Ct_Name,FianlAmount=@FianlAmount,SuccessImg=@SuccessImg,SuccessImg2=@SuccessImg2,SuccessImg3=@SuccessImg3,SuccessImg4=@SuccessImg4,SuccessImg5=@SuccessImg5");
            strSql.Append(" where orderId=@orderId ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Note",        note),
                new SqlParameter("@SuccessImg",  fileName),
                new SqlParameter("@SuccessImg2", fileName2),
                new SqlParameter("@SuccessImg3", fileName3),
                new SqlParameter("@SuccessImg4", fileName4),
                new SqlParameter("@SuccessImg5", fileName5),
                new SqlParameter("@Ct_Mobile",   mobile),
                new SqlParameter("@Ct_Name",     customer),
                new SqlParameter("@FianlAmount", price),
                new SqlParameter("@orderId",     orderId)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parameters));
        }
Пример #16
0
        /// <summary>
        /// 更新门店信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateShopInfo(ShopModel model)
        {
            string strSql = @"update BM_ShopManage set ShopName=@ShopName,ShopProv=@ShopProv,ShopCity=@ShopCity,ShopArea=@ShopArea,ShopAddress=@ShopAddress,Contacts=@Contacts,ContactWay=@ContactWay";

            if (!string.IsNullOrEmpty(model.LoginPassword))
            {
                strSql += ",LoginPassword=@LoginPassword";
            }

            strSql += " where ShopID=@ShopID";
            var param = new[] {
                new SqlParameter("@ShopName", model.ShopName),
                new SqlParameter("@ShopProv", model.ShopProv),
                new SqlParameter("@ShopCity", model.ShopCity),
                new SqlParameter("@ShopArea", model.ShopArea),
                new SqlParameter("@ShopAddress", model.ShopAddress),
                new SqlParameter("@Contacts", model.Contacts),
                new SqlParameter("@ContactWay", model.ContactWay),
                new SqlParameter("@LoginPassword", EncryptHelper.MD5_8(model.LoginPassword)),
                new SqlParameter("@ShopID", model.ShopID)
            };

            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }
Пример #17
0
        /// <summary>
        /// 更新信息
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns>true if XXXX, false otherwise.</returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public bool Update(AdminLoginModel model)
        {
            string strSql = "update BM_Manager set LoginName=@LoginName,RoleId=@RoleId,UserName=@UserName,UserMobile=@UserMobile,UserEmail=@UserEmail";

            if (!string.IsNullOrEmpty(model.LoginPassword))
            {
                strSql += ",LoginPassword=@LoginPassword ";
            }


            strSql += " where ID=@ID ";

            SqlParameter[] param =
            {
                new SqlParameter("@ID",            model.ID),
                new SqlParameter("@LoginName",     model.LoginName),
                new SqlParameter("@LoginPassword", model.LoginPassword),
                new SqlParameter("@RoleId",        model.RoleId),
                new SqlParameter("@UserName",      model.UserName),
                new SqlParameter("@UserMobile",    model.UserMobile),
                new SqlParameter("@UserEmail",     model.UserEmail)
            };
            return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0);
        }