if(LabelPrices.Text.Length > 0 && txtQuantity.Text.Length > 0) { int Quantity = Convert.ToInt32(txtQuantity.Text); decimal Prices = Convert.ToDecimal(LabelPrices.Text); decimal sum = Prices * Quantity; decimal TotalSum = sum; lblTotalPrice.Text = string.Format("{0:N0}", TotalSum); lblMessageMoreThanStock.Visible = false; Lblonyx.Visible = false; lblcheck.Visible = false; Image3.Visible = false; HyperLinkTracking.Visible = false; imgleon1.Visible = true; imgleon2.Visible = true; imgleon3.Visible = true; imgleon4.Visible = true; lblstaryu.Visible = true; lblstarmie.Visible = true; lblstarwa.Visible = true; lblomanty.Visible = true; ImgThumb.Visible = true; } else { lblMessageMoreThanStock.Visible = true; Lblonyx.Visible = false; lblcheck.Visible = false; Image3.Visible = false; HyperLinkTracking.Visible = false; imgleon1.Visible = true; imgleon2.Visible = true; imgleon3.Visible = true; imgleon4.Visible = true; lblstaryu.Visible = true; lblstarmie.Visible = true; lblstarwa.Visible = true; lblomanty.Visible = true; ImgThumb.Visible = true; lblMessageMoreThanStock.Text = "*Should not be more than Available Stock"; txtQuantity.Text = "1"; lblTotalPrice.Text = LabelPrices.Text; } }
Convert.ToInt32
Convert.ToDecimal
TryParse
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)