Пример #1
0
    protected void btnCalcularPersonalizado_Click(object sender, EventArgs e)
    {
        if (txtmedidaDP.Text == "")
        {
            Utils.AddScriptClientUpdatePanel(panelCalcPersonalizado, "showSuccessMessage8()");
            return;
        }
        if (txtcantidadDP.Text == "")
        {
            Utils.AddScriptClientUpdatePanel(panelCalcPersonalizado, "showSuccessMessage9()");
            return;
        }
        if (ddlTipoMoldura.SelectedValue == "0")
        {
            Utils.AddScriptClientUpdatePanel(panelCalcPersonalizado, "showSuccessMessage11()");
            return;
        }
        double aprox;

        if (ddlTipoMoldura.SelectedValue != "0")
        {
            objDtoMoldura.FK_ITM_Tipo = int.Parse(ddlTipoMoldura.SelectedValue);
            aprox = objCtrMoldura.Aprox(objDtoMoldura);
            int    cantp = int.Parse(txtcantidadDP.Text);
            double a     = aprox * cantp;
            txtpriceaprox.Text = Convert.ToString(a);
            if (aprox == 0)
            {
                txtpriceaprox.Text = "";
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "showNotification", "showNotification('bg-red', 'No hay Tipo de moldura seleccionado!', 'bottom', 'center', null, null);", true);
                return;
            }
            UpdatePanel2.Update();
        }
    }
Пример #2
0
        protected void btnCalcularP_Click(object sender, EventArgs e)
        {
            try
            {
                double aprox;
                if (txtCantidadP.Text == "")
                {
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "swal({type:'error',title: 'ERROR!',text: 'Ingresar cantidad del producto!!'});", true);
                    return;
                }
                if (ddlTipoMoldura.SelectedValue != "0")
                {
                    // objDtoTipoMoldura.PK_ITM_Tipo = int.Parse(ddlTipoMoldura.SelectedValue);
                    objDtoMoldura.FK_ITM_Tipo = int.Parse(ddlTipoMoldura.SelectedValue);
                    aprox = objCtrMoldura.Aprox(objDtoMoldura);
                    //txtImporteAproxP.Text = Convert.ToString(objCtrMoldura.PrecioAprox(objDtoMoldura));
                    //double precio;
                    //txtImporteAproxP.Text = Convert.ToString(aprox);

                    int    cantp = int.Parse(txtCantidadP.Text);
                    double a     = aprox * Convert.ToDouble(cantp);
                    txtImporteAproxP.Text = Convert.ToString(a);


                    if (aprox == 0)
                    {
                        txtImporteAproxP.Text = "";
                        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "swal({type: 'error',title: 'ERROR!',text: 'No hay tipo de moldura seleccionado!!'});", true);
                        //ClientScript.RegisterStartupScript(this.GetType(), "mensaje", "<script>swal({icon: 'error',title: 'ERROR!',text: 'No hay tipo de moldura seleccionado!!'})</script>");
                        return;
                    }
                    Calcular2.Update();
                }
            }
            catch (Exception ex)
            {
                _log.CustomWriteOnLog("registrar pedido personalizado", "Error  = " + ex.Message + "posicion" + ex.StackTrace);
            }
        }