예제 #1
0
        private void BatchProcess(string disID)
        {
            DataTable dtContract  = helper.GetContractDataByDistId(disID);
            string    ProductList = string.Empty;

            if (dtContract.Rows.Count > 0)
            {
                ProductList = dtContract.Rows[0]["ProductListData"].ToString();
            }

            //rtbContractProduct.Text = S3.Text.Base64Helper.Base64Decode(ProductList);

            DataSet dsProduct = helper.XMLToDataSet(ProductList);

            if (dsProduct.Tables.Count > 0)
            {
                foreach (DataRow dr in dsProduct.Tables[0].Rows)
                {
                    if (removeCodeList.Contains(dr["ItemCode"].ToString()))
                    {
                        dr.Delete();
                    }
                }
                dsProduct.Tables[0].AcceptChanges();
            }
            gvProductList.DataSource = dsProduct;
        }
예제 #2
0
        private void ContractProductProcess(string disID, string strItemCode, decimal listPrice)
        {
            DataTable dtContract  = helper.GetContractDataByDistId(disID);
            string    ProductList = string.Empty;

            if (dtContract.Rows.Count > 0)
            {
                ProductList = dtContract.Rows[0]["ProductListData"].ToString();
            }


            DataSet dsProduct = helper.XMLToDataSet(ProductList);

            if (dsProduct.Tables.Count > 0)
            {
                foreach (DataRow dr in dsProduct.Tables[0].Rows)
                {
                    if (dr["ItemCode"].ToString() == strItemCode)
                    {
                        dr["PriceWithVAT"]    = listPrice.ToString();
                        dr["PriceWithoutVAT"] = Math.Round(listPrice / Decimal.Parse("1.17"), 4).ToString();
                        dsProduct.Tables[0].AcceptChanges();
                        continue;
                    }
                }
            }

            string encryData = helper.DataSetToXML(dsProduct);

            //encryData = S3.Text.Base64Helper.Base64Encode(encryData);

            if (SqlHelper.UpdateContractDataProductByDistId(disID, encryData) < 0)
            {
                MessageBox.Show("Updated Product List Data Failed!", "Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }