Exemple #1
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Amend(ShowShop.Model.Accessories.Leaveword model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update yxs_leaveword set ");
     strSql.Append("[type]=@type,");
     strSql.Append("[username]=@username,");
     strSql.Append("[telephone]=@telephone,");
     strSql.Append("[qq]=@qq,");
     strSql.Append("[msn]=@msn,");
     strSql.Append("[email]=@email,");
     strSql.Append("[title]=@title,");
     strSql.Append("[ip]=@ip,");
     strSql.Append("[isreguser]=@isreguser,");
     strSql.Append("[content]=@content,");
     strSql.Append("[adddate]=@adddate,");
     strSql.Append("[isread]=@isread,");
     strSql.Append("[replycontent]=@replycontent,");
     strSql.Append("[isreply]=@isreply,");
     strSql.Append("[replydate]=@replydate,");
     strSql.Append("[isauditing]=@isauditing,");
     strSql.Append("[storeid]=@storeid,");
     strSql.Append("[address]=@address");
     strSql.Append(" where [id]=@id ");
     ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(), paras);
 }
Exemple #2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ShowShop.Model.SystemInfo.MailSetting model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into yxs_MailSetting(");
            strSql.Append("SmtpServerIP,SmtpServerPort,MailId,MailPassword)");
            strSql.Append(" values (");
            strSql.Append("@SmtpServerIP,@SmtpServerPort,@MailId,@MailPassword)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@SmtpServerIP", SqlDbType.VarChar,50),
                    new SqlParameter("@SmtpServerPort", SqlDbType.Int,4),
                    new SqlParameter("@MailId", SqlDbType.VarChar,50),
                    new SqlParameter("@MailPassword", SqlDbType.VarChar,50)};
            parameters[0].Value = model.SmtpServerIP;
            parameters[1].Value = model.SmtpServerPort;
            parameters[2].Value = model.MailId;
            parameters[3].Value = model.MailPassword;

            object obj = ChangeHope.DataBase.SQLServerHelper.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ShowShop.Model.Admin.AdminLoginLog model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into Adminloginlog(");
            strSql.Append("AdminName,PassWord,LogininTime,LoginoutTime,LoginIP,HostComputerName,OperateNote)");
            strSql.Append(" values (");
            strSql.Append("@AdminName,@PassWord,@LogininTime,@LoginoutTime,@LoginIP,@HostComputerName,@OperateNote)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@AdminName", SqlDbType.NVarChar,50),
                    new SqlParameter("@PassWord", SqlDbType.VarChar,50),
                    new SqlParameter("@LogininTime", SqlDbType.DateTime),
                    new SqlParameter("@LoginoutTime", SqlDbType.DateTime),
                    new SqlParameter("@LoginIP", SqlDbType.VarChar,50),
                    new SqlParameter("@HostComputerName", SqlDbType.VarChar,50),
                    new SqlParameter("@OperateNote", SqlDbType.VarChar,4000)};
            parameters[0].Value = model.AdminName;
            parameters[1].Value = model.PassWord;
            parameters[2].Value = model.LoginInTime;
            parameters[3].Value = model.LoginOutTime;
            parameters[4].Value = model.LoginIp;
            parameters[5].Value = model.HostComputerName;
            parameters[6].Value = model.OperateNote;

            object obj = ChangeHope.DataBase.SQLServerHelper.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
Exemple #4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Amend(ShowShop.Model.Accessories.Outofstock model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update yxs_outofstock set ");
     strSql.Append("[proid]=@proid,");
     strSql.Append("[proclassandname]=@proclassandname,");
     strSql.Append("[addtime]=@addtime,");
     strSql.Append("[addip]=@addip,");
     strSql.Append("[username]=@username,");
     strSql.Append("[issreguser]=@issreguser,");
     strSql.Append("[telphone]=@telphone,");
     strSql.Append("[mobile]=@mobile,");
     strSql.Append("[qq]=@qq,");
     strSql.Append("[email]=@email,");
     strSql.Append("[msn]=@msn,");
     strSql.Append("[neednum]=@neednum,");
     strSql.Append("[content]=@content,");
     strSql.Append("[state]=@state,");
     strSql.Append("[isdeal]=@isdeal,");
     strSql.Append("[dealtime]=@dealtime,");
     strSql.Append("[dealremark]=@dealremark");
     strSql.Append(" where id=@id ");
     ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(), paras);
 }
