Example #1
0
    protected void btnGuardar_Click(object sender, EventArgs e)
    {
        Dictionary <string, object> Dic = new Dictionary <string, object>();

        try
        {
            Dic.Add("@DG_NOMBRE", txtDgNombre.Text);
            Dic.Add("@DG_NOMBRE_2", txtDgNombre2.Text);
            Dic.Add("@DG_APELLIDO_PATERNO", txtDgApellidoP.Text);
            Dic.Add("@DG_APELLIDO_MATERNO", txtDgApellidoM.Text);
            Dic.Add("@DG_FECHA_NACIMIENTO", Convert.ToDateTime(txtDgFechaNac.Text));
            Dic.Add("@DG_ID_EMPRESA", ddlEmpresa.SelectedValue);
            Dic.Add("@DG_ID_SEXO", ddlSexo.SelectedValue);
            Dic.Add("@DG_ID_ESTATUS", ddlEstatus.SelectedValue);
            var DateNow = Convert.ToDateTime(((HiddenField)Master.FindControl("hdnDate")).Value);

            if (Session["IdPaciente"] != null)
            {
                Dic.Add("@ID_DG", Session["IdPaciente"].ToString());
                dbexam.changeProspecto("setUpdateExamenDatosGenerales", Dic);
                ClientScript.RegisterStartupScript(this.GetType(), "Actualiza", "ShowAlertSucesseEdit(''," + (int)EnumMessage.Message.ShowAlertSucesseEdit + ");", true);
            }
            else
            {
                Dic.Add("@DG_FECHA_INSERTA", DateNow);
                if (dbexam.changeProspectoByEstatus("setInsertaExamenDatosGenerales", Dic) == 0)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "Inserta", "ShowAlertSucess(''," + (int)EnumMessage.Message.ShowAlertSucess + ");", true);
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "Error", "ShowAlertError('" + message.buildMessage("Ya existe el usuario") + "');", true);
                }
            }
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Error", "ShowAlertError('" + message.buildMessage(ex.Message) + "');", true);
        }
        finally
        {
            Dic.Clear();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            IdPaciente = Request.QueryString["Id_Persona"];

            if (!string.IsNullOrEmpty(IdPaciente))
            {
                if (!IsPostBack)
                {
                    llenaDrops();
                    consultaPaciente();
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "Error", "ShowAlertErrorUrl(" + (int)EnumMessage.Message.ShowAlertErrorUrl + ");", true);
            }
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Error", "ShowAlertErrorGral('" + message.buildMessage(ex.Message) + "');", true);
        }
    }
    protected void btnGuardar_Click(object sender, EventArgs e)
    {
        Dictionary <string, object> Dic = new Dictionary <string, object>();

        try
        {
            Dic.Add("@RES_ID_PERSONA", IdPaciente);
            Dic.Add("@RES_MODULO_ORIGEN", IdModuloOrigen);

            var DateNow = Convert.ToDateTime(((HiddenField)Master.FindControl("hdnDate")).Value);

            Dic.Add("@RES_ID_DOC_REALIZO", ddlRRealizoEM.SelectedValue == "Seleccionar" ? null : ddlRRealizoEM.SelectedValue);

            if (!Convert.ToBoolean(Session["NuevoResumen"]))
            {
                dbexam.changeProspecto("setUpdateExamenResumen", Dic);
                ClientScript.RegisterStartupScript(this.GetType(), "Actualiza", "ShowAlertSucesseEdit('" + EnumMessage.DatosGenerales + "'," + (int)EnumMessage.Message.ShowAlertSucesseEdit + ");", true);
            }

            else
            {
                Dic.Add("@RES_FECHA_INSERTA", DateNow);
                dbexam.changeProspecto("setInsertaExamenResumen", Dic);
                ClientScript.RegisterStartupScript(this.GetType(), "Inserta", "ShowAlertSucess('" + EnumMessage.DatosGenerales + "'," + (int)EnumMessage.Message.ShowAlertSucess + ");", true);
            }
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Error", "ShowAlertErrorGral('" + message.buildMessage(ex.Message) + "');", true);
        }
        finally
        {
            Dic.Clear();
        }
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            IdPaciente = Request.QueryString["Id_Persona"];

            if (!string.IsNullOrEmpty(IdPaciente))
            {
                //Session["NuevoToxicologico"] = false;

                if (!IsPostBack)
                {
                    oDataTable = dbexam.getDataDropDown("SELECT * FROM TU_EXMED_CAT_TOXICOS");
                    llenaDrops();
                    consultaPaciente();
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "Error", "ShowAlertErrorUrl(" + (int)EnumMessage.Message.ShowAlertErrorUrl + ");", true);
            }
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Error", "ShowAlertErrorGral('" + message.buildMessage(ex.Message) + "');", true);
        }
    }