Ejemplo n.º 1
0
        protected void PrecioTextBox_TextChanged(object sender, EventArgs e)
        {
            decimal Costo  = Utils.ToDecimal(CostoTextBox.Text);
            decimal Precio = Utils.ToDecimal(PrecioTextBox.Text);

            if (CostoTextBox.Text != string.Empty || PrecioTextBox.Text != string.Empty)
            {
                if (Costo > Precio)
                {
                    Utils.ShowToastr(this, "El costo debe ser menor que el precio", "Error", "error");
                }
                else
                {
                    GananciaTextBox.Text = Metodo.Ganancia(Costo, Precio).ToString();
                }
            }
            else
            {
                Utils.ShowToastr(this, "Debe llenar campo Precio", "Error", "error");
            }
        }