Example #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            msgExito.Visible  = false;
            msgErrNew.Visible = false;
            ScriptManager.RegisterStartupScript(this, GetType(), "CerrarError", "CerrarError();", true);

            try
            {
                if (txtDescripcion.Text == "")
                {
                    //msgExito.Visible = false;
                    //msgExito.Visible = false;
                    //msgErrNew.Visible = true;
                    //JavaScriptSerializer serializer = new JavaScriptSerializer();
                    ScriptManager.RegisterStartupScript(this, GetType(), "muestraError", "swal('Error','El campo descripción de convenio no debe estar vacío','error');", true);
                }
                else if (ddl_Estatus.Text == "")
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "muestraError", "swal('Error','El campo estatus no debe estar vacío','error');", true);
                }
                else
                {
                    clsConvenios oCls = new clsConvenios();
                    oCls.update(int.Parse(hdId.Value), cmbCentral.Text, txtDescripcion.Text, ddl_Estatus.Text);

                    buscar();
                    ScriptManager.RegisterStartupScript(this, GetType(), "muestraError", "swal('','Información actualizada correctamente','success');", true);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
        public CascadingDropDownNameValue[] getConvenioEstatus(string knownCategoryValues)
        {
            clsConvenios  oCls = new clsConvenios();
            DataTable     dt;
            StringBuilder strHTML = new StringBuilder();

            List <CascadingDropDownNameValue> values = new List <CascadingDropDownNameValue>();

            dt = oCls.GetEstatus();
            if (dt == null)
            {
                return(values.ToArray());
            }
            else
            {
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        values.Add(new CascadingDropDownNameValue
                        {
                            name  = row[1].ToString(),
                            value = row[0].ToString()
                        });
                    }
                    return(values.ToArray());
                }
                else
                {
                    return(values.ToArray());
                }
            }
        }
Example #3
0
        private void buscar()

        {
            msgErrNew.Visible = false;
            clsConvenios  oCls             = new clsConvenios();
            StringBuilder strHTML          = new StringBuilder();
            string        strLoadingCharge = string.Empty;
            DataTable     dtConvenios;

            try
            {
                //msgErrNew.InnerText = "";
                //msgErrNew.Style.Add("display", "none");
                string strCentral = cmbCentral.Items[cmbCentral.SelectedIndex].Value;

                if (strCentral != "" && strCentral != "0")
                {
                    dtConvenios = oCls.GetPorCentrales(strCentral);
                    if (dtConvenios.Rows.Count > 0)
                    {
                        //strHTML = oCls.ReturnHTMLConvenios(dtConvenios);
                        //DBDataPlaceHolder.Controls.Add(new Literal { Text = strHTML.ToString() });
                        //dtConvenios = null;
                        //agregar tabla89
                        gvConvenios.Visible    = true;
                        gvConvenios.DataSource = oCls.GetPorCentrales(strCentral);
                        gvConvenios.DataBind();
                    }
                    else
                    {
                        //msgErrNew.Visible = true;
                        //msgErrNew.InnerText = "";
                        //msgErrNew.Style.Add("display", "inline");
                        //msgErrNew.InnerText = "No hay datos para mostrar";
                        ScriptManager.RegisterStartupScript(this, GetType(), "muestraError", "swal('No hay datos para mostrar','error');", true);

                        gvConvenios.Visible = false;
                    }
                }
                else
                {
                    //msgErrNew.Visible = true;
                    //msgErrNew.InnerText = "";
                    //msgErrNew.Style.Add("display", "inline");
                    //msgErrNew.InnerText = "Debes selecionar una Central";
                    gvConvenios.Visible = false;
                    ScriptManager.RegisterStartupScript(this, GetType(), "muestraError", "swal('Debes selecionar una Central','error');", true);
                }
            }
            catch (Exception ex)
            {
                clsError.logMessage = ex.ToString();
                clsError.logModule  = "btnSearch_Click";
                clsError.LogWrite();
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                string mensaje = serializer.Serialize(ex.Message);
                ScriptManager.RegisterStartupScript(this, GetType(), "muestraError", "swal('Error al cargar los Grupos Detalle: " + mensaje + "');", true);
            }
        }
Example #4
0
        protected void btnEliminar_Click(object sender, ImageClickEventArgs e)
        {
            msgExito.Visible  = false;
            msgErrNew.Visible = false;

            try
            {
                var         controlEditar = (Control)sender;
                GridViewRow renglonGrid   = (GridViewRow)controlEditar.NamingContainer;
                int         idConvenio    = Convert.ToInt32(gvConvenios.DataKeys[renglonGrid.RowIndex].Values["Id"]);

                //var examen = new ExamenesBO().ObtenerExamen(idExamen);
                ViewState["IdConvenio"] = idConvenio;
                clsConvenios oCls     = new clsConvenios();
                var          Convenio = oCls.GetPorIdConvenio(idConvenio);

                foreach (DataRow dtRow in Convenio.Rows)
                {
                    // On all tables' columns
                    hdId.Value          = dtRow[0].ToString();
                    txtConvenio.Text    = dtRow[1].ToString();
                    txtDescripcion.Text = dtRow[2].ToString();
                    var Estatus = dtRow[4].ToString();
                    if (Estatus == "Anterior")
                    {
                        ddl_Estatus.Items.Clear();
                        ddl_Estatus.Items.Add("Anterior");
                        ddl_Estatus.Items.Add("Inactivo");
                    }
                    else if (Estatus == "Actual")
                    {
                        ddl_Estatus.Items.Clear();
                        ddl_Estatus.Items.Add("Actual");
                        ddl_Estatus.Items.Add("Inactivo");
                        ddl_Estatus.Items.Add("Anterior");
                    }
                    else if (Estatus == "Por Entrar")
                    {
                        ddl_Estatus.Items.Clear();
                        ddl_Estatus.Items.Add("Por Entrar");
                        ddl_Estatus.Items.Add("Inactivo");
                        ddl_Estatus.Items.Add("Actual");
                    }
                    else if (Estatus == "Inactivo")
                    {
                        ddl_Estatus.Items.Clear();
                        ddl_Estatus.Items.Add("Inactivo");
                    }
                }
                ScriptManager.RegisterStartupScript(this, GetType(), "muestraModal", "mostrarModal('edit');", true);
            }
            catch (Exception)
            {
                throw;
            }
            //}
        }
Example #5
0
        public String Edit(string strID, string strIdEstatus, string strDescripcion)
        {
            String       msg  = "";
            clsConvenios oCls = new clsConvenios();
            Boolean      resp = false;

            //resp = oCls.update(int.Parse(strID), strDescripcion, (strIdEstatus));
            msg = "1-La información se guardo exitosamente!";
            return(msg);
        }
Example #6
0
        protected void gvConvenios_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            string       strCentral = cmbCentral.Items[cmbCentral.SelectedIndex].Value;
            clsConvenios oCls       = new clsConvenios();

            gvConvenios.Visible   = true;
            gvConvenios.PageIndex = e.NewPageIndex;
            buscar();
            //gvConvenios.DataSource = oCls.GetPorCentrales(strCentral);
            //gvConvenios.DataBind();
        }