Esempio n. 1
0
 public void Init()
 {
     BasicInfo = new ProductBasicInfo();
     PriceInfo = new ProductPriceInfo();
     AttributeInfo = new ProductAttributeInfo();
     StatusInfo = new ProductStatusInfo();
     BarcodeInfo = new ProductBarcodeInfo();
 }
Esempio n. 2
0
 public void Init()
 {
     BasicInfo     = new ProductBasicInfo();
     PriceInfo     = new ProductPriceInfo();
     AttributeInfo = new ProductAttributeInfo();
     StatusInfo    = new ProductStatusInfo();
     BarcodeInfo   = new ProductBarcodeInfo();
 }
Esempio n. 3
0
        public int Update2(ProductAttributeInfo oParam)
        {
            string sql = @"UPDATE product_attribute SET
                            A1_AttributeOptionSysNo=@A1, A2_AttributeOptionSysNo=@A2,
                            A3_AttributeOptionSysNo=@A3, A4_AttributeOptionSysNo=@A4,
                            A5_AttributeOptionSysNo=@A5, A6_AttributeOptionSysNo=@A6,
                            A7_AttributeOptionSysNo=@A7, A8_AttributeOptionSysNo=@A8,
                            A9_AttributeOptionSysNo=@A9, A10_AttributeOptionSysNo=@A10,
                            A11_AttributeOptionSysNo=@A11, A12_AttributeOptionSysNo=@A12,
                            A13_AttributeOptionSysNo=@A13, A14_AttributeOptionSysNo=@A14,
                            A15_AttributeOptionSysNo=@A15, A16_AttributeOptionSysNo=@A16,
                            A17_AttributeOptionSysNo=@A17, A18_AttributeOptionSysNo=@A18,
                            A19_AttributeOptionSysNo=@A19, A20_AttributeOptionSysNo=@A20,
                            A21_AttributeOptionSysNo=@A21, A22_AttributeOptionSysNo=@A22,
                            A23_AttributeOptionSysNo=@A23, A24_AttributeOptionSysNo=@A24,
                            A25_AttributeOptionSysNo=@A25, A26_AttributeOptionSysNo=@A26,
                            A27_AttributeOptionSysNo=@A27, A28_AttributeOptionSysNo=@A28,
                            A29_AttributeOptionSysNo=@A29, A30_AttributeOptionSysNo=@A30
                            WHERE SysNo=@SysNo";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int,4);
            SqlParameter paramA1 = new SqlParameter("@A1", SqlDbType.NVarChar,200);
            SqlParameter paramA2 = new SqlParameter("@A2", SqlDbType.NVarChar,200);
            SqlParameter paramA3 = new SqlParameter("@A3", SqlDbType.NVarChar,200);
            SqlParameter paramA4 = new SqlParameter("@A4", SqlDbType.NVarChar,200);
            SqlParameter paramA5 = new SqlParameter("@A5", SqlDbType.NVarChar,200);
            SqlParameter paramA6 = new SqlParameter("@A6", SqlDbType.NVarChar,200);
            SqlParameter paramA7 = new SqlParameter("@A7", SqlDbType.NVarChar,200);
            SqlParameter paramA8 = new SqlParameter("@A8", SqlDbType.NVarChar,200);
            SqlParameter paramA9 = new SqlParameter("@A9", SqlDbType.NVarChar,200);
            SqlParameter paramA10 = new SqlParameter("@A10", SqlDbType.NVarChar,200);
            SqlParameter paramA11 = new SqlParameter("@A11", SqlDbType.NVarChar,200);
            SqlParameter paramA12 = new SqlParameter("@A12", SqlDbType.NVarChar,200);
            SqlParameter paramA13 = new SqlParameter("@A13", SqlDbType.NVarChar,200);
            SqlParameter paramA14 = new SqlParameter("@A14", SqlDbType.NVarChar,200);
            SqlParameter paramA15 = new SqlParameter("@A15", SqlDbType.NVarChar,200);
            SqlParameter paramA16 = new SqlParameter("@A16", SqlDbType.NVarChar,200);
            SqlParameter paramA17 = new SqlParameter("@A17", SqlDbType.NVarChar,200);
            SqlParameter paramA18 = new SqlParameter("@A18", SqlDbType.NVarChar,200);
            SqlParameter paramA19 = new SqlParameter("@A19", SqlDbType.NVarChar,200);
            SqlParameter paramA20 = new SqlParameter("@A20", SqlDbType.NVarChar,200);
            SqlParameter paramA21 = new SqlParameter("@A21", SqlDbType.NVarChar,200);
            SqlParameter paramA22 = new SqlParameter("@A22", SqlDbType.NVarChar,200);
            SqlParameter paramA23 = new SqlParameter("@A23", SqlDbType.NVarChar,200);
            SqlParameter paramA24 = new SqlParameter("@A24", SqlDbType.NVarChar,200);
            SqlParameter paramA25 = new SqlParameter("@A25", SqlDbType.NVarChar,200);
            SqlParameter paramA26 = new SqlParameter("@A26", SqlDbType.NVarChar,200);
            SqlParameter paramA27 = new SqlParameter("@A27", SqlDbType.NVarChar,200);
            SqlParameter paramA28 = new SqlParameter("@A28", SqlDbType.NVarChar,200);
            SqlParameter paramA29 = new SqlParameter("@A29", SqlDbType.NVarChar,200);
            SqlParameter paramA30 = new SqlParameter("@A30", SqlDbType.NVarChar,200);

            if ( oParam.SysNo != AppConst.IntNull)
                paramSysNo.Value = oParam.SysNo;
            else
                paramSysNo.Value = System.DBNull.Value;
            if ( oParam.A1 != AppConst.StringNull)
                paramA1.Value = oParam.A1;
            else
                paramA1.Value = System.DBNull.Value;
            if ( oParam.A2 != AppConst.StringNull)
                paramA2.Value = oParam.A2;
            else
                paramA2.Value = System.DBNull.Value;
            if ( oParam.A3 != AppConst.StringNull)
                paramA3.Value = oParam.A3;
            else
                paramA3.Value = System.DBNull.Value;
            if ( oParam.A4 != AppConst.StringNull)
                paramA4.Value = oParam.A4;
            else
                paramA4.Value = System.DBNull.Value;
            if ( oParam.A5 != AppConst.StringNull)
                paramA5.Value = oParam.A5;
            else
                paramA5.Value = System.DBNull.Value;
            if ( oParam.A6 != AppConst.StringNull)
                paramA6.Value = oParam.A6;
            else
                paramA6.Value = System.DBNull.Value;
            if ( oParam.A7 != AppConst.StringNull)
                paramA7.Value = oParam.A7;
            else
                paramA7.Value = System.DBNull.Value;
            if ( oParam.A8 != AppConst.StringNull)
                paramA8.Value = oParam.A8;
            else
                paramA8.Value = System.DBNull.Value;
            if ( oParam.A9 != AppConst.StringNull)
                paramA9.Value = oParam.A9;
            else
                paramA9.Value = System.DBNull.Value;
            if ( oParam.A10 != AppConst.StringNull)
                paramA10.Value = oParam.A10;
            else
                paramA10.Value = System.DBNull.Value;
            if ( oParam.A11 != AppConst.StringNull)
                paramA11.Value = oParam.A11;
            else
                paramA11.Value = System.DBNull.Value;
            if ( oParam.A12 != AppConst.StringNull)
                paramA12.Value = oParam.A12;
            else
                paramA12.Value = System.DBNull.Value;
            if ( oParam.A13 != AppConst.StringNull)
                paramA13.Value = oParam.A13;
            else
                paramA13.Value = System.DBNull.Value;
            if ( oParam.A14 != AppConst.StringNull)
                paramA14.Value = oParam.A14;
            else
                paramA14.Value = System.DBNull.Value;
            if ( oParam.A15 != AppConst.StringNull)
                paramA15.Value = oParam.A15;
            else
                paramA15.Value = System.DBNull.Value;
            if ( oParam.A16 != AppConst.StringNull)
                paramA16.Value = oParam.A16;
            else
                paramA16.Value = System.DBNull.Value;
            if ( oParam.A17 != AppConst.StringNull)
                paramA17.Value = oParam.A17;
            else
                paramA17.Value = System.DBNull.Value;
            if ( oParam.A18 != AppConst.StringNull)
                paramA18.Value = oParam.A18;
            else
                paramA18.Value = System.DBNull.Value;
            if ( oParam.A19 != AppConst.StringNull)
                paramA19.Value = oParam.A19;
            else
                paramA19.Value = System.DBNull.Value;
            if ( oParam.A20 != AppConst.StringNull)
                paramA20.Value = oParam.A20;
            else
                paramA20.Value = System.DBNull.Value;
            if ( oParam.A21 != AppConst.StringNull)
                paramA21.Value = oParam.A21;
            else
                paramA21.Value = System.DBNull.Value;
            if ( oParam.A22 != AppConst.StringNull)
                paramA22.Value = oParam.A22;
            else
                paramA22.Value = System.DBNull.Value;
            if ( oParam.A23 != AppConst.StringNull)
                paramA23.Value = oParam.A23;
            else
                paramA23.Value = System.DBNull.Value;
            if ( oParam.A24 != AppConst.StringNull)
                paramA24.Value = oParam.A24;
            else
                paramA24.Value = System.DBNull.Value;
            if ( oParam.A25 != AppConst.StringNull)
                paramA25.Value = oParam.A25;
            else
                paramA25.Value = System.DBNull.Value;
            if ( oParam.A26 != AppConst.StringNull)
                paramA26.Value = oParam.A26;
            else
                paramA26.Value = System.DBNull.Value;
            if ( oParam.A27 != AppConst.StringNull)
                paramA27.Value = oParam.A27;
            else
                paramA27.Value = System.DBNull.Value;
            if ( oParam.A28 != AppConst.StringNull)
                paramA28.Value = oParam.A28;
            else
                paramA28.Value = System.DBNull.Value;
            if ( oParam.A29 != AppConst.StringNull)
                paramA29.Value = oParam.A29;
            else
                paramA29.Value = System.DBNull.Value;
            if ( oParam.A30 != AppConst.StringNull)
                paramA30.Value = oParam.A30;
            else
                paramA30.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramA1);
            cmd.Parameters.Add(paramA2);
            cmd.Parameters.Add(paramA3);
            cmd.Parameters.Add(paramA4);
            cmd.Parameters.Add(paramA5);
            cmd.Parameters.Add(paramA6);
            cmd.Parameters.Add(paramA7);
            cmd.Parameters.Add(paramA8);
            cmd.Parameters.Add(paramA9);
            cmd.Parameters.Add(paramA10);
            cmd.Parameters.Add(paramA11);
            cmd.Parameters.Add(paramA12);
            cmd.Parameters.Add(paramA13);
            cmd.Parameters.Add(paramA14);
            cmd.Parameters.Add(paramA15);
            cmd.Parameters.Add(paramA16);
            cmd.Parameters.Add(paramA17);
            cmd.Parameters.Add(paramA18);
            cmd.Parameters.Add(paramA19);
            cmd.Parameters.Add(paramA20);
            cmd.Parameters.Add(paramA21);
            cmd.Parameters.Add(paramA22);
            cmd.Parameters.Add(paramA23);
            cmd.Parameters.Add(paramA24);
            cmd.Parameters.Add(paramA25);
            cmd.Parameters.Add(paramA26);
            cmd.Parameters.Add(paramA27);
            cmd.Parameters.Add(paramA28);
            cmd.Parameters.Add(paramA29);
            cmd.Parameters.Add(paramA30);

            return SqlHelper.ExecuteNonQuery(cmd);
        }
