Пример #1
0
        protected void ImgAgregarTerreno_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                if (DdlDireccion.SelectedValue == "0")
                {
                    new FuncionesDAO().FunShowJSMessage("Seleccione Tipo Direccion..!", this);
                    return;
                }

                if (string.IsNullOrEmpty(TxtDireccion.Text.Trim()))
                {
                    new FuncionesDAO().FunShowJSMessage("Ingrese Direccion..!", this);
                    return;
                }

                _dtbterreno = (DataTable)ViewState["Terreno"];

                if (ViewState["Terreno"] != null)
                {
                    _resultado = _dtbterreno.Select("Direccion='" + TxtDireccion.Text.ToUpper() + "'").FirstOrDefault();

                    if (_resultado != null)
                    {
                        _lexiste = true;
                    }
                }

                if (_lexiste)
                {
                    new FuncionesDAO().FunShowJSMessage("Ya Existe Email Agregado..!", this);
                    return;
                }

                TrTerreno6.Visible = true;

                //_dts = new ConsultaDatosDAO().FunInsertAdicionales(2, 0, 0, 0, "", ViewState["NumeroDocumento"].ToString(),
                //    "DIRECCION", DdlDireccion.SelectedValue, RdbTerreno.SelectedValue, TxtDireccion.Text.Trim().ToUpper(),
                //    TxtReferencia.Text.Trim().ToUpper(), "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
                //    "", "", "", "", "", "", "", "", Session["Conectar"].ToString());

                //_dts = new ConsultaDatosDAO().FunInsertAdicionales(6, 0, 0, 0, "", ViewState["NumeroDocumento"].ToString(),
                //    "DIRECCION", "TIPO DIRECCION", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
                //    "", "", "", "", "", "", "", "", "", "", "", "", Session["Conectar"].ToString());

                ViewState["Terreno"]   = _dts.Tables[0];
                GrdvTerreno.DataSource = _dts;
                GrdvTerreno.DataBind();

                DdlDireccion.SelectedValue = "0";
                TxtDireccion.Text          = "";
                TxtReferencia.Text         = "";
            }
            catch (Exception ex)
            {
                Lblerror.Text = ex.ToString();
            }
        }
Пример #2
0
        protected void ChkTerreno_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                DdlDireccion.SelectedValue = "0";
                RdbTerreno.SelectedValue   = "DOM";
                TxtDireccion.Text          = "";
                TxtReferencia.Text         = "";
                TrTerreno1.Visible         = false;
                TrTerreno2.Visible         = false;
                TrTerreno3.Visible         = false;
                TrTerreno4.Visible         = false;
                TrTerreno5.Visible         = false;
                TrTerreno6.Visible         = false;
                GrdvTerreno.DataSource     = null;
                GrdvTerreno.DataBind();

                if (ChkTerreno.Checked)
                {
                    TrTerreno1.Visible = true;
                    TrTerreno2.Visible = true;
                    TrTerreno3.Visible = true;
                    TrTerreno4.Visible = true;
                    TrTerreno5.Visible = true;
                    TrTerreno6.Visible = true;

                    _dts = new ConsultaDatosDAO().FunConsultaDatos(234, 0, 0, 0, "TIPO DIRECCION", "DIRECCION",
                                                                   ViewState["NumeroDocumento"].ToString(), Session["Conectar"].ToString().ToString());

                    GrdvTerreno.DataSource = _dts;
                    GrdvTerreno.DataBind();

                    ViewState["Terreno"] = _dts.Tables[0];

                    if (_dts.Tables[0].Rows.Count > 0)
                    {
                        TrTerreno6.Visible = true;
                    }
                    else
                    {
                        TrTerreno6.Visible = false;
                    }
                }
            }
            catch (Exception ex)
            {
                Lblerror.Text = ex.ToString();
            }
        }