Exemple #5
0
 public int Add(ShowShop.Model.Member.Integral model)
 {
     if (model.IntegralClass != 1)
        {
        model.OrderId = string.Empty;
        }
       return  dal.Add(model);
 }
Exemple #6
0
 public int Add(ShowShop.Model.Product.ScanInfo model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("insert into yxs_scaninfo( ");
     strSql.Append("uid,productId,scanTime) values ( ");
     strSql.Append("@uid,@productId,@scanTime )");
     SqlParameter[] parameters = (SqlParameter[])this.ValueParam(model);
     return ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(),parameters);
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(ShowShop.Model.Member.MemberAccount model)
 {
     StringBuilder strSql=new StringBuilder();
     strSql.Append("insert into yxs_memberaccount(");
     strSql.Append("UserType,UserGroup,UserId,PassWord,Signed,Question,Answer,Email,State,RegisterDate,RegisterIP,LastLoginDate,LastLoginIP,LoginTimes,Capital,Coupons,Points,PeriodOfValidity)");
     strSql.Append(" values (");
     strSql.Append("@UserType,@UserGroup,@UserId,@PassWord,@Signed,@Question,@Answer,@Email,@State,@RegisterDate,@RegisterIP,@LastLoginDate,@LastLoginIP,@LoginTimes,@Capital,@Coupons,@Points,@PeriodOfValidity)");
     strSql.Append(";select @@IDENTITY");
     SqlParameter[] parameters = {
             new SqlParameter("@UserType", SqlDbType.Int,4),
             new SqlParameter("@UserGroup", SqlDbType.Int,4),
             new SqlParameter("@UserId", SqlDbType.VarChar,50),
             new SqlParameter("@PassWord", SqlDbType.VarChar,50),
             new SqlParameter("@Signed", SqlDbType.VarChar,5000),
             new SqlParameter("@Question", SqlDbType.NVarChar,50),
             new SqlParameter("@Answer", SqlDbType.NVarChar,50),
             new SqlParameter("@Email", SqlDbType.VarChar,50),
             new SqlParameter("@State", SqlDbType.Int,4),
             new SqlParameter("@RegisterDate", SqlDbType.DateTime),
             new SqlParameter("@RegisterIP", SqlDbType.VarChar,50),
             new SqlParameter("@LastLoginDate", SqlDbType.DateTime),
             new SqlParameter("@LastLoginIP", SqlDbType.VarChar,50),
             new SqlParameter("@LoginTimes", SqlDbType.Int,4),
             new SqlParameter("@Capital", SqlDbType.Float,8),
             new SqlParameter("@Coupons", SqlDbType.Float,8),
             new SqlParameter("@Points", SqlDbType.Float,8),
             new SqlParameter("@PeriodOfValidity", SqlDbType.DateTime)};
     parameters[0].Value = model.UserType;
     parameters[1].Value = model.UserGroup;
     parameters[2].Value = model.UserId;
     parameters[3].Value = ChangeHope.Common.DEncryptHelper.Encrypt(model.PassWord, 1);
     parameters[4].Value = model.Signed;
     parameters[5].Value = model.Question;
     parameters[6].Value = model.Answer;
     parameters[7].Value = model.Email;
     parameters[8].Value = model.State;
     parameters[9].Value = model.RegisterDate;
     parameters[10].Value = model.RegisterIP;
     parameters[11].Value = model.LastLoginDate;
     parameters[12].Value = model.LastLoginIP;
     parameters[13].Value = model.LoginTimes;
     parameters[14].Value = model.Capital;
     parameters[15].Value = model.Coupons;
     parameters[16].Value = model.Points;
     parameters[17].Value = model.PeriodOfValidity;
     int obj = ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(), parameters);
     if (obj >0)
     {
         return obj;
     }
     else
     {
         return 0;
     }
 }
Exemple #8
0
 public void AddOrUpdate(ShowShop.Model.SystemInfo.WebSetting model)
 {
     if (model.Id > 0)
     {
         Update(model);
     }
     else
     {
         Add(model);
     }
 }
