public async Task <ActionResult> Createssignment(string Nombre)
        {
            try
            {
                var assign = new EntAssignment()
                {
                    Nombre = Nombre,
                };

                var result = await _ibusAssignment.SaveAssignment(assign);

                if (result)
                {
                    return(Ok("Operacion Exitosa"));
                }
                else
                {
                    return(NotFound("No se grabo estudiante"));
                }
            }
            catch (Exception ex)
            {
                return(NotFound(ex.ToString()));
            }
        }
Exemple #2
0
        public async Task <bool> SaveAssignment(EntAssignment entAssignment)
        {
            try
            {
                var asignacione = new Asignacione()
                {
                    Nombre = entAssignment.Nombre
                };
                _schoolContext.Asignaciones.Add(asignacione);
                await _schoolContext.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex)
            {
                throw new Exception("Erro " + ex.Message);
            }
            return(false);
        }
Exemple #3
0
 public async Task <bool> DeleteAssignment(EntAssignment entAssignment)
 {
     throw new System.NotImplementedException();
 }
Exemple #4
0
 public async Task <bool> SaveAssignment(EntAssignment entAssignment)
 {
     return(await new DatAssignment(_schoolContext).SaveAssignment(entAssignment));
 }
Exemple #5
0
 public async Task <bool> UpdateAssignment(EntAssignment entAssignment)
 {
     throw new NotImplementedException();
 }