public ActionResult Edit([Bind(Include = "tpi_Id,tpi_Descripcion,tpi_UsuarioCrea,tpi_FechaCrea,tpi_UsuarioModifica,tpi_FechaModifica, tbUsuario, tbUsuario1")] tbTipoIdentificacion tbTipoIdentificacion)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    //////////Aqui va la lista//////////////

                    var MensajeError          = "";
                    IEnumerable <object> list = null;
                    list = db.UDP_Gral_tbTipoIdentificacion_Update(tbTipoIdentificacion.tpi_Id, tbTipoIdentificacion.tpi_Descripcion, tbTipoIdentificacion.tpi_UsuarioCrea, tbTipoIdentificacion.tpi_FechaCrea, Function.GetUser(), Function.DatetimeNow());
                    foreach (UDP_Gral_tbTipoIdentificacion_Update_Result TipoIdentificacion in list)
                    {
                        MensajeError = TipoIdentificacion.MensajeError;
                    }
                    if (MensajeError == "-1")
                    {
                    }
                    else
                    {
                        return(RedirectToAction("Index"));
                    }
                }
            }
            catch (Exception Ex)
            {
                Ex.Message.ToString();
            }

            return(View(tbTipoIdentificacion));
        }
        public ActionResult Create([Bind(Include = "tpi_Id,tpi_Descripcion,tpi_UsuarioCrea,tpi_FechaCrea,tpi_UsuarioModifica,tpi_FechaModifica")] tbTipoIdentificacion tbTipoIdentificacion)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    //db.tbTipoIdentificacion.Add(tbTipoIdentificacion);
                    //db.SaveChanges();
                    //return RedirectToAction("Index");

                    var MensajeError          = "";
                    IEnumerable <object> list = null;
                    list = db.UDP_Gral_tbTipoIdentificacion_Insert(tbTipoIdentificacion.tpi_Descripcion);
                    foreach (UDP_Gral_tbTipoIdentificacion_Insert_Result TipoIdentificacion in list)
                    {
                        MensajeError = TipoIdentificacion.MensajeError;
                    }
                    if (MensajeError == "-1")
                    {
                    }
                    else
                    {
                        return(RedirectToAction("Index"));
                    }
                }
            }
            catch (Exception Ex)
            {
                Ex.Message.ToString();
            }



            return(View(tbTipoIdentificacion));
        }
        public ActionResult DeleteConfirmed(byte id)
        {
            tbTipoIdentificacion tbTipoIdentificacion = db.tbTipoIdentificacion.Find(id);

            db.tbTipoIdentificacion.Remove(tbTipoIdentificacion);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #4
0
        public ActionResult EditTest01(
            [PexAssumeUnderTest] TipoIdentificacionController target,
            tbTipoIdentificacion tbTipoIdentificacion
            )
        {
            ActionResult result = target.Edit(tbTipoIdentificacion);

            return(result);
            // TODO: agregar aserciones a método TipoIdentificacionControllerTest.EditTest01(TipoIdentificacionController, tbTipoIdentificacion)
        }
Beispiel #5
0
 public ActionResult Edit([Bind(Include = "tpi_Id,tpi_Descripcion,tpi_UsuarioCrea,tpi_FechaCrea,tpi_UsuarioModifica,tpi_FechaModifica")] tbTipoIdentificacion tbTipoIdentificacion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbTipoIdentificacion).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbTipoIdentificacion));
 }
        // GET: /TipoIdentificacion/Edit/5
        public ActionResult Edit(byte?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Index"));
            }
            tbTipoIdentificacion tbTipoIdentificacion = db.tbTipoIdentificacion.Find(id);

            if (tbTipoIdentificacion == null)
            {
                return(RedirectToAction("NotFound", "Login"));
            }
            return(View(tbTipoIdentificacion));
        }
Beispiel #7
0
        // GET: /TipoIdentificacion/Delete/5
        public ActionResult Delete(byte?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbTipoIdentificacion tbTipoIdentificacion = db.tbTipoIdentificacion.Find(id);

            if (tbTipoIdentificacion == null)
            {
                return(HttpNotFound());
            }
            return(View(tbTipoIdentificacion));
        }
        public ActionResult Create([Bind(Include = "tpi_Id,tpi_Descripcion,tpi_UsuarioCrea,tpi_FechaCrea,tpi_UsuarioModifica,tpi_FechaModifica")] tbTipoIdentificacion tbTipoIdentificacion)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    if (db.tbTipoIdentificacion.Any(a => a.tpi_Descripcion == tbTipoIdentificacion.tpi_Descripcion))
                    {
                        ModelState.AddModelError("", "Ya existe este Tipo De Identificación.");
                        //var colores =
                        return(View(tbTipoIdentificacion));
                    }

                    else
                    {
                        var MensajeError          = "";
                        IEnumerable <object> list = null;
                        list = db.UDP_Gral_tbTipoIdentificacion_Insert(tbTipoIdentificacion.tpi_Descripcion, Function.GetUser(), Function.DatetimeNow());
                        foreach (UDP_Gral_tbTipoIdentificacion_Insert_Result tipoidentificacion in list)
                        {
                            MensajeError = tipoidentificacion.MensajeError;
                        }
                        if (MensajeError == "-1")
                        {
                        }
                        else
                        {
                            return(RedirectToAction("index"));
                        }
                    }
                }
                catch (Exception Ex)
                {
                    ModelState.AddModelError("", "No se ha podido ingresar el registro, favor contacte al administrador " + Ex.Message.ToString());
                    return(View(tbTipoIdentificacion));
                }
                //db.tbTipoPago.Add(tbTipoPago);
                //db.SaveChanges();
                //return RedirectToAction("Index");
            }


            return(View(tbTipoIdentificacion));
        }