Ejemplo n.º 1
0
        public int Update(ProductBarcodeInfo oParam)
        {
            string sql = @"UPDATE product_barcode SET
                            ProductSysNo=@ProductSysNo, Barcode=@Barcode, DateStamp=@DateStamp
                            WHERE SysNo=@SysNo";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int,4);
            SqlParameter paramProductSysNo = new SqlParameter("@ProductSysNo",SqlDbType.Int,4);
            SqlParameter paramBarcode = new SqlParameter("@Barcode",SqlDbType.NVarChar,50);
            SqlParameter paramDateStamp = new SqlParameter("@DateStamp",SqlDbType.DateTime,8);

            if ( oParam.ProductSysNo != AppConst.IntNull)
                paramProductSysNo.Value = oParam.ProductSysNo;
            else
                paramProductSysNo.Value = System.DBNull.Value;

            if( oParam.Barcode != AppConst.StringNull)
                paramBarcode.Value = oParam.Barcode;
            else
                paramBarcode.Value = System.DBNull.Value;

            if( oParam.DateStamp != AppConst.DateTimeNull)
                paramDateStamp.Value = oParam.DateStamp;
            else
                paramBarcode.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramProductSysNo);
            cmd.Parameters.Add(paramBarcode);
            cmd.Parameters.Add(paramDateStamp);

            return SqlHelper.ExecuteNonQuery(cmd);
        }
Ejemplo n.º 2
0
 public void Init()
 {
     BasicInfo = new ProductBasicInfo();
     PriceInfo = new ProductPriceInfo();
     AttributeInfo = new ProductAttributeInfo();
     StatusInfo = new ProductStatusInfo();
     BarcodeInfo = new ProductBarcodeInfo();
 }
Ejemplo n.º 3
0
 public void Init()
 {
     BasicInfo     = new ProductBasicInfo();
     PriceInfo     = new ProductPriceInfo();
     AttributeInfo = new ProductAttributeInfo();
     StatusInfo    = new ProductStatusInfo();
     BarcodeInfo   = new ProductBarcodeInfo();
 }
Ejemplo n.º 4
0
        public int Insert(ProductBarcodeInfo oParam)
        {
            string sql = @"INSERT INTO product_barcode(ProductSysNo,Barcode) VALUES(@ProductSysNo, @Barcode)";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramProductSysNo = new SqlParameter("@ProductSysNo", SqlDbType.Int,4);
            SqlParameter paramBarcode = new SqlParameter("@Barcode",SqlDbType.NVarChar,50);

            if ( oParam.ProductSysNo != AppConst.IntNull)
                paramProductSysNo.Value = oParam.ProductSysNo;
            else
                paramProductSysNo.Value = System.DBNull.Value;

            if( oParam.Barcode != AppConst.StringNull)
                paramBarcode.Value = oParam.Barcode;
            else
                paramBarcode.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramProductSysNo);
            cmd.Parameters.Add(paramBarcode);

            return SqlHelper.ExecuteNonQuery(cmd);
        }
Ejemplo n.º 5
0
 public int DeleteBarcode(ProductBarcodeInfo oParam)
 {
     string sql = "delete product_barcode where productsysno=" + oParam.ProductSysNo + " and barcode='" + oParam.Barcode + "'";
     return SqlHelper.ExecuteNonQuery(sql);
 }
Ejemplo n.º 6
0
 public int InsertBarcode(ProductBarcodeInfo oParam)
 {
     string sql = "select * from product_barcode where productsysno=" + oParam.ProductSysNo + " and barcode='" + oParam.Barcode + "'";
     DataSet ds = SqlHelper.ExecuteDataSet(sql);
     if (Util.HasMoreRow(ds))
         throw new BizException("the same ProductSysNo and Barcode exists already");
     return new ProductBarcodeDac().Insert(oParam);
 }