Exemple #9
0
 public int Add(ShowShop.Model.Member.Integral model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("insert into [yxs_integral](");
     strSql.Append("userId,orderid,integralClass,origin,integral,gainDate,noteDate,noteName,remark,integralStatus) ");
     strSql.Append("values(");
     strSql.Append("@userId,@orderid,@integralClass,@origin,@integral,@gainDate,@noteDate,@noteName,@remark,@integralStatus )");
     SqlParameter[] parameters = (SqlParameter[])this.ValueParams(model);
     int count = 0;
     count = ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(),parameters);
     return count;
 }
Exemple #10
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Amend(ShowShop.Model.Order.OrderLeave model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update yxs_orderleave set ");
     strSql.Append("memberid=@memberid,");
     strSql.Append("orderid=@orderid,");
     strSql.Append("content=@content,");
     strSql.Append("createdate=@createdate,");
     strSql.Append("state=@state");
     strSql.Append(" where id=@id ");
     ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(), paras);
 }
Exemple #11
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Amend(ShowShop.Model.Accessories.Collection model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update yxs_collection set ");
     strSql.Append("[collectiontype]=@collectiontype,");
     strSql.Append("[collectionid]=@collectionid,");
     strSql.Append("[collectionname]=@collectionname,");
     strSql.Append("[collectiondate]=@collectiondate,");
     strSql.Append("[collectionuid]=@collectionuid");
     strSql.Append(" where [id]=@id ");
     ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(), paras);
 }