Esempio n. 4
0
 private void mapAttribute(ProductAttributeInfo oParam, DataRow tempdr)
 {
     oParam.SysNo = Util.TrimIntNull(tempdr["SysNo"]);
     oParam.ProductSysNo = Util.TrimIntNull(tempdr["ProductSysNo"]);
     oParam.A1 = Util.TrimNull(tempdr["A1"]);
     oParam.A2 = Util.TrimNull(tempdr["A2"]);
     oParam.A3 = Util.TrimNull(tempdr["A3"]);
     oParam.A4 = Util.TrimNull(tempdr["A4"]);
     oParam.A5 = Util.TrimNull(tempdr["A5"]);
     oParam.A6 = Util.TrimNull(tempdr["A6"]);
     oParam.A7 = Util.TrimNull(tempdr["A7"]);
     oParam.A8 = Util.TrimNull(tempdr["A8"]);
     oParam.A9 = Util.TrimNull(tempdr["A9"]);
     oParam.A10 = Util.TrimNull(tempdr["A10"]);
     oParam.A11 = Util.TrimNull(tempdr["A11"]);
     oParam.A12 = Util.TrimNull(tempdr["A12"]);
     oParam.A13 = Util.TrimNull(tempdr["A13"]);
     oParam.A14 = Util.TrimNull(tempdr["A14"]);
     oParam.A15 = Util.TrimNull(tempdr["A15"]);
     oParam.A16 = Util.TrimNull(tempdr["A16"]);
     oParam.A17 = Util.TrimNull(tempdr["A17"]);
     oParam.A18 = Util.TrimNull(tempdr["A18"]);
     oParam.A19 = Util.TrimNull(tempdr["A19"]);
     oParam.A20 = Util.TrimNull(tempdr["A20"]);
     oParam.A21 = Util.TrimNull(tempdr["A21"]);
     oParam.A22 = Util.TrimNull(tempdr["A22"]);
     oParam.A23 = Util.TrimNull(tempdr["A23"]);
     oParam.A24 = Util.TrimNull(tempdr["A24"]);
     oParam.A25 = Util.TrimNull(tempdr["A25"]);
     oParam.A26 = Util.TrimNull(tempdr["A26"]);
     oParam.A27 = Util.TrimNull(tempdr["A27"]);
     oParam.A28 = Util.TrimNull(tempdr["A28"]);
     oParam.A29 = Util.TrimNull(tempdr["A29"]);
     oParam.A30 = Util.TrimNull(tempdr["A30"]);
 }