Пример #3
0
        protected void ImgDelTerreno_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                GridViewRow _gvrow = (GridViewRow)(sender as Control).Parent.Parent;
                _codigo = GrdvTerreno.DataKeys[_gvrow.RowIndex].Values["CodigoMATD"].ToString();

                _dtbterreno = (DataTable)ViewState["Terreno"];
                _resultado  = _dtbterreno.Select("CodigoMATD='" + _codigo + "'").FirstOrDefault();
                _resultado.Delete();
                _dtbterreno.AcceptChanges();
                GrdvTerreno.DataSource = _dtbterreno;
                GrdvTerreno.DataBind();

                //_dts = new ConsultaDatosDAO().FunInsertAdicionales(4, int.Parse(_codigo),
                //    0, 0, "", "", "", "", "", "", "", "", "", "", "", "", "",
                //    "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
                //    Session["Conectar"].ToString());
            }
            catch (Exception ex)
            {
                Lblerror.Text = ex.ToString();
            }
        }
Пример #4
0
        protected void FunCargarMantenimiento()
        {
            try
            {
                _dts = new ConsultaDatosDAO().FunConsultaDatos(170, 0, 0, 0, "", ViewState["Bitacora"].ToString(), "",
                                                               Session["Conectar"].ToString());

                GrdvSupervisores.DataSource = _dts.Tables[0];
                GrdvSupervisores.DataBind();

                if (_dts.Tables[1].Rows.Count > 0)
                {
                    Pnl3.Visible           = true;
                    GrdvAtrasos.DataSource = _dts.Tables[1];
                    GrdvAtrasos.DataBind();
                }

                if (_dts.Tables[2].Rows.Count > 0)
                {
                    Pnl4.Visible           = true;
                    GrdvFaltasJ.DataSource = _dts.Tables[2];
                    GrdvFaltasJ.DataBind();
                }

                if (_dts.Tables[3].Rows.Count > 0)
                {
                    Pnl5.Visible           = true;
                    GrdvFaltasI.DataSource = _dts.Tables[3];
                    GrdvFaltasI.DataBind();
                }

                if (_dts.Tables[4].Rows.Count > 0)
                {
                    Pnl6.Visible            = true;
                    GrdvPermisos.DataSource = _dts.Tables[4];
                    GrdvPermisos.DataBind();
                }

                if (_dts.Tables[5].Rows.Count > 0)
                {
                    Pnl7.Visible = true;
                    GrdvCambioTurno.DataSource = _dts.Tables[5];
                    GrdvCambioTurno.DataBind();
                }

                if (_dts.Tables[6].Rows.Count > 0)
                {
                    Pnl8.Visible          = true;
                    GrdvVarios.DataSource = _dts.Tables[6];
                    GrdvVarios.DataBind();
                }

                if (_dts.Tables[7].Rows.Count > 0)
                {
                    Pnl9.Visible           = true;
                    GrdvNovedad.DataSource = _dts.Tables[7];
                    GrdvNovedad.DataBind();
                }

                if (_dts.Tables[8].Rows.Count > 0)
                {
                    Pnl10.Visible           = true;
                    GrdvRefuerzo.DataSource = _dts.Tables[8];
                    GrdvRefuerzo.DataBind();
                }

                if (_dts.Tables[9].Rows.Count > 0)
                {
                    Pnl11.Visible          = true;
                    GrdvTerreno.DataSource = _dts.Tables[9];
                    GrdvTerreno.DataBind();
                }

                if (_dts.Tables[10].Rows.Count > 0)
                {
                    Pnl12.Visible           = true;
                    GrdvSistemas.DataSource = _dts.Tables[10];
                    GrdvSistemas.DataBind();
                }

                if (_dts.Tables[11].Rows.Count > 0)
                {
                    Pnl13.Visible        = true;
                    GrdvPagos.DataSource = _dts.Tables[11];
                    GrdvPagos.DataBind();
                }

                if (_dts.Tables[12].Rows.Count > 0)
                {
                    Pnl14.Visible = true;
                    GrdvAdicionales.DataSource = _dts.Tables[12];
                    GrdvAdicionales.DataBind();
                }
            }
            catch (Exception ex)
            {
                Lblerror.Text = ex.ToString();
            }
        }