Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            clsCentral clsBussCentral = new clsCentral();

            try
            {
                if (!IsPostBack)
                {
                    //DataTable dtC = clsBussCentral.GetAllCentrales();
                    //Session["dtC"] = dtC;
                    //strHTMLCentral = clsBussCentral.ReturnHTMLCentral(dtC);
                    //DBDataPlaceHolder.Controls.Add(new Literal { Text = strHTMLCentral.ToString() });

                    DataTable Datos = clsBussCentral.GetAllCentrales();

                    GridView1.DataSource = Datos;
                    GridView1.DataBind();
                }
                this.Dispose();
            }
            catch (Exception ex)
            {
                clsError.logMessage = ex.ToString();
                clsError.logModule  = "Page_LoadCentrales";
                clsError.LogWrite();
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            clsCentral clsBussinesCentral = new clsCentral();

            if (!IsPostBack)
            {
                //cmbDivision.Items.Clear();
                msgExito.Visible  = false;
                msgErrNew.Visible = false;
                DataTable dtG;

                dtG = clsBussinesCentral.GetAllCentrales();

                //Session["dtG"] = dtG;
                //dtG.Rows.Add(0, "0", "-- TODOS --");
                DataSet ds = new DataSet(); ds.Tables.Add(dtG.Copy());
                ds.Tables[0].DefaultView.Sort = "Descripción";
                cmbCentral.DataSource         = ds;
                cmbCentral.DataTextField      = "Descripción";
                cmbCentral.DataValueField     = "IdCentral";
                cmbCentral.DataBind();
                //cmbCentral.Items.Add("");
                // cmbCentral.SelectedValue = "";
            }
        }
Beispiel #3
0
        public void LlenarGrid1()
        {
            clsCentral clsBussCentral2 = new clsCentral();

            GridView1.DataSource = clsBussCentral2.GetAllCentrales();
            GridView1.DataBind();
        }
Beispiel #4
0
        public string UpdateCentral(string CodCentral, string Central, int IdCentral)
        {
            clsCentral oClsCentral  = new clsCentral();
            String     strIdCentral = Convert.ToString(IdCentral);
            Boolean    msg          = true;
            string     sResp        = "";

            if (string.IsNullOrEmpty(CodCentral))
            {
                return("Falta agregar el Codigo de la Central");
            }
            if (string.IsNullOrEmpty(Central))
            {
                return("Falta agregar el Central");
            }
            if (string.IsNullOrEmpty(strIdCentral))
            {
                return("Falta agregar el Central");
            }

            sResp = oClsCentral.UpdateCentral(IdCentral, CodCentral, Central);

            //Call function to update the Central
            //if (msg) { return "La Central se ha actualizado en la base de datos"; }
            //else { return "Error al actualizar los datos"; }

            return(sResp);
        }
Beispiel #5
0
        protected void btnEliminar_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                var         controlEditar = (Control)sender;
                GridViewRow renglonGrid   = (GridViewRow)controlEditar.NamingContainer;
                int         idConvenio    = Convert.ToInt32(GridView1.DataKeys[renglonGrid.RowIndex].Values["IdCentral"]);

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

                foreach (DataRow dtRow in Convenio.Rows)
                {
                    // On all tables' columns
                    hdIddelet.Value          = dtRow[0].ToString();
                    txtConveniodelet.Text    = dtRow[1].ToString();
                    txtdescripciondelet.Text = dtRow[2].ToString();
                }
                ScriptManager.RegisterStartupScript(this, GetType(), "muestraModal", "mostrarModal('delete');", true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #6
0
        public CascadingDropDownNameValue[] getCentrales(string knownCategoryValues)

        {
            clsCentral    oCls = new clsCentral();
            DataTable     dt;
            StringBuilder strHTML = new StringBuilder();

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

            dt = oCls.GetAllCentrales();
            if (dt == null)
            {
                return(values.ToArray());
            }
            else
            {
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        values.Add(new CascadingDropDownNameValue
                        {
                            name  = row[2].ToString(),
                            value = row[0].ToString()
                        });
                    }
                    return(values.ToArray());
                }
                else
                {
                    return(values.ToArray());
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            clsCentral clsBussCentral = new clsCentral();

            if (!IsPostBack)
            {
                DataTable dtC = clsBussCentral.GetAllCentralesPrelacion();

                gvLocations.DataSource = dtC;
                gvLocations.DataBind();

                // this.BindGrid();
            }
        }
        public void CargarGrupo()
        {
            clsCentral clsBussinesCentral = new clsCentral();
            DataTable  dtG;

            dtG = clsBussinesCentral.GetAllCentrales();
            //Session["dtG"] = dtG;
            // dtG.Rows.Add(0, "0","-- TODOS --");
            DataSet ds = new DataSet(); ds.Tables.Add(dtG.Copy());

            ds.Tables[0].DefaultView.Sort = "Descripción";
            //cmbCentral.DataSource = ds;
            //cmbCentral.DataTextField = "Descripción";
            //cmbCentral.DataValueField = "IdCentral";
            //cmbCentral.DataBind();

            //cmbCentral.Items.Add("-- TODOS --");
            //cmbCentral.SelectedValue = "-- TODOS --";
        }
Beispiel #9
0
        public void CargarDDLConvenio()
        {
            clsCentral clsBussinesCentral = new clsCentral();
            DataTable  dtG;

            dtG = clsBussinesCentral.GetAllConvenioByCentral(cmbCentral.Text);
            //Session["dtG"] = dtG;
            //dtG.Rows.Add(0, "0","Nuevo Convenio");
            DataSet ds = new DataSet(); ds.Tables.Add(dtG.Copy());

            ds.Tables[0].DefaultView.Sort = "Convenio";
            cmbConvenio.DataSource        = ds;
            cmbConvenio.DataTextField     = "Convenio";
            cmbConvenio.DataValueField    = "IdConvenio";
            cmbConvenio.DataBind();
            cmbConvenio.Items.Add("Nuevo Convenio");
            cmbConvenio.SelectedValue = "Nuevo Convenio";

            dtTemp = new DataTable();
        }
Beispiel #10
0
        public string DeleteCentral(int IdCentral_delete)
        {
            clsCentral oClsCentral  = new clsCentral();
            String     strIdCentral = Convert.ToString(IdCentral_delete);
            Boolean    msg          = true;

            if (string.IsNullOrEmpty(strIdCentral))
            {
                return("Falta agregar la Central");
            }
            msg = oClsCentral.DeleteCentral(IdCentral_delete);
            //Call function to update the Central
            if (msg)
            {
                return("La Central se ha eliminado de la base de datos");
            }
            else
            {
                return("Error al eliminar la Central de la base de datos");
            }
        }
Beispiel #11
0
        protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                GridView GridView2   = (GridView)(e.Row.FindControl("GridView3"));
                Panel    pnlGrid     = (Panel)(e.Row.FindControl("pnlGrid2"));
                Label    btnShowHide = (Label)(e.Row.FindControl("btnShowHide2"));
                //  DataRowView CategoryId = (DataRowView)(e.Row.DataItem("IdCentral"));
                // var controlEditar = (Control)sender;
                // GridViewRow renglonGrid = (GridViewRow)controlEditar.NamingContainer;
                DataRowView rowView = (DataRowView)e.Row.DataItem;

                String state     = rowView["IdConvenio"].ToString();
                int    idCovenio = Convert.ToInt32(state);

                string ShowHideScript = "ToggleVisiblity(this,'" + pnlGrid.ClientID + "');return false";

                btnShowHide.Attributes.Add("onclick", ShowHideScript);
                clsCentral clsBussCentral2 = new clsCentral();

                GridView2.DataSource = clsBussCentral2.ConveniosByConvenio(idCovenio);
                GridView2.DataBind();
            }
        }
Beispiel #12
0
        public String NewCentral(string CodeCentral, string Central)
        {
            clsCentral oClsCentral = new clsCentral();
            //Boolean msg = true;
            string sResp = "";

            if (string.IsNullOrEmpty(CodeCentral))
            {
                return("0-Falta agregar la clave de la Central");
            }
            if (string.IsNullOrEmpty(Central))
            {
                return("0-Falta agregar la descripción de la Central");
            }

            //msg = oClsCentral.NewCentral(CodeCentral, Central);
            sResp = oClsCentral.NewCentral(CodeCentral, Central);

            //Call function to update the Central
            //if (msg) { return "La Central se creado en la base de datos"; }
            //else { return "Error al crear la Central de la base de datos"; }

            return(sResp);
        }