Ejemplo n.º 1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                int      IdChofer        = int.Parse(lblIdChofer.Text);
                string   Nombre          = txtNombre.Text;
                string   ApPaterno       = txtApPaterno.Text;
                string   ApMaterno       = txtApMaterno.Text;
                string   Telefono        = txtTelefono.Text;
                DateTime FechaNacimiento = DateTime.Parse(inFechaNacimiento.Value);
                string   Licencia        = txtLicencia.Text;
                string   urlFoto         = UrlFoto.InnerText;
                bool     Dispobilidad    = chkDisponibilidad.Checked;

                string Resultado = BLLChofer.UpdChofer(IdChofer, Nombre, ApPaterno, ApMaterno, Telefono, FechaNacimiento, Licencia, Dispobilidad, urlFoto);

                if (Resultado.IndexOf("Chofer Actualizado") > -1)
                {
                    Util.Library.UtilControls.SweetBoxConfirm("OK!", Resultado, "success", "/Catalogos/Choferes/ListaChoferes.aspx", this.Page, this.GetType());
                }
                else
                {
                    Util.Library.UtilControls.SweetBox("Atención!", Resultado, "warning", this.Page, this.GetType());
                }
            }
            catch (Exception ex)
            {
                Util.Library.UtilControls.SweetBox("ERROR!", ex.Message, "danger", this.Page, this.GetType());
            }
        }
Ejemplo n.º 2
0
        protected void GVChoferes_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            string   IdChofer        = GVChoferes.DataKeys[e.RowIndex].Values["IdChofer"].ToString();
            string   Nombre          = e.NewValues["Nombre"].ToString();
            string   ApPaterno       = e.NewValues["ApPaterno"].ToString();
            string   ApMaterno       = e.NewValues["ApMaterno"].ToString();
            string   Telefono        = e.NewValues["Telefono"].ToString();
            DateTime FechaNacimiento = DateTime.Parse(e.NewValues["FechaNacimiento"].ToString());
            string   Licencia        = e.NewValues["Licencia"].ToString();
            bool     Disponibilidad  = bool.Parse(e.NewValues["Disponibilidad"].ToString());

            try
            {
                string Resultado = BLLChofer.UpdChofer(int.Parse(IdChofer), Nombre, ApPaterno, ApMaterno, Telefono, FechaNacimiento, Licencia, Disponibilidad, null);
                GVChoferes.EditIndex = -1;
                RecargarGrid();
                Util.Library.UtilControls.SweetBox(Resultado, "", "success", this.Page, this.GetType());
            }
            catch (Exception ex)
            {
                Util.Library.UtilControls.SweetBox("Error!", ex.Message, "danger", this.Page, this.GetType());
            }
        }