private bool RegistrarCheckinout(EntEmpleado entidad) { bool r = false; try { Checkinout checkinout = new Checkinout(); checkinout.id_empleado = entidad.id_empleado; checkinout.anio = DateTime.Now.Year; checkinout.mes = DateTime.Now.Month; checkinout.dia = DateTime.Now.Day; checkinout.hora = DateTime.Now.Hour; checkinout.minuto = DateTime.Now.Minute; checkinout.segundo = DateTime.Now.Second; checkinout.Device = GetLocalIPAddress(); checkinout.id_sucursal = entidad.id_sucursal; r = ctrl_checkinout.Insertar(checkinout); } catch (Exception) { throw; } return(r); }
public ActionResult DeleteConfirmed(int id) { Checkinout checkinout = db.Checkinouts.Find(id); db.Checkinouts.Remove(checkinout); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Default1Controller112/Delete/5 public ActionResult Delete(int id = 0) { Checkinout checkinout = db.Checkinouts.Find(id); if (checkinout == null) { return(HttpNotFound()); } return(View(checkinout)); }
public ActionResult Edit(Checkinout checkinout) { if (ModelState.IsValid) { db.Entry(checkinout).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(checkinout)); }
private Checkinout[] ExecuteQueryAtNaxian60Server201(string sql) { Checkinout[] checkinouts = new Checkinout[] { }; if (!string.IsNullOrEmpty(Naxian60IP)) { checkinouts = new Database(string.Format("{0},{1}", Naxian60IP, Port201), UserName201, Password201, Database201).Get <Checkinout>(sql); } return(checkinouts); }
public ActionResult Create(Checkinout checkinout) { if (ModelState.IsValid) { db.Checkinouts.Add(checkinout); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(checkinout)); }
public ActionResult Create(Checkinout checkinout) { if (ModelState.IsValid) { db.Checkinouts.Add(checkinout); db.SaveChanges(); return RedirectToAction("Index"); } return View(checkinout); }
public bool Insert(Checkinout entidad) { bool respuesta = false; try { AbrirConexion(); var sql = "insert into asistencia (id_empleado,date,hour,checkinout,device,id_sucursal,enrollnumber) values (?,?,?,?,?,?,NULL);"; using (var cmd = new IfxCommand(sql, Conexion)) { cmd.Parameters.Add(new IfxParameter()).Value = entidad.id_empleado; cmd.Parameters.Add(new IfxParameter()).Value = entidad.pFecha; cmd.Parameters.Add(new IfxParameter()).Value = entidad.pHora; cmd.Parameters.Add(new IfxParameter()).Value = entidad.Ckecked; cmd.Parameters.Add(new IfxParameter()).Value = entidad.Device; cmd.Parameters.Add(new IfxParameter()).Value = entidad.id_sucursal; cmd.ExecuteNonQuery(); } respuesta = true; } catch (InvalidCastException ex) { ApplicationException excepcion = new ApplicationException("Se genero un error con el siguiente mensaje: " + ex.Message, ex); excepcion.Source = "Insert Checkinout"; throw excepcion; } catch (Exception ex) { ApplicationException excepcion = new ApplicationException("Se genero un error de aplicación con el siguiente mensaje: " + ex.Message, ex); excepcion.Source = "Insert Checkinout"; throw excepcion; } finally { CerrarConexion(); } return(respuesta); }
public ActionResult Edit(Checkinout checkinout) { if (ModelState.IsValid) { db.Entry(checkinout).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(checkinout); }
public bool Insertar(Checkinout Entidad) { return(percheckinout.Insert(Entidad)); }