Пример #1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            var user   = HttpContext.Current.User.Identity.Name;
            var fechaI = Request["datepicker1"].ToString();

            var se = new Seguimiento
            {
                CodSeguimiento = Convert.ToInt32(txtid.Text),
                FechaInicio    = Convert.ToDateTime(fechaI),
                estado         = chkestado.Checked
            };

            if (se.estado == false)
            {
                se.FechaFin = DateTime.Now;
            }

            se.IMEI       = cboimei.SelectedValue;
            se.NroPlaca   = cboplaca.SelectedValue;
            se.UsuaModif  = user;
            se.FechaModif = DateTime.Now;

            bool sx = seguimientoCtrl.update(se);

            if (sx == true)
            {
                MensajeAlerta("Se modifico correctamente");
                Response.Redirect("/Vistas/Seguimientos/Index");
            }
            else
            {
                MensajeAlerta("Datos invalidos");
            }
        }
Пример #2
0
        protected void btnEliminar_Click(object sender, EventArgs e)
        {
            //Depurar en 30 dias
            //seguimientoCtrl.remove(lblid.Text);
            //Response.Redirect("/Vistas/Seguimientos/Index");
            var user = HttpContext.Current.User.Identity.Name;
            var se   = new Seguimiento
            {
                CodSeguimiento = Convert.ToInt32(lblid.Text),
                FechaInicio    = Convert.ToDateTime(lblfechai.Text),
                estado         = false,
                FechaFin       = DateTime.Now,
                IMEI           = lblgps.Text,
                NroPlaca       = lblplaca.Text,
                UsuaModif      = user,
                FechaModif     = DateTime.Now
            };

            bool sx = seguimientoCtrl.update(se);

            if (sx == true)
            {
                MensajeAlerta("Se modifico correctamente");
                Response.Redirect("/Vistas/Seguimientos/Index");
            }
            else
            {
                MensajeAlerta("Intente de nuevo");
            }
        }