Exemplo n.º 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(Hownet.Model.SampleMain model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update SampleMain set ");
            strSql.Append("CompanyID=@CompanyID,");
            strSql.Append("BrandID=@BrandID,");
            strSql.Append("Season=@Season,");
            strSql.Append("MTID=@MTID,");
            strSql.Append("Fabric=@Fabric,");
            strSql.Append("MainCloth1=@MainCloth1,");
            strSql.Append("MainCloth2=@MainCloth2,");
            strSql.Append("MinorCloth1=@MinorCloth1,");
            strSql.Append("MinorCloth2=@MinorCloth2,");
            strSql.Append("MainCloth1Remark=@MainCloth1Remark,");
            strSql.Append("MainCloth2Remak=@MainCloth2Remak,");
            strSql.Append("MinorCloth1Remark=@MinorCloth1Remark,");
            strSql.Append("MinorCloth2Remark=@MinorCloth2Remark,");
            strSql.Append("DateTime=@DateTime,");
            strSql.Append("POID=@POID,");
            strSql.Append("CompanyMateriel=@CompanyMateriel,");
            strSql.Append("MaterielID=@MaterielID,");
            strSql.Append("SumAmount=@SumAmount,");
            strSql.Append("BackSampleDate=@BackSampleDate,");
            strSql.Append("AskBackDate=@AskBackDate,");
            strSql.Append("BillingMan=@BillingMan,");
            strSql.Append("Counter=@Counter,");
            strSql.Append("RevisedCounter=@RevisedCounter,");
            strSql.Append("Approval=@Approval,");
            strSql.Append("TextSample=@TextSample,");
            strSql.Append("ShowSample=@ShowSample,");
            strSql.Append("PhotoSample=@PhotoSample,");
            strSql.Append("SizeSet1=@SizeSet1,");
            strSql.Append("SizeSet2=@SizeSet2,");
            strSql.Append("SizeSet3=@SizeSet3,");
            strSql.Append("SalesmanSample=@SalesmanSample,");
            strSql.Append("ProductionSample=@ProductionSample,");
            strSql.Append("ShipmentSample=@ShipmentSample,");
            strSql.Append("UpData=@UpData,");
            strSql.Append("FillMan=@FillMan,");
            strSql.Append("IsVerify=@IsVerify,");
            strSql.Append("VerifyMan=@VerifyMan,");
            strSql.Append("VerifyDate=@VerifyDate,");
            strSql.Append("Remark=@Remark,");
            strSql.Append("Stata=@Stata,");
            strSql.Append("OderMainID=@OderMainID,");
            strSql.Append("LastEdit=@LastEdit,");
            strSql.Append("LastEditDate=@LastEditDate,");
            strSql.Append("EditRemark=@EditRemark,");
            strSql.Append("GenDan=@GenDan,");
            strSql.Append("BanFangGengDan=@BanFangGengDan,");
            strSql.Append("ZhiYang=@ZhiYang,");
            strSql.Append("CheBan=@CheBan,");
            strSql.Append("BanFangZhuGuang=@BanFangZhuGuang,");
            strSql.Append("ShengChanBu=@ShengChanBu,");
            strSql.Append("Size1=@Size1,");
            strSql.Append("Size2=@Size2,");
            strSql.Append("BackAmount=@BackAmount,");
            strSql.Append("HaveOld=@HaveOld,");
            strSql.Append("SizeRefer=@SizeRefer,");
            strSql.Append("TaskRemark=@TaskRemark,");
            strSql.Append("BrandRemark=@BrandRemark,");
            strSql.Append("Images=@Images,");
            strSql.Append("BrandImages=@BrandImages,");
            strSql.Append("DefaultSTID=@DefaultSTID");
            strSql.Append(" where ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID",                SqlDbType.Int,          4),
                new SqlParameter("@CompanyID",         SqlDbType.Int,          4),
                new SqlParameter("@BrandID",           SqlDbType.Int,          4),
                new SqlParameter("@Season",            SqlDbType.NVarChar,    50),
                new SqlParameter("@MTID",              SqlDbType.Int,          4),
                new SqlParameter("@Fabric",            SqlDbType.NVarChar,   200),
                new SqlParameter("@MainCloth1",        SqlDbType.NVarChar,    50),
                new SqlParameter("@MainCloth2",        SqlDbType.NVarChar,    50),
                new SqlParameter("@MinorCloth1",       SqlDbType.NVarChar,    50),
                new SqlParameter("@MinorCloth2",       SqlDbType.NVarChar,    50),
                new SqlParameter("@MainCloth1Remark",  SqlDbType.NVarChar,   200),
                new SqlParameter("@MainCloth2Remak",   SqlDbType.NVarChar,   200),
                new SqlParameter("@MinorCloth1Remark", SqlDbType.NVarChar,   200),
                new SqlParameter("@MinorCloth2Remark", SqlDbType.NVarChar,   200),
                new SqlParameter("@DateTime",          SqlDbType.DateTime),
                new SqlParameter("@POID",              SqlDbType.NVarChar,    50),
                new SqlParameter("@CompanyMateriel",   SqlDbType.NVarChar,    50),
                new SqlParameter("@MaterielID",        SqlDbType.NVarChar,    50),
                new SqlParameter("@SumAmount",         SqlDbType.Int,          4),
                new SqlParameter("@BackSampleDate",    SqlDbType.DateTime),
                new SqlParameter("@AskBackDate",       SqlDbType.DateTime),
                new SqlParameter("@BillingMan",        SqlDbType.NVarChar,    50),
                new SqlParameter("@Counter",           SqlDbType.Bit,          1),
                new SqlParameter("@RevisedCounter",    SqlDbType.Bit,          1),
                new SqlParameter("@Approval",          SqlDbType.Bit,          1),
                new SqlParameter("@TextSample",        SqlDbType.Bit,          1),
                new SqlParameter("@ShowSample",        SqlDbType.Bit,          1),
                new SqlParameter("@PhotoSample",       SqlDbType.Bit,          1),
                new SqlParameter("@SizeSet1",          SqlDbType.Bit,          1),
                new SqlParameter("@SizeSet2",          SqlDbType.Bit,          1),
                new SqlParameter("@SizeSet3",          SqlDbType.Bit,          1),
                new SqlParameter("@SalesmanSample",    SqlDbType.Bit,          1),
                new SqlParameter("@ProductionSample",  SqlDbType.Bit,          1),
                new SqlParameter("@ShipmentSample",    SqlDbType.Bit,          1),
                new SqlParameter("@UpData",            SqlDbType.Int,          4),
                new SqlParameter("@FillMan",           SqlDbType.Int,          4),
                new SqlParameter("@IsVerify",          SqlDbType.Int,          4),
                new SqlParameter("@VerifyMan",         SqlDbType.Int,          4),
                new SqlParameter("@VerifyDate",        SqlDbType.DateTime),
                new SqlParameter("@Remark",            SqlDbType.NVarChar,  2000),
                new SqlParameter("@Stata",             SqlDbType.Int,          4),
                new SqlParameter("@OderMainID",        SqlDbType.Int,          4),
                new SqlParameter("@LastEdit",          SqlDbType.Int,          4),
                new SqlParameter("@LastEditDate",      SqlDbType.DateTime),
                new SqlParameter("@EditRemark",        SqlDbType.NVarChar,  2000),
                new SqlParameter("@GenDan",            SqlDbType.NVarChar,    50),
                new SqlParameter("@BanFangGengDan",    SqlDbType.NVarChar,    50),
                new SqlParameter("@ZhiYang",           SqlDbType.NVarChar,    50),
                new SqlParameter("@CheBan",            SqlDbType.NVarChar,    50),
                new SqlParameter("@BanFangZhuGuang",   SqlDbType.NVarChar,    50),
                new SqlParameter("@ShengChanBu",       SqlDbType.NVarChar,    50),
                new SqlParameter("@Size1",             SqlDbType.NVarChar,    50),
                new SqlParameter("@Size2",             SqlDbType.NVarChar,    50),
                new SqlParameter("@BackAmount",        SqlDbType.NVarChar,    50),
                new SqlParameter("@HaveOld",           SqlDbType.NVarChar,    50),
                new SqlParameter("@SizeRefer",         SqlDbType.NVarChar,    50),
                new SqlParameter("@TaskRemark",        SqlDbType.NVarChar,  2000),
                new SqlParameter("@BrandRemark",       SqlDbType.NVarChar,  2000),
                new SqlParameter("@Images",            SqlDbType.NVarChar,    50),
                new SqlParameter("@BrandImages",       SqlDbType.NVarChar,    50),
                new SqlParameter("@DefaultSTID",       SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.ID;
            parameters[1].Value  = model.CompanyID;
            parameters[2].Value  = model.BrandID;
            parameters[3].Value  = model.Season;
            parameters[4].Value  = model.MTID;
            parameters[5].Value  = model.Fabric;
            parameters[6].Value  = model.MainCloth1;
            parameters[7].Value  = model.MainCloth2;
            parameters[8].Value  = model.MinorCloth1;
            parameters[9].Value  = model.MinorCloth2;
            parameters[10].Value = model.MainCloth1Remark;
            parameters[11].Value = model.MainCloth2Remak;
            parameters[12].Value = model.MinorCloth1Remark;
            parameters[13].Value = model.MinorCloth2Remark;
            parameters[14].Value = model.DateTime;
            parameters[15].Value = model.POID;
            parameters[16].Value = model.CompanyMateriel;
            parameters[17].Value = model.MaterielID;
            parameters[18].Value = model.SumAmount;
            parameters[19].Value = model.BackSampleDate;
            parameters[20].Value = model.AskBackDate;
            parameters[21].Value = model.BillingMan;
            parameters[22].Value = model.Counter;
            parameters[23].Value = model.RevisedCounter;
            parameters[24].Value = model.Approval;
            parameters[25].Value = model.TextSample;
            parameters[26].Value = model.ShowSample;
            parameters[27].Value = model.PhotoSample;
            parameters[28].Value = model.SizeSet1;
            parameters[29].Value = model.SizeSet2;
            parameters[30].Value = model.SizeSet3;
            parameters[31].Value = model.SalesmanSample;
            parameters[32].Value = model.ProductionSample;
            parameters[33].Value = model.ShipmentSample;
            parameters[34].Value = model.UpData;
            parameters[35].Value = model.FillMan;
            parameters[36].Value = model.IsVerify;
            parameters[37].Value = model.VerifyMan;
            parameters[38].Value = model.VerifyDate;
            parameters[39].Value = model.Remark;
            parameters[40].Value = model.Stata;
            parameters[41].Value = model.OderMainID;
            parameters[42].Value = model.LastEdit;
            parameters[43].Value = model.LastEditDate;
            parameters[44].Value = model.EditRemark;
            parameters[45].Value = model.GenDan;
            parameters[46].Value = model.BanFangGengDan;
            parameters[47].Value = model.ZhiYang;
            parameters[48].Value = model.CheBan;
            parameters[49].Value = model.BanFangZhuGuang;
            parameters[50].Value = model.ShengChanBu;
            parameters[51].Value = model.Size1;
            parameters[52].Value = model.Size2;
            parameters[53].Value = model.BackAmount;
            parameters[54].Value = model.HaveOld;
            parameters[55].Value = model.SizeRefer;
            parameters[56].Value = model.TaskRemark;
            parameters[57].Value = model.BrandRemark;
            parameters[58].Value = model.Images;
            parameters[59].Value = model.BrandImages;
            parameters[60].Value = model.DefaultSTID;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }