Exemple #1
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(OriginalCLPEntity model)
 {
     return(dal.Update(model));
 }
Exemple #2
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(OriginalCLPEntity model)
 {
     return(dal.Add(model));
 }
Exemple #3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <OriginalCLPEntity> DataTableToList(DataTable dt)
        {
            List <OriginalCLPEntity> modelList = new List <OriginalCLPEntity>( );
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                OriginalCLPEntity model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new OriginalCLPEntity( );
                    if (dt.Rows[n]["CLPID"] != null && dt.Rows[n]["CLPID"].ToString( ) != "")
                    {
                        model.CLPID = int.Parse(dt.Rows[n]["CLPID"].ToString( ));
                    }
                    if (dt.Rows[n]["ItemCode"] != null && dt.Rows[n]["ItemCode"].ToString( ) != "")
                    {
                        model.ItemCode = dt.Rows[n]["ItemCode"].ToString( );
                    }
                    if (dt.Rows[n]["ShippingNumber"] != null && dt.Rows[n]["ShippingNumber"].ToString( ) != "")
                    {
                        model.ShippingNumber = dt.Rows[n]["ShippingNumber"].ToString( );
                    }
                    if (dt.Rows[n]["OrderNumber"] != null && dt.Rows[n]["OrderNumber"].ToString( ) != "")
                    {
                        model.OrderNumber = dt.Rows[n]["OrderNumber"].ToString( );
                    }
                    if (dt.Rows[n]["OriginalPONumber"] != null && dt.Rows[n]["OriginalPONumber"].ToString( ) != "")
                    {
                        model.OriginalPONumber = dt.Rows[n]["OriginalPONumber"].ToString( );
                    }
                    if (dt.Rows[n]["PalletNumber"] != null && dt.Rows[n]["PalletNumber"].ToString( ) != "")
                    {
                        model.PalletNumber = dt.Rows[n]["PalletNumber"].ToString( );
                    }
                    if (dt.Rows[n]["ParcelNumber"] != null && dt.Rows[n]["ParcelNumber"].ToString( ) != "")
                    {
                        model.ParcelNumber = dt.Rows[n]["ParcelNumber"].ToString( );
                    }
                    if (dt.Rows[n]["ModelCode"] != null && dt.Rows[n]["ModelCode"].ToString( ) != "")
                    {
                        model.ModelCode = dt.Rows[n]["ModelCode"].ToString( );
                    }
                    if (dt.Rows[n]["Origin"] != null && dt.Rows[n]["Origin"].ToString( ) != "")
                    {
                        model.Origin = dt.Rows[n]["Origin"].ToString( );
                    }
                    if (dt.Rows[n]["Quantity"] != null && dt.Rows[n]["Quantity"].ToString( ) != "")
                    {
                        model.Quantity = dt.Rows[n]["Quantity"].ToString( );
                    }
                    if (dt.Rows[n]["QuantityUnit"] != null && dt.Rows[n]["QuantityUnit"].ToString( ) != "")
                    {
                        model.QuantityUnit = dt.Rows[n]["QuantityUnit"].ToString( );
                    }
                    if (dt.Rows[n]["DispatchingKey"] != null && dt.Rows[n]["DispatchingKey"].ToString( ) != "")
                    {
                        model.DispatchingKey = dt.Rows[n]["DispatchingKey"].ToString( );
                    }
                    if (dt.Rows[n]["EnglishComposition"] != null && dt.Rows[n]["EnglishComposition"].ToString( ) != "")
                    {
                        model.EnglishComposition = dt.Rows[n]["EnglishComposition"].ToString( );
                    }
                    if (dt.Rows[n]["LocalComposition"] != null && dt.Rows[n]["LocalComposition"].ToString( ) != "")
                    {
                        model.LocalComposition = dt.Rows[n]["LocalComposition"].ToString( );
                    }
                    if (dt.Rows[n]["Size"] != null && dt.Rows[n]["Size"].ToString( ) != "")
                    {
                        model.Size = dt.Rows[n]["Size"].ToString( );
                    }
                    if (dt.Rows[n]["EnglishDescription"] != null && dt.Rows[n]["EnglishDescription"].ToString( ) != "")
                    {
                        model.EnglishDescription = dt.Rows[n]["EnglishDescription"].ToString( );
                    }
                    if (dt.Rows[n]["LocalDescription"] != null && dt.Rows[n]["LocalDescription"].ToString( ) != "")
                    {
                        model.LocalDescription = dt.Rows[n]["LocalDescription"].ToString( );
                    }
                    if (dt.Rows[n]["Brand"] != null && dt.Rows[n]["Brand"].ToString( ) != "")
                    {
                        model.Brand = dt.Rows[n]["Brand"].ToString( );
                    }
                    if (dt.Rows[n]["TypeOfGoods"] != null && dt.Rows[n]["TypeOfGoods"].ToString( ) != "")
                    {
                        model.TypeOfGoods = dt.Rows[n]["TypeOfGoods"].ToString( );
                    }
                    if (dt.Rows[n]["Price"] != null && dt.Rows[n]["Price"].ToString( ) != "")
                    {
                        model.Price = dt.Rows[n]["Price"].ToString( );
                    }
                    if (dt.Rows[n]["Currency"] != null && dt.Rows[n]["Currency"].ToString( ) != "")
                    {
                        model.Currency = dt.Rows[n]["Currency"].ToString( );
                    }
                    if (dt.Rows[n]["HSCode"] != null && dt.Rows[n]["HSCode"].ToString( ) != "")
                    {
                        model.HSCode = dt.Rows[n]["HSCode"].ToString( );
                    }
                    if (dt.Rows[n]["TotalValue"] != null && dt.Rows[n]["TotalValue"].ToString( ) != "")
                    {
                        model.TotalValue = dt.Rows[n]["TotalValue"].ToString( );
                    }
                    if (dt.Rows[n]["Unit"] != null && dt.Rows[n]["Unit"].ToString( ) != "")
                    {
                        model.Unit = dt.Rows[n]["Unit"].ToString( );
                    }
                    if (dt.Rows[n]["NETWeight"] != null && dt.Rows[n]["NETWeight"].ToString( ) != "")
                    {
                        model.NETWeight = dt.Rows[n]["NETWeight"].ToString( );
                    }
                    if (dt.Rows[n]["GrossWeight"] != null && dt.Rows[n]["GrossWeight"].ToString( ) != "")
                    {
                        model.GrossWeight = dt.Rows[n]["GrossWeight"].ToString( );
                    }
                    if (dt.Rows[n]["CommercialInvoiceNO"] != null && dt.Rows[n]["CommercialInvoiceNO"].ToString( ) != "")
                    {
                        model.CommercialInvoiceNO = dt.Rows[n]["CommercialInvoiceNO"].ToString( );
                    }
                    if (dt.Rows[n]["StoreNO"] != null && dt.Rows[n]["StoreNO"].ToString( ) != "")
                    {
                        model.StoreNO = dt.Rows[n]["StoreNO"].ToString( );
                    }
                    if (dt.Rows[n]["StoreName"] != null && dt.Rows[n]["StoreName"].ToString( ) != "")
                    {
                        model.StoreName = dt.Rows[n]["StoreName"].ToString( );
                    }
                    if (dt.Rows[n]["FileName"] != null && dt.Rows[n]["FileName"].ToString( ) != "")
                    {
                        model.FileName = dt.Rows[n]["FileName"].ToString( );
                    }
                    if (dt.Rows[n]["CreateTime"] != null && dt.Rows[n]["CreateTime"].ToString( ) != "")
                    {
                        model.CreateTime = DateTime.Parse(dt.Rows[n]["CreateTime"].ToString( ));
                    }
                    if (dt.Rows[n]["Creator"] != null && dt.Rows[n]["Creator"].ToString( ) != "")
                    {
                        model.Creator = dt.Rows[n]["Creator"].ToString( );
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public OriginalCLPEntity GetModel(int CLPID)
        {
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("select  top 1 CLPID,ItemCode,ShippingNumber,OrderNumber,OriginalPONumber,PalletNumber,ParcelNumber,ModelCode,Origin,Quantity,QuantityUnit,DispatchingKey,EnglishComposition,LocalComposition,Size,EnglishDescription,LocalDescription,Brand,TypeOfGoods,Price,Currency,HSCode,TotalValue,Unit,NETWeight,GrossWeight,CommercialInvoiceNO,StoreNO,StoreName,FileName,CreateTime,Creator from T_OriginalCLP ");
            strSql.Append(" where CLPID=@CLPID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@CLPID", SqlDbType.Int, 4)
            };
            parameters[0].Value = CLPID;

            OriginalCLPEntity model = new OriginalCLPEntity( );
            DataSet           ds    = SqlHelper.Query(SqlHelper.LocalSqlServer, strSql.ToString( ), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["CLPID"] != null && ds.Tables[0].Rows[0]["CLPID"].ToString( ) != "")
                {
                    model.CLPID = int.Parse(ds.Tables[0].Rows[0]["CLPID"].ToString( ));
                }
                if (ds.Tables[0].Rows[0]["ItemCode"] != null && ds.Tables[0].Rows[0]["ItemCode"].ToString( ) != "")
                {
                    model.ItemCode = ds.Tables[0].Rows[0]["ItemCode"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["ShippingNumber"] != null && ds.Tables[0].Rows[0]["ShippingNumber"].ToString( ) != "")
                {
                    model.ShippingNumber = ds.Tables[0].Rows[0]["ShippingNumber"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["OrderNumber"] != null && ds.Tables[0].Rows[0]["OrderNumber"].ToString( ) != "")
                {
                    model.OrderNumber = ds.Tables[0].Rows[0]["OrderNumber"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["OriginalPONumber"] != null && ds.Tables[0].Rows[0]["OriginalPONumber"].ToString( ) != "")
                {
                    model.OriginalPONumber = ds.Tables[0].Rows[0]["OriginalPONumber"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["PalletNumber"] != null && ds.Tables[0].Rows[0]["PalletNumber"].ToString( ) != "")
                {
                    model.PalletNumber = ds.Tables[0].Rows[0]["PalletNumber"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["ParcelNumber"] != null && ds.Tables[0].Rows[0]["ParcelNumber"].ToString( ) != "")
                {
                    model.ParcelNumber = ds.Tables[0].Rows[0]["ParcelNumber"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["ModelCode"] != null && ds.Tables[0].Rows[0]["ModelCode"].ToString( ) != "")
                {
                    model.ModelCode = ds.Tables[0].Rows[0]["ModelCode"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["Origin"] != null && ds.Tables[0].Rows[0]["Origin"].ToString( ) != "")
                {
                    model.Origin = ds.Tables[0].Rows[0]["Origin"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["Quantity"] != null && ds.Tables[0].Rows[0]["Quantity"].ToString( ) != "")
                {
                    model.Quantity = ds.Tables[0].Rows[0]["Quantity"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["QuantityUnit"] != null && ds.Tables[0].Rows[0]["QuantityUnit"].ToString( ) != "")
                {
                    model.QuantityUnit = ds.Tables[0].Rows[0]["QuantityUnit"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["DispatchingKey"] != null && ds.Tables[0].Rows[0]["DispatchingKey"].ToString( ) != "")
                {
                    model.DispatchingKey = ds.Tables[0].Rows[0]["DispatchingKey"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["EnglishComposition"] != null && ds.Tables[0].Rows[0]["EnglishComposition"].ToString( ) != "")
                {
                    model.EnglishComposition = ds.Tables[0].Rows[0]["EnglishComposition"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["LocalComposition"] != null && ds.Tables[0].Rows[0]["LocalComposition"].ToString( ) != "")
                {
                    model.LocalComposition = ds.Tables[0].Rows[0]["LocalComposition"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["Size"] != null && ds.Tables[0].Rows[0]["Size"].ToString( ) != "")
                {
                    model.Size = ds.Tables[0].Rows[0]["Size"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["EnglishDescription"] != null && ds.Tables[0].Rows[0]["EnglishDescription"].ToString( ) != "")
                {
                    model.EnglishDescription = ds.Tables[0].Rows[0]["EnglishDescription"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["LocalDescription"] != null && ds.Tables[0].Rows[0]["LocalDescription"].ToString( ) != "")
                {
                    model.LocalDescription = ds.Tables[0].Rows[0]["LocalDescription"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["Brand"] != null && ds.Tables[0].Rows[0]["Brand"].ToString( ) != "")
                {
                    model.Brand = ds.Tables[0].Rows[0]["Brand"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["TypeOfGoods"] != null && ds.Tables[0].Rows[0]["TypeOfGoods"].ToString( ) != "")
                {
                    model.TypeOfGoods = ds.Tables[0].Rows[0]["TypeOfGoods"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["Price"] != null && ds.Tables[0].Rows[0]["Price"].ToString( ) != "")
                {
                    model.Price = ds.Tables[0].Rows[0]["Price"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["Currency"] != null && ds.Tables[0].Rows[0]["Currency"].ToString( ) != "")
                {
                    model.Currency = ds.Tables[0].Rows[0]["Currency"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["HSCode"] != null && ds.Tables[0].Rows[0]["HSCode"].ToString( ) != "")
                {
                    model.HSCode = ds.Tables[0].Rows[0]["HSCode"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["TotalValue"] != null && ds.Tables[0].Rows[0]["TotalValue"].ToString( ) != "")
                {
                    model.TotalValue = ds.Tables[0].Rows[0]["TotalValue"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["Unit"] != null && ds.Tables[0].Rows[0]["Unit"].ToString( ) != "")
                {
                    model.Unit = ds.Tables[0].Rows[0]["Unit"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["NETWeight"] != null && ds.Tables[0].Rows[0]["NETWeight"].ToString( ) != "")
                {
                    model.NETWeight = ds.Tables[0].Rows[0]["NETWeight"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["GrossWeight"] != null && ds.Tables[0].Rows[0]["GrossWeight"].ToString( ) != "")
                {
                    model.GrossWeight = ds.Tables[0].Rows[0]["GrossWeight"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["CommercialInvoiceNO"] != null && ds.Tables[0].Rows[0]["CommercialInvoiceNO"].ToString( ) != "")
                {
                    model.CommercialInvoiceNO = ds.Tables[0].Rows[0]["CommercialInvoiceNO"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["StoreNO"] != null && ds.Tables[0].Rows[0]["StoreNO"].ToString( ) != "")
                {
                    model.StoreNO = ds.Tables[0].Rows[0]["StoreNO"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["StoreName"] != null && ds.Tables[0].Rows[0]["StoreName"].ToString( ) != "")
                {
                    model.StoreName = ds.Tables[0].Rows[0]["StoreName"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["FileName"] != null && ds.Tables[0].Rows[0]["FileName"].ToString( ) != "")
                {
                    model.FileName = ds.Tables[0].Rows[0]["FileName"].ToString( );
                }
                if (ds.Tables[0].Rows[0]["CreateTime"] != null && ds.Tables[0].Rows[0]["CreateTime"].ToString( ) != "")
                {
                    model.CreateTime = DateTime.Parse(ds.Tables[0].Rows[0]["CreateTime"].ToString( ));
                }
                if (ds.Tables[0].Rows[0]["Creator"] != null && ds.Tables[0].Rows[0]["Creator"].ToString( ) != "")
                {
                    model.Creator = ds.Tables[0].Rows[0]["Creator"].ToString( );
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemple #5
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(OriginalCLPEntity model)
        {
            //StringBuilder strSql=new StringBuilder( );
            //strSql.Append( "insert into T_OriginalCLP(" );
            //strSql.Append( "CLPID,ItemCode,ShippingNumber,OrderNumber,OriginalPONumber,PalletNumber,ParcelNumber,ModelCode,Origin,Quantity,QuantityUnit,DispatchingKey,EnglishComposition,LocalComposition,Size,EnglishDescription,LocalDescription,Brand,TypeOfGoods,Price,Currency,HSCode,TotalValue,Unit,NETWeight,GrossWeight,CommercialInvoiceNO,StoreNO,StoreName,FileName,CreateTime,Creator)" );
            //strSql.Append( " values (" );
            //strSql.Append( "@CLPID,@ItemCode,@ShippingNumber,@OrderNumber,@OriginalPONumber,@PalletNumber,@ParcelNumber,@ModelCode,@Origin,@Quantity,@QuantityUnit,@DispatchingKey,@EnglishComposition,@LocalComposition,@Size,@EnglishDescription,@LocalDescription,@Brand,@TypeOfGoods,@Price,@Currency,@HSCode,@TotalValue,@Unit,@NETWeight,@GrossWeight,@CommercialInvoiceNO,@StoreNO,@StoreName,@FileName,@CreateTime,@Creator)" );
            //SqlParameter[] parameters = {
            //        new SqlParameter("@CLPID", SqlDbType.Int,4),
            //        new SqlParameter("@ItemCode", SqlDbType.VarChar,50),
            //        new SqlParameter("@ShippingNumber", SqlDbType.VarChar,50),
            //        new SqlParameter("@OrderNumber", SqlDbType.VarChar,50),
            //        new SqlParameter("@OriginalPONumber", SqlDbType.VarChar,20),
            //        new SqlParameter("@PalletNumber", SqlDbType.VarChar,50),
            //        new SqlParameter("@ParcelNumber", SqlDbType.VarChar,50),
            //        new SqlParameter("@ModelCode", SqlDbType.VarChar,50),
            //        new SqlParameter("@Origin", SqlDbType.VarChar,20),
            //        new SqlParameter("@Quantity", SqlDbType.VarChar,50),
            //        new SqlParameter("@QuantityUnit", SqlDbType.VarChar,50),
            //        new SqlParameter("@DispatchingKey", SqlDbType.VarChar,50),
            //        new SqlParameter("@EnglishComposition", SqlDbType.VarChar,50),
            //        new SqlParameter("@LocalComposition", SqlDbType.VarChar,50),
            //        new SqlParameter("@Size", SqlDbType.VarChar,50),
            //        new SqlParameter("@EnglishDescription", SqlDbType.VarChar,50),
            //        new SqlParameter("@LocalDescription", SqlDbType.VarChar,50),
            //        new SqlParameter("@Brand", SqlDbType.VarChar,50),
            //        new SqlParameter("@TypeOfGoods", SqlDbType.VarChar,50),
            //        new SqlParameter("@Price", SqlDbType.VarChar,50),
            //        new SqlParameter("@Currency", SqlDbType.VarChar,20),
            //        new SqlParameter("@HSCode", SqlDbType.VarChar,20),
            //        new SqlParameter("@TotalValue", SqlDbType.VarChar,50),
            //        new SqlParameter("@Unit", SqlDbType.VarChar,20),
            //        new SqlParameter("@NETWeight", SqlDbType.VarChar,50),
            //        new SqlParameter("@GrossWeight", SqlDbType.VarChar,50),
            //        new SqlParameter("@CommercialInvoiceNO", SqlDbType.VarChar,20),
            //        new SqlParameter("@StoreNO", SqlDbType.VarChar,20),
            //        new SqlParameter("@StoreName", SqlDbType.VarChar,50),
            //        new SqlParameter("@FileName", SqlDbType.VarChar,50),
            //        new SqlParameter("@CreateTime", SqlDbType.SmallDateTime),
            //        new SqlParameter("@Creator", SqlDbType.VarChar,20)};
            //parameters[0].Value = GetMaxId()+1;
            //parameters[1].Value = model.ItemCode;
            //parameters[2].Value = model.ShippingNumber;
            //parameters[3].Value = model.OrderNumber;
            //parameters[4].Value = model.OriginalPONumber;
            //parameters[5].Value = model.PalletNumber;
            //parameters[6].Value = model.ParcelNumber;
            //parameters[7].Value = model.ModelCode;
            //parameters[8].Value = model.Origin;
            //parameters[9].Value = model.Quantity;
            //parameters[10].Value = model.QuantityUnit;
            //parameters[11].Value = model.DispatchingKey;
            //parameters[12].Value = model.EnglishComposition;
            //parameters[13].Value = model.LocalComposition;
            //parameters[14].Value = model.Size;
            //parameters[15].Value = model.EnglishDescription;
            //parameters[16].Value = model.LocalDescription;
            //parameters[17].Value = model.Brand;
            //parameters[18].Value = model.TypeOfGoods;
            //parameters[19].Value = model.Price;
            //parameters[20].Value = model.Currency;
            //parameters[21].Value = model.HSCode;
            //parameters[22].Value = model.TotalValue;
            //parameters[23].Value = model.Unit;
            //parameters[24].Value = model.NETWeight;
            //parameters[25].Value = model.GrossWeight;
            //parameters[26].Value = model.CommercialInvoiceNO;
            //parameters[27].Value = model.StoreNO;
            //parameters[28].Value = model.StoreName;
            //parameters[29].Value = model.FileName;
            //parameters[30].Value = model.CreateTime;
            //parameters[31].Value = model.Creator;
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("insert into T_OriginalCLP(");
            strSql.Append("ItemCode,ShippingNumber,OrderNumber,OriginalPONumber,PalletNumber,ParcelNumber,ModelCode,Origin,Quantity,QuantityUnit,DispatchingKey,EnglishComposition,LocalComposition,Size,EnglishDescription,LocalDescription,Brand,TypeOfGoods,Price,Currency,HSCode,TotalValue,Unit,NETWeight,GrossWeight,CommercialInvoiceNO,StoreNO,StoreName,FileName,CreateTime,Creator)");
            strSql.Append(" values (");
            strSql.Append("@ItemCode,@ShippingNumber,@OrderNumber,@OriginalPONumber,@PalletNumber,@ParcelNumber,@ModelCode,@Origin,@Quantity,@QuantityUnit,@DispatchingKey,@EnglishComposition,@LocalComposition,@Size,@EnglishDescription,@LocalDescription,@Brand,@TypeOfGoods,@Price,@Currency,@HSCode,@TotalValue,@Unit,@NETWeight,@GrossWeight,@CommercialInvoiceNO,@StoreNO,@StoreName,@FileName,@CreateTime,@Creator)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ItemCode",            SqlDbType.VarChar,          50),
                new SqlParameter("@ShippingNumber",      SqlDbType.VarChar,          50),
                new SqlParameter("@OrderNumber",         SqlDbType.VarChar,          50),
                new SqlParameter("@OriginalPONumber",    SqlDbType.VarChar,          20),
                new SqlParameter("@PalletNumber",        SqlDbType.VarChar,          50),
                new SqlParameter("@ParcelNumber",        SqlDbType.VarChar,          50),
                new SqlParameter("@ModelCode",           SqlDbType.VarChar,          50),
                new SqlParameter("@Origin",              SqlDbType.VarChar,          20),
                new SqlParameter("@Quantity",            SqlDbType.VarChar,          50),
                new SqlParameter("@QuantityUnit",        SqlDbType.VarChar,          50),
                new SqlParameter("@DispatchingKey",      SqlDbType.VarChar,          50),
                new SqlParameter("@EnglishComposition",  SqlDbType.VarChar,        1024),
                new SqlParameter("@LocalComposition",    SqlDbType.VarChar),
                new SqlParameter("@Size",                SqlDbType.VarChar,         256),
                new SqlParameter("@EnglishDescription",  SqlDbType.VarChar,        1024),
                new SqlParameter("@LocalDescription",    SqlDbType.VarChar,        1024),
                new SqlParameter("@Brand",               SqlDbType.VarChar,          50),
                new SqlParameter("@TypeOfGoods",         SqlDbType.VarChar,          50),
                new SqlParameter("@Price",               SqlDbType.VarChar,          50),
                new SqlParameter("@Currency",            SqlDbType.VarChar,          20),
                new SqlParameter("@HSCode",              SqlDbType.VarChar,          20),
                new SqlParameter("@TotalValue",          SqlDbType.VarChar,          50),
                new SqlParameter("@Unit",                SqlDbType.VarChar,          20),
                new SqlParameter("@NETWeight",           SqlDbType.VarChar,          50),
                new SqlParameter("@GrossWeight",         SqlDbType.VarChar,          50),
                new SqlParameter("@CommercialInvoiceNO", SqlDbType.VarChar,          20),
                new SqlParameter("@StoreNO",             SqlDbType.VarChar,          20),
                new SqlParameter("@StoreName",           SqlDbType.VarChar,          50),
                new SqlParameter("@FileName",            SqlDbType.VarChar,          50),
                new SqlParameter("@CreateTime",          SqlDbType.SmallDateTime),
                new SqlParameter("@Creator",             SqlDbType.VarChar, 20)
            };
            parameters[0].Value  = model.ItemCode;
            parameters[1].Value  = model.ShippingNumber;
            parameters[2].Value  = model.OrderNumber;
            parameters[3].Value  = model.OriginalPONumber;
            parameters[4].Value  = model.PalletNumber;
            parameters[5].Value  = model.ParcelNumber;
            parameters[6].Value  = model.ModelCode;
            parameters[7].Value  = model.Origin;
            parameters[8].Value  = model.Quantity;
            parameters[9].Value  = model.QuantityUnit;
            parameters[10].Value = model.DispatchingKey;
            parameters[11].Value = model.EnglishComposition;
            parameters[12].Value = model.LocalComposition;
            parameters[13].Value = model.Size;
            parameters[14].Value = model.EnglishDescription;
            parameters[15].Value = model.LocalDescription;
            parameters[16].Value = model.Brand;
            parameters[17].Value = model.TypeOfGoods;
            parameters[18].Value = model.Price;
            parameters[19].Value = model.Currency;
            parameters[20].Value = model.HSCode;
            parameters[21].Value = model.TotalValue;
            parameters[22].Value = model.Unit;
            parameters[23].Value = model.NETWeight;
            parameters[24].Value = model.GrossWeight;
            parameters[25].Value = model.CommercialInvoiceNO;
            parameters[26].Value = model.StoreNO;
            parameters[27].Value = model.StoreName;
            parameters[28].Value = model.FileName;
            parameters[29].Value = model.CreateTime;
            parameters[30].Value = model.Creator;

            int rows = SqlHelper.ExecuteSql(SqlHelper.LocalSqlServer, strSql.ToString( ), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #6
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(OriginalCLPEntity model)
        {
            //StringBuilder strSql=new StringBuilder( );
            //strSql.Append( "update T_OriginalCLP set " );
            //strSql.Append( "ItemCode=@ItemCode," );
            //strSql.Append( "ShippingNumber=@ShippingNumber," );
            //strSql.Append( "OrderNumber=@OrderNumber," );
            //strSql.Append( "OriginalPONumber=@OriginalPONumber," );
            //strSql.Append( "PalletNumber=@PalletNumber," );
            //strSql.Append( "ParcelNumber=@ParcelNumber," );
            //strSql.Append( "ModelCode=@ModelCode," );
            //strSql.Append( "Origin=@Origin," );
            //strSql.Append( "Quantity=@Quantity," );
            //strSql.Append( "QuantityUnit=@QuantityUnit," );
            //strSql.Append( "DispatchingKey=@DispatchingKey," );
            //strSql.Append( "EnglishComposition=@EnglishComposition," );
            //strSql.Append( "LocalComposition=@LocalComposition," );
            //strSql.Append( "Size=@Size," );
            //strSql.Append( "EnglishDescription=@EnglishDescription," );
            //strSql.Append( "LocalDescription=@LocalDescription," );
            //strSql.Append( "Brand=@Brand," );
            //strSql.Append( "TypeOfGoods=@TypeOfGoods," );
            //strSql.Append( "Price=@Price," );
            //strSql.Append( "Currency=@Currency," );
            //strSql.Append( "HSCode=@HSCode," );
            //strSql.Append( "TotalValue=@TotalValue," );
            //strSql.Append( "Unit=@Unit," );
            //strSql.Append( "NETWeight=@NETWeight," );
            //strSql.Append( "GrossWeight=@GrossWeight," );
            //strSql.Append( "CommercialInvoiceNO=@CommercialInvoiceNO," );
            //strSql.Append( "StoreNO=@StoreNO," );
            //strSql.Append( "StoreName=@StoreName," );
            //strSql.Append( "FileName=@FileName," );
            //strSql.Append( "CreateTime=@CreateTime," );
            //strSql.Append( "Creator=@Creator" );
            //strSql.Append( " where CLPID=@CLPID " );
            //SqlParameter[] parameters = {
            //        new SqlParameter("@ItemCode", SqlDbType.VarChar,50),
            //        new SqlParameter("@ShippingNumber", SqlDbType.VarChar,50),
            //        new SqlParameter("@OrderNumber", SqlDbType.VarChar,50),
            //        new SqlParameter("@OriginalPONumber", SqlDbType.VarChar,20),
            //        new SqlParameter("@PalletNumber", SqlDbType.VarChar,50),
            //        new SqlParameter("@ParcelNumber", SqlDbType.VarChar,50),
            //        new SqlParameter("@ModelCode", SqlDbType.VarChar,50),
            //        new SqlParameter("@Origin", SqlDbType.VarChar,20),
            //        new SqlParameter("@Quantity", SqlDbType.VarChar,50),
            //        new SqlParameter("@QuantityUnit", SqlDbType.VarChar,50),
            //        new SqlParameter("@DispatchingKey", SqlDbType.VarChar,50),
            //        new SqlParameter("@EnglishComposition", SqlDbType.VarChar,50),
            //        new SqlParameter("@LocalComposition", SqlDbType.VarChar,50),
            //        new SqlParameter("@Size", SqlDbType.VarChar,50),
            //        new SqlParameter("@EnglishDescription", SqlDbType.VarChar,50),
            //        new SqlParameter("@LocalDescription", SqlDbType.VarChar,50),
            //        new SqlParameter("@Brand", SqlDbType.VarChar,50),
            //        new SqlParameter("@TypeOfGoods", SqlDbType.VarChar,50),
            //        new SqlParameter("@Price", SqlDbType.VarChar,50),
            //        new SqlParameter("@Currency", SqlDbType.VarChar,20),
            //        new SqlParameter("@HSCode", SqlDbType.VarChar,20),
            //        new SqlParameter("@TotalValue", SqlDbType.VarChar,50),
            //        new SqlParameter("@Unit", SqlDbType.VarChar,20),
            //        new SqlParameter("@NETWeight", SqlDbType.VarChar,50),
            //        new SqlParameter("@GrossWeight", SqlDbType.VarChar,50),
            //        new SqlParameter("@CommercialInvoiceNO", SqlDbType.VarChar,20),
            //        new SqlParameter("@StoreNO", SqlDbType.VarChar,20),
            //        new SqlParameter("@StoreName", SqlDbType.VarChar,50),
            //        new SqlParameter("@FileName", SqlDbType.VarChar,50),
            //        new SqlParameter("@CreateTime", SqlDbType.SmallDateTime),
            //        new SqlParameter("@Creator", SqlDbType.VarChar,20),
            //        new SqlParameter("@CLPID", SqlDbType.Int,4)};
            //parameters[0].Value = model.ItemCode;
            //parameters[1].Value = model.ShippingNumber;
            //parameters[2].Value = model.OrderNumber;
            //parameters[3].Value = model.OriginalPONumber;
            //parameters[4].Value = model.PalletNumber;
            //parameters[5].Value = model.ParcelNumber;
            //parameters[6].Value = model.ModelCode;
            //parameters[7].Value = model.Origin;
            //parameters[8].Value = model.Quantity;
            //parameters[9].Value = model.QuantityUnit;
            //parameters[10].Value = model.DispatchingKey;
            //parameters[11].Value = model.EnglishComposition;
            //parameters[12].Value = model.LocalComposition;
            //parameters[13].Value = model.Size;
            //parameters[14].Value = model.EnglishDescription;
            //parameters[15].Value = model.LocalDescription;
            //parameters[16].Value = model.Brand;
            //parameters[17].Value = model.TypeOfGoods;
            //parameters[18].Value = model.Price;
            //parameters[19].Value = model.Currency;
            //parameters[20].Value = model.HSCode;
            //parameters[21].Value = model.TotalValue;
            //parameters[22].Value = model.Unit;
            //parameters[23].Value = model.NETWeight;
            //parameters[24].Value = model.GrossWeight;
            //parameters[25].Value = model.CommercialInvoiceNO;
            //parameters[26].Value = model.StoreNO;
            //parameters[27].Value = model.StoreName;
            //parameters[28].Value = model.FileName;
            //parameters[29].Value = model.CreateTime;
            //parameters[30].Value = model.Creator;
            //parameters[31].Value = model.CLPID;
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("update T_OriginalCLP set ");
            strSql.Append("ItemCode=@ItemCode,");
            strSql.Append("ShippingNumber=@ShippingNumber,");
            strSql.Append("OrderNumber=@OrderNumber,");
            strSql.Append("OriginalPONumber=@OriginalPONumber,");
            strSql.Append("PalletNumber=@PalletNumber,");
            strSql.Append("ParcelNumber=@ParcelNumber,");
            strSql.Append("ModelCode=@ModelCode,");
            strSql.Append("Origin=@Origin,");
            strSql.Append("Quantity=@Quantity,");
            strSql.Append("QuantityUnit=@QuantityUnit,");
            strSql.Append("DispatchingKey=@DispatchingKey,");
            strSql.Append("EnglishComposition=@EnglishComposition,");
            strSql.Append("LocalComposition=@LocalComposition,");
            strSql.Append("Size=@Size,");
            strSql.Append("EnglishDescription=@EnglishDescription,");
            strSql.Append("LocalDescription=@LocalDescription,");
            strSql.Append("Brand=@Brand,");
            strSql.Append("TypeOfGoods=@TypeOfGoods,");
            strSql.Append("Price=@Price,");
            strSql.Append("Currency=@Currency,");
            strSql.Append("HSCode=@HSCode,");
            strSql.Append("TotalValue=@TotalValue,");
            strSql.Append("Unit=@Unit,");
            strSql.Append("NETWeight=@NETWeight,");
            strSql.Append("GrossWeight=@GrossWeight,");
            strSql.Append("CommercialInvoiceNO=@CommercialInvoiceNO,");
            strSql.Append("StoreNO=@StoreNO,");
            strSql.Append("StoreName=@StoreName,");
            strSql.Append("FileName=@FileName,");
            strSql.Append("CreateTime=@CreateTime,");
            strSql.Append("Creator=@Creator");
            strSql.Append(" where CLPID=@CLPID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ItemCode",            SqlDbType.VarChar,          50),
                new SqlParameter("@ShippingNumber",      SqlDbType.VarChar,          50),
                new SqlParameter("@OrderNumber",         SqlDbType.VarChar,          50),
                new SqlParameter("@OriginalPONumber",    SqlDbType.VarChar,          20),
                new SqlParameter("@PalletNumber",        SqlDbType.VarChar,          50),
                new SqlParameter("@ParcelNumber",        SqlDbType.VarChar,          50),
                new SqlParameter("@ModelCode",           SqlDbType.VarChar,          50),
                new SqlParameter("@Origin",              SqlDbType.VarChar,          20),
                new SqlParameter("@Quantity",            SqlDbType.VarChar,          50),
                new SqlParameter("@QuantityUnit",        SqlDbType.VarChar,          50),
                new SqlParameter("@DispatchingKey",      SqlDbType.VarChar,          50),
                new SqlParameter("@EnglishComposition",  SqlDbType.VarChar,        1024),
                new SqlParameter("@LocalComposition",    SqlDbType.VarChar),
                new SqlParameter("@Size",                SqlDbType.VarChar,         256),
                new SqlParameter("@EnglishDescription",  SqlDbType.VarChar,        1024),
                new SqlParameter("@LocalDescription",    SqlDbType.VarChar,        1024),
                new SqlParameter("@Brand",               SqlDbType.VarChar,          50),
                new SqlParameter("@TypeOfGoods",         SqlDbType.VarChar,          50),
                new SqlParameter("@Price",               SqlDbType.VarChar,          50),
                new SqlParameter("@Currency",            SqlDbType.VarChar,          20),
                new SqlParameter("@HSCode",              SqlDbType.VarChar,          20),
                new SqlParameter("@TotalValue",          SqlDbType.VarChar,          50),
                new SqlParameter("@Unit",                SqlDbType.VarChar,          20),
                new SqlParameter("@NETWeight",           SqlDbType.VarChar,          50),
                new SqlParameter("@GrossWeight",         SqlDbType.VarChar,          50),
                new SqlParameter("@CommercialInvoiceNO", SqlDbType.VarChar,          20),
                new SqlParameter("@StoreNO",             SqlDbType.VarChar,          20),
                new SqlParameter("@StoreName",           SqlDbType.VarChar,          50),
                new SqlParameter("@FileName",            SqlDbType.VarChar,          50),
                new SqlParameter("@CreateTime",          SqlDbType.SmallDateTime),
                new SqlParameter("@Creator",             SqlDbType.VarChar,          20),
                new SqlParameter("@CLPID",               SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.ItemCode;
            parameters[1].Value  = model.ShippingNumber;
            parameters[2].Value  = model.OrderNumber;
            parameters[3].Value  = model.OriginalPONumber;
            parameters[4].Value  = model.PalletNumber;
            parameters[5].Value  = model.ParcelNumber;
            parameters[6].Value  = model.ModelCode;
            parameters[7].Value  = model.Origin;
            parameters[8].Value  = model.Quantity;
            parameters[9].Value  = model.QuantityUnit;
            parameters[10].Value = model.DispatchingKey;
            parameters[11].Value = model.EnglishComposition;
            parameters[12].Value = model.LocalComposition;
            parameters[13].Value = model.Size;
            parameters[14].Value = model.EnglishDescription;
            parameters[15].Value = model.LocalDescription;
            parameters[16].Value = model.Brand;
            parameters[17].Value = model.TypeOfGoods;
            parameters[18].Value = model.Price;
            parameters[19].Value = model.Currency;
            parameters[20].Value = model.HSCode;
            parameters[21].Value = model.TotalValue;
            parameters[22].Value = model.Unit;
            parameters[23].Value = model.NETWeight;
            parameters[24].Value = model.GrossWeight;
            parameters[25].Value = model.CommercialInvoiceNO;
            parameters[26].Value = model.StoreNO;
            parameters[27].Value = model.StoreName;
            parameters[28].Value = model.FileName;
            parameters[29].Value = model.CreateTime;
            parameters[30].Value = model.Creator;
            parameters[31].Value = model.CLPID;

            int rows = SqlHelper.ExecuteSql(SqlHelper.LocalSqlServer, strSql.ToString( ), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }