protected void btnGuardarCobertura_Click(object sender, EventArgs e)
        {
            Alerta.Enabled = true;

            //int intManCoberturaProvincia = int.Parse(ddlProvincia.SelectedItem.Value);
            if (txtManRangoInicial.Text == "")
            {
                txtManRangoInicial.Text = "0";
                if (txtManRangoFinal.Text == "")
                {
                    txtManRangoFinal.Text = "0";
                    if (txtmanFactorCobertura.Text == "")
                    {
                        txtmanFactorCobertura.Text = "0";
                        if (txtManFactorCVF.Text == "")
                        {
                            txtManFactorCVF.Text = "0";
                        }
                    }

                }

            }
            String manCoberturaNombre = txtManCobertura.Text;
            String manCoberturaNt = txtManCoberturaNT.Text;
            int manRangoInicial = Convert.ToInt32(txtManRangoInicial.Text);
            int manRangoFinal = Convert.ToInt32(txtManRangoFinal.Text);
            int manFactorCobertura = int.Parse(txtmanFactorCobertura.Text);
            int manFactorCVF = int.Parse(txtManFactorCVF.Text);

            if (manCoberturaNt == "")
            {
                Alerta.Text = "Favor de ingresar un NemoTécnico";
                if (manCoberturaNt.Length != 1)
                {
                    Alerta.Text = "El NemoTécnico solo debe llevar un caracter.";
                if (manCoberturaNombre == "")
                {
                    Alerta.Text = "Favor de ingresar una Descripción";

                    if (manRangoInicial == 0)
                    {
                        Alerta.Text = "Ingrese un Rango Inicial";
                        if (manRangoFinal == 0)
                        {
                            Alerta.Text = "Ingrese un Rango Final";

                            if (manFactorCobertura == 0)
                            {
                                Alerta.Text = "Ingrese un Factor de Cobertura";
                                if (manFactorCVF == 0)
                                {
                                    Alerta.Text = "Ingrese un Factor de CVF";
                                }
                            }
                        }
                    }
                }
            }
            }

            else
            {
                CoberturaDao cobDao = new CoberturaDao();
                if (cobDao.insertCobertura(manCoberturaNt, manCoberturaNombre, manRangoInicial, manRangoFinal, manFactorCobertura, manFactorCVF) == "Ok")
                {
                    Alerta.Text = "Se ha guardado correctamente";
                    Response.Redirect("MantenedorCobertura");
                }
                else
                {
                    Alerta.Text = cobDao.insertCobertura(manCoberturaNt, manCoberturaNombre, manRangoInicial, manRangoFinal, manFactorCobertura, manFactorCVF);
                }
            }
        }
        void getTableCoberturas()
        {
            CoberturaDao cobDao = new CoberturaDao();
            //Populating a DataTable from database.
            //DataTable dt = regDao.getTableRegion();

            DataSet ds = new DataSet();

            da = cobDao.getCobertura();
            da.Fill(ds);
            this.GV_Cobertura.DataSource = ds;
            this.GV_Cobertura.DataBind();
        }
        private void LoadEditData(int orderId)
        {
            lblIdCobertura.Text = Convert.ToString(orderId);
            CoberturaDao cobDao = new CoberturaDao();

            DataSet ds = new DataSet();

            da = cobDao.getCoberturaId(orderId);

            DataTable dt = new DataTable();
            dt = cobDao.getTableCoberturaId();

            foreach (DataRow row in dt.Rows)
            {

                lbl_IdCoberturaN.Text = row[0].ToString();
                txt_DescripcionCobertura.Text = row[1].ToString();
                txt_porcentajeAsig.Text = row[2].ToString();
                txt_IdProvincia.Text = row[3].ToString();
                txt_VigenciaCobertura.Text = row[4].ToString();

            }
        }
        protected void btnGuardarComu_Click(object sender, EventArgs e)
        {
            int orderId = Convert.ToInt32(lbl_IdCoberturaN.Text);

            CoberturaDao cobDao = new CoberturaDao();
            if (cobDao.updateCobertura(orderId, vigencia) == "Ok")
            {
                Alerta.Text = "Datos Modificados en forma Correcta";
                Response.Redirect("MantenedorCobertura");

            }
            else
            {

                Alerta.Text = cobDao.updateCobertura(orderId, vigencia);
            }
        }