Esempio n. 5
0
        //        /// <summary>
        //        /// ȡ��������Ʒ���е�����
        //        /// </summary>
        //        /// <param name="paramProductSysNo"></param>
        //        /// <returns></returns>
        //        public SortedList GetProductAttributes(int paramProductSysNo)
        //        {
        //            string sql = @"select ca.attributeid,ca.attributename,ca.ordernum,ca.status,ca.attributetype,ca.sysno
        //                          from category_attribute ca
        //                          inner join product p on p.c3sysno = ca.c3sysno
        //                          where ca.status=0 and p.sysno = "+paramProductSysNo
        //                +@"; select *
        //                          from product_attribute
        //                          where productsysno = "+paramProductSysNo;
        //            DataSet ds = SqlHelper.ExecuteDataSet(sql);
        //            DataTable TName = ds.Tables[0];
        //            DataTable TValue = ds.Tables[1];
        //            SortedList st = new SortedList();
        //            if(!Util.HasMoreRow(TName))
        //                return st;
        //
        //            foreach(DataRow dr in TName.Rows)
        //            {
        //                AttributeInfo ai = new AttributeInfo();
        //                ai.SysNo = (int)dr["sysno"];
        //                ai.AttributeId = dr["attributeid"].ToString();
        //                ai.AttributeName = dr["attributename"].ToString();
        //                ai.OrderNum = (int)dr["ordernum"];
        //                ai.Status = (int)dr["status"];
        //                ai.AttributeType = dr["attributetype"].ToString();
        //                if ( Util.HasMoreRow(TValue))
        //                {
        //                    ai.AttributeValue = ds.Tables[1].Rows[0][ai.AttributeId].ToString();
        //                }
        //                st.Add(ai,null);
        //            }
        //            return st;
        //        }
        /// <summary>
        /// ������Ʒ����
        /// </summary>
        /// <param name="oParam"></param>
        public void UpdateAttributeInfo(ProductAttributeInfo oParam)
        {
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                ProductAttributeDac pa = new ProductAttributeDac();
                //pa.Update(oParam);
                pa.Update2(oParam);
                scope.Complete();
            }
        }