Exemple #12
0
 /// <summary>
 /// 新增数据
 /// </summary>
 /// <remarks></remarks>
 public int Add(ShowShop.Model.Product.ProductBrand model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     string sequel = "Insert into yxs_productbrand (name,sort) Values(@name,@sort) ;select @@IDENTITY ";
     object obj = ChangeHope.DataBase.SQLServerHelper.GetSingle(sequel, paras);
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Exemple #13
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ShowShop.Model.Member.MemberRank model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into yxs_MemberRank(");
            strSql.Append("Name,LogoPic,Discount,MinScore,MaxScore,Priority,IsSpecial,IsShowPrice,Article,Product,ArticleAuditing,ProductAuditing,MaxMoney,UpgradeMoney,IsUpgrade)");
            strSql.Append(" values (");
            strSql.Append("@Name,@LogoPic,@Discount,@MinScore,@MaxScore,@Priority,@IsSpecial,@IsShowPrice,@Article,@Product,@ArticleAuditing,@ProductAuditing,@MaxMoney,@UpgradeMoney,@IsUpgrade)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@Name", SqlDbType.NVarChar,50),
                    new SqlParameter("@LogoPic", SqlDbType.NVarChar,200),
                    new SqlParameter("@Discount", SqlDbType.Float,8),
                    new SqlParameter("@MinScore", SqlDbType.Float,8),
                    new SqlParameter("@MaxScore", SqlDbType.Float,8),
                    new SqlParameter("@Priority", SqlDbType.Int,4),
                    new SqlParameter("@IsSpecial", SqlDbType.Int,4),
                    new SqlParameter("@IsShowPrice", SqlDbType.Int,4),
                    new SqlParameter("@Article", SqlDbType.Int,4),
                    new SqlParameter("@Product", SqlDbType.Int,4),
                    new SqlParameter("@ArticleAuditing", SqlDbType.Int,4),
                    new SqlParameter("@ProductAuditing", SqlDbType.Int,4),
                    new SqlParameter("@MaxMoney", SqlDbType.Float,8),
                    new SqlParameter("@UpgradeMoney", SqlDbType.Float,8),
                    new SqlParameter("@IsUpgrade", SqlDbType.Int,4)};
            parameters[0].Value = model.Name;
            parameters[1].Value = model.LogoPic;
            parameters[2].Value = model.Discount;
            parameters[3].Value = model.MinScore;
            parameters[4].Value = model.MaxScore;
            parameters[5].Value = model.Priority;
            parameters[6].Value = model.IsSpecial;
            parameters[7].Value = model.IsShowPrice;
            parameters[8].Value = model.Article;
            parameters[9].Value = model.Product;
            parameters[10].Value = model.ArticleAuditing;
            parameters[11].Value = model.ProductAuditing;
            parameters[12].Value = model.MaxMoney;
            parameters[13].Value = model.UpgradeMoney;
            parameters[14].Value = model.IsUpgrade;

            object obj = ChangeHope.DataBase.SQLServerHelper.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
Exemple #14
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Amend(ShowShop.Model.Member.MailInfo model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update yxs_mailinfo set ");
     strSql.Append("sender=@sender,");
     strSql.Append("sendtime=@sendtime,");
     strSql.Append("sendip=@sendip,");
     strSql.Append("title=@title,");
     strSql.Append("body=@body,");
     strSql.Append("stat=@stat");
     strSql.Append(" where id=@id ");
     ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(), paras);
 }
 /// <summary>
 /// 将一个持久化对象的修改保存到数据库, 并提供事务支持
 /// </summary>
 /// <remarks></remarks>
 public int Amend(ShowShop.Model.Product.ProductAuction model)
 {
     string sequel = "Update [yxs_productauction] set  ";
     sequel = sequel + "[auctionname] =@auctionname ,[description] =@description ,[productid]=@productid ,[productname] =@productname ,[starttime] =@starttime ,[endtime] =@endtime ,[price] =@price,[pricerange] =@pricerange,[deposit] =@deposit,[putoutid] =@putoutid,[putouttypeid]=@putouttypeid";
     sequel = sequel + UpdateWhereSequel;
     object obj = ChangeHope.DataBase.SQLServerHelper.ExecuteSql(sequel, (SqlParameter[])this.ValueParas(model));
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Exemple #16
0
 /// <summary>
 /// 将一个持久化对象的修改保存到数据库, 并提供事务支持
 /// </summary>
 /// <remarks></remarks>
 public int Amend(ShowShop.Model.Product.ProductBrand model)
 {
     string sequel = "Update [yxs_productbrand] set  ";
     sequel = sequel + "[commontypes] =@commontypes ,[name] =@name ,[image]=@images ,[attirbute] =@attirbute ,[description] =@description ,[sort] =@sort ,[isrecommend] =@isrecommend";
     sequel = sequel + UpdateWhereSequel;
     object obj = ChangeHope.DataBase.SQLServerHelper.ExecuteSql(sequel, (SqlParameter[])this.ValueParas(model));
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Exemple #17
0
 /// <summary>
 /// 将一个持久化对象的修改保存到数据库, 并提供事务支持
 /// </summary>
 /// <remarks></remarks>
 public int Amend(ShowShop.Model.Product.ProductAlbum model)
 {
     string sequel = "Update [yxs_productalbum] set  ";
     sequel = sequel + "[productid] =@productid ,[thumbnailaddress] =@thumbnailaddress ,[originaladdress]=@originaladdress ,[descriptoin] =@descriptoin";
     sequel = sequel + UpdateWhereSequel;
     object obj = ChangeHope.DataBase.SQLServerHelper.ExecuteSql(sequel, (SqlParameter[])this.ValueParas(model));
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Exemple #18
0
 /// <summary>
 /// 将一个持久化对象的修改保存到数据库, 并提供事务支持
 /// </summary>
 /// <remarks></remarks>
 public int Amend(ShowShop.Model.Member.Role model)
 {
     string sequel = "Update [yxs_role] set ";
     sequel = sequel + "[name] =@Name , [description] =@Description";
     sequel = sequel + UpdateWhereSequel;
     object obj = ChangeHope.DataBase.SQLServerHelper.ExecuteSql(sequel, (SqlParameter[])this.ValueParas(model));
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Exemple #19
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Amend(ShowShop.Model.Product.Express model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update yxs_express set ");
     strSql.Append("name=@name,");
     strSql.Append("fullname=@fullname,");
     strSql.Append("address=@address,");
     strSql.Append("phone=@phone,");
     strSql.Append("person=@person,");
     strSql.Append("numstr=@numstr,");
     strSql.Append("sort=@sort");
     strSql.Append(" where id=@id ");
     ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(), paras);
 }
Exemple #20
0
        public IDbDataParameter[] ValueParam(ShowShop.Model.Product.ScanInfo model)
        {
            SqlParameter[] parameters ={
                                           new SqlParameter("@id",SqlDbType.Int,4),
                                           new SqlParameter("@uid",SqlDbType.Int,4),
                                           new SqlParameter("@productId",SqlDbType.Int,4),
                                           new SqlParameter("@scanTime",SqlDbType.DateTime,8)
                                      };
            parameters[0].Value = model.Id;
            parameters[1].Value = model.Uid;
            parameters[2].Value = model.ProductId;
            parameters[3].Value = model.ScanTime;

            return parameters;
        }
Exemple #21
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Amend(ShowShop.Model.Order.PrepayMoney model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update yxs_prepaymoney set ");
     strSql.Append("orderid=@orderid,");
     strSql.Append("username=@username,");
     strSql.Append("payoutmoney=@payoutmoney,");
     strSql.Append("remark=@remark,");
     strSql.Append("bosomnote=@bosomnote,");
     strSql.Append("notedate=@notedate,");
     strSql.Append("notename=@notename");
     strSql.Append(" where id=@id ");
     ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(), paras);
 }
Exemple #22
0
 /// <summary>
 /// 将一个持久化对象的修改保存到数据库, 并提供事务支持
 /// </summary>
 /// <remarks></remarks>
 public int Amend(ShowShop.Model.OrderCard.OrderCardInfo model)
 {
     string sequel = "Update [yxs_ordercard] set  ";
     sequel = sequel + "[productid] =@productid ,[iswebsitersale] =@iswebsitersale ,[type]=@type ,[cardnumber] =@cardnumber ,[password] =@password ,[facevalue] =@facevalue ,[point] =@point,[unit] =@unit,[expirationdate] =@expirationdate,[businessagent] =@businessagent,[createdate] =@createdate,[appearance] =@appearance,[price] =@price,[whetherRelease] =@whetherRelease,[updatedate] =@updatedate,[username] =@username,[fullmoneydate] =@fullmoneydate";
     sequel = sequel + UpdateWhereSequel;
     object obj = ChangeHope.DataBase.SQLServerHelper.ExecuteSql(sequel, (SqlParameter[])this.ValueParas(model));
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Exemple #23
0
 /// <summary>
 /// 将一个持久化对象的修改保存到数据库, 并提供事务支持
 /// </summary>
 /// <remarks></remarks>
 public int Amend(ShowShop.Model.Accessories.Top_Searches model)
 {
     string sequel = "Update [yxs_topsearches] set  ";
     sequel = sequel + "[name] =@name ,[isshow]=@isshow,[sort] =@sort";
     sequel = sequel + UpdateWhereSequel;
     object obj = ChangeHope.DataBase.SQLServerHelper.ExecuteSql(sequel, (SqlParameter[])this.ValueParas(model));
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Exemple #24
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public void Amend(ShowShop.Model.Member.Message model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update yxs_message set ");
     strSql.Append("[uid]=@uid,");
     strSql.Append("[userid]=@userid,");
     strSql.Append("[title]=@title,");
     strSql.Append("[content]=@content,");
     strSql.Append("[adminid]=@adminid,");
     strSql.Append("[sendtime]=@sendtime,");
     strSql.Append("[state]=@state,");
     strSql.Append("[isread]=@isread");
     strSql.Append(" where [id]=@id ");
     ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(), paras);
 }
Exemple #25
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Amend(ShowShop.Model.Member.MailReceiver model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update yxs_mailreceiver set ");
     strSql.Append("receiverid=@receiverid,");
     strSql.Append("receiver=@receiver,");
     strSql.Append("receiveTime=@receiveTime,");
     strSql.Append("stat=@stat,");
     strSql.Append("isread=@isread");
     strSql.Append("title=@title");
     strSql.Append("body=@body");
     strSql.Append("sender=@sender");
     strSql.Append(" where id=@id ");
     ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(), paras);
 }
Exemple #26
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(ShowShop.Model.Order.OrderProduct model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("insert into " + tableName + "(");
     strSql.Append("OrderId,ProId,ProClass,ProName,ProImg,ProPrice,ProNum,AddTime,ProOtherPara,Specification,FittingsProductId,FittingsProductCount,FittingsProductPrice,FittingsId)");
     strSql.Append(" values (");
     strSql.Append("@OrderId,@ProId,@ProClass,@ProName,@ProImg,@ProPrice,@ProNum,@AddTime,@ProOtherPara,@Specification,@FittingsProductId,@FittingsProductCount,@FittingsProductPrice,@FittingsId)");
     strSql.Append(";select @@IDENTITY");
     SqlParameter[] parameters = {
             new SqlParameter("@OrderId", SqlDbType.Int,4),
             new SqlParameter("@ProId", SqlDbType.Int,4),
             new SqlParameter("@ProClass", SqlDbType.VarChar,50),
             new SqlParameter("@ProName", SqlDbType.VarChar,500),
             new SqlParameter("@ProImg", SqlDbType.VarChar,500),
             new SqlParameter("@ProPrice", SqlDbType.Float,8),
             new SqlParameter("@ProNum", SqlDbType.Float,8),
             new SqlParameter("@AddTime", SqlDbType.DateTime),
             new SqlParameter("@ProOtherPara", SqlDbType.VarChar,500),
     new SqlParameter("@Specification", SqlDbType.VarChar,500),
             new SqlParameter("@FittingsProductId", SqlDbType.VarChar,200),
             new SqlParameter("@FittingsProductCount", SqlDbType.VarChar,200),
                                 new SqlParameter("@FittingsProductPrice",SqlDbType.VarChar,200),
                                 new SqlParameter("@FittingsId",SqlDbType.Int)};
     parameters[0].Value = model.OrderId;
     parameters[1].Value = model.ProId;
     parameters[2].Value = model.ProClass;
     parameters[3].Value = model.ProName;
     parameters[4].Value = model.ProImg;
     parameters[5].Value = model.ProPrice;
     parameters[6].Value = model.ProNum;
     parameters[7].Value = model.AddTime;
     parameters[8].Value = model.ProOtherPara;
     parameters[9].Value = model.Specification;
     parameters[10].Value = model.FittingsProductId;
     parameters[11].Value = model.FittingsProductCount;
     parameters[12].Value = model.FittingsProductPrice;
     parameters[13].Value = model.FittingsId;
     object obj = SQLServerHelper.GetSingle(strSql.ToString(), parameters);
     if (obj == null)
     {
         return 1;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Exemple #27
0
 /// <summary>
 /// 在数据库中新增一个持久化对象,自增长列Prop_ID的值会自动从数据库中返回
 /// </summary>
 /// <remarks></remarks>
 public int Add(ShowShop.Model.SystemInfo.Navigation model)
 {
     SqlParameter[] paras = (SqlParameter[])this.VauleParas(model);
     string sequel = "Insert into " + Pre + "navigation(";
     sequel = sequel + "[contentregion],[filed], [link], [type], [sort], [isshow],[isnewwindow],[part])";
     sequel = sequel + "Values(";
     sequel = sequel + "@contentregion,@filed,@link,@type,@sort,@isshow,@isnewwindow,@part) Select scope_IDENTITY() ";
     object obj = ChangeHope.DataBase.SQLServerHelper.ExecuteSql(sequel, paras);
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Exemple #28
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Amend(ShowShop.Model.Order.OrderTransfer model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update yxs_ordertransfer set ");
     strSql.Append("orderid=@orderid,");
     strSql.Append("username=@username,");
     strSql.Append("transfername=@transfername,");
     strSql.Append("poundage=@poundage,");
     strSql.Append("poundagepaymentperson=@poundagepaymentperson,");
     strSql.Append("remark=@remark,");
     strSql.Append("notedate=@notedate,");
     strSql.Append("notename=@notename,");
     strSql.Append("uptime=@uptime");
     strSql.Append(" where id=@id ");
     ChangeHope.DataBase.SQLServerHelper.ExecuteSql(strSql.ToString(), paras);
 }
Exemple #29
0
 /// <summary>
 /// 新增数据
 /// </summary>
 /// <remarks></remarks>
 public int Add(ShowShop.Model.Product.ProductAlbum model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     string sequel = "Insert into [yxs_productalbum](";
     sequel = sequel + "[productid], [thumbnailaddress], [originaladdress], [descriptoin])";
     sequel = sequel + "Values(";
     sequel = sequel + "@productid, @thumbnailaddress,@originaladdress,@descriptoin) Select scope_IDENTITY() ";
     object obj = ChangeHope.DataBase.SQLServerHelper.GetSingle(sequel, paras);
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
Exemple #30
0
 /// <summary>
 /// 新增数据
 /// </summary>
 /// <remarks></remarks>
 public int Add(ShowShop.Model.Product.Productclass model)
 {
     SqlParameter[] paras = (SqlParameter[])this.ValueParas(model);
     string sequel = "Insert into [yxs_productclass](";
     sequel = sequel + "[fatherid], [name], [sort], [description], [parentpath])";
     sequel = sequel + "Values(";
     sequel = sequel + "@fatherid, @name,@sort,@description,@parentpath) Select scope_IDENTITY() ";
     object obj = ChangeHope.DataBase.SQLServerHelper.ExecuteSql(sequel, paras);
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }