Exemplo n.º 1
0
 public ActionResult edit(MA_TIPO_IDENTIFICACION model)
 {
     if (ModelState.IsValid)
     {
         if (repository.edit(model) > 0)
         {
             return(RedirectToAction("index"));
         }
         else
         {
             ModelState.AddModelError("", "Ocurrrio un erro internamente comuniquese con la area de Sistemas con J.Salinas");
             return(View(model));
         }
     }
     else
     {
         return(View(model));
     }
 }
Exemplo n.º 2
0
        public List <MA_TIPO_IDENTIFICACION> listTypeIdentificacion()
        {
            List <MA_TIPO_IDENTIFICACION> lista = new List <MA_TIPO_IDENTIFICACION>();

            Database  db  = DatabaseFactory.CreateDatabase(ConfigurationManager.AppSettings["conecion"].ToString());
            DbCommand cmd = db.GetStoredProcCommand("[MA_SP_LISTAR_IDENTITFICACION]");

            using (IDataReader reader = db.ExecuteReader(cmd))
            {
                while (reader.Read())
                {
                    MA_TIPO_IDENTIFICACION entity = new MA_TIPO_IDENTIFICACION();
                    entity.I_COD_TIPO_IDENTIFICACION = Convert.ToInt32(reader["I_COD_TIPO_IDENTIFICACION"].ToString());
                    entity.V_ABREV_IDENTIFICACION    = reader["V_ABREV_IDENTIFICACION"].ToString();
                    entity.C_ACTIVO = reader["C_ACTIVO"].ToString();
                    lista.Add(entity);
                }
            }
            return(lista);
        }
Exemplo n.º 3
0
 public ActionResult guardar(MA_TIPO_IDENTIFICACION entity)
 {
     return(Json(repository.create(entity), JsonRequestBehavior.AllowGet));
 }