Exemple #1
0
        protected void cmdSaveEditPrice_OnClick(object sender, EventArgs e)
        {
            ProductPriceInfo price = new ProductPriceInfo();

            price.UnitCost         = taxPriceUnitCost.Value;
            price.OriginalUnitCost = taxPriceOriginalUnitCost.Value;
            price.TaxPercent       = Convert.ToDecimal(txtPriceTaxPercent.Text.Trim());
            price.Startdate        = dtpPriceStartdate.SelectedDate;
            price.EndDate          = dtpPriceEndDate.SelectedDate;
            price.RoleId           = Convert.ToInt32(ddlPriceRoleId.SelectedValue);
            price.SimpleProductId  = ProductId;

            int productPriceId = Convert.ToInt32(hidProductPriceId.Value);

            if (productPriceId < 0)
            {
                Controller.NewProductPrice(price);
            }
            else
            {
                price.ProductPriceId = productPriceId;
                Controller.UpdateProductPrice(price);
            }

            grdPriceList.DataSource = ProductPrices;
            grdPriceList.DataBind();

            pnlPriceList.Visible = true;
            pnlPriceEdit.Visible = false;
        }