Esempio n. 6
0
 public ProductAttributeInfo LoadAttribute(int productSysNo)
 {
     string sql = " select * from product_attribute where productsysno=" + productSysNo;
     DataSet ds = SqlHelper.ExecuteDataSet(sql);
     ProductAttributeInfo oAttribute = new ProductAttributeInfo();
     if (Util.HasMoreRow(ds))
         mapAttribute(oAttribute, ds.Tables[0].Rows[0]);
     return oAttribute;
 }
Esempio n. 7
0
 public int InsertAttribute(ProductAttributeInfo oParam)
 {
     string sql = "select * from product_attribute where productsysno =" + oParam.ProductSysNo;
     DataSet ds = SqlHelper.ExecuteDataSet(sql);
     if (Util.HasMoreRow(ds))
         throw new BizException("the same ProductSysNo exists already");
     return new ProductAttributeDac().Insert(oParam);
 }
Esempio n. 8
0
        public void ImportAttribute()
        {
            if (!AppConfig.IsImportable)
                throw new BizException("IsImportable is false");
            string sql = "select top 1 * from product_attribute";
            DataSet ds = SqlHelper.ExecuteDataSet(sql);
            if (Util.HasMoreRow(ds))
                throw new BizException("the table Product_attribute is not empty");

            string sql_product_distinct = "select productsysno from ipp2003..product_attribute group by productsysno having count(productsysno)>=2";
            DataSet ds_product_distinct = SqlHelper.ExecuteDataSet(sql_product_distinct);
            if (Util.HasMoreRow(ds_product_distinct))
                throw new BizException("the ipp2003..product_attribute has item of 2 rows attribute info");

            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                string sqli = @"select pb.newsysno as productsysno,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,
                                A13,A14,A15,A16,A17,A18,A19,A20,A21,A22,A23,A24,A25,A26,A27,A28,A29,A30
                                from ipp2003..product_attribute pa
                                left join ippConvert..productbasic pb on pb.oldsysno = pa.productsysno
                                where languageid = 'cn'";
                DataSet dsi = SqlHelper.ExecuteDataSet(sqli);
                foreach (DataRow dr in dsi.Tables[0].Rows)
                {
                    ProductAttributeInfo oAttribute = new ProductAttributeInfo();
                    oAttribute.ProductSysNo = Util.TrimIntNull(dr["ProductSysNo"]);
                    oAttribute.A1 = Util.TrimNull(dr["A1"]);
                    oAttribute.A2 = Util.TrimNull(dr["A2"]);
                    oAttribute.A3 = Util.TrimNull(dr["A3"]);
                    oAttribute.A4 = Util.TrimNull(dr["A4"]);
                    oAttribute.A5 = Util.TrimNull(dr["A5"]);
                    oAttribute.A6 = Util.TrimNull(dr["A6"]);
                    oAttribute.A7 = Util.TrimNull(dr["A7"]);
                    oAttribute.A8 = Util.TrimNull(dr["A8"]);
                    oAttribute.A9 = Util.TrimNull(dr["A9"]);
                    oAttribute.A10 = Util.TrimNull(dr["A10"]);
                    oAttribute.A11 = Util.TrimNull(dr["A11"]);
                    oAttribute.A12 = Util.TrimNull(dr["A12"]);
                    oAttribute.A13 = Util.TrimNull(dr["A13"]);
                    oAttribute.A14 = Util.TrimNull(dr["A14"]);
                    oAttribute.A15 = Util.TrimNull(dr["A15"]);
                    oAttribute.A16 = Util.TrimNull(dr["A16"]);
                    oAttribute.A17 = Util.TrimNull(dr["A17"]);
                    oAttribute.A18 = Util.TrimNull(dr["A18"]);
                    oAttribute.A19 = Util.TrimNull(dr["A19"]);
                    oAttribute.A20 = Util.TrimNull(dr["A20"]);
                    oAttribute.A21 = Util.TrimNull(dr["A21"]);
                    oAttribute.A22 = Util.TrimNull(dr["A22"]);
                    oAttribute.A23 = Util.TrimNull(dr["A23"]);
                    oAttribute.A24 = Util.TrimNull(dr["A24"]);
                    oAttribute.A25 = Util.TrimNull(dr["A25"]);
                    oAttribute.A26 = Util.TrimNull(dr["A26"]);
                    oAttribute.A27 = Util.TrimNull(dr["A27"]);
                    oAttribute.A28 = Util.TrimNull(dr["A28"]);
                    oAttribute.A29 = Util.TrimNull(dr["A29"]);
                    oAttribute.A30 = Util.TrimNull(dr["A30"]);

                    //this.InsertAttribute(oAttribute);
                    new ProductAttributeDac().Insert(oAttribute);
                }
                scope.Complete();
            }
        }