Exemplo n.º 1
0
 // GET: Divisions
 public IHttpActionResult Post(DivisionVM divisionVM)
 {
     if ((divisionVM.Name != null) && (divisionVM.Name != ""))
     {
         _repository.Create(divisionVM);
         return(Ok("Data Berhasil Diinput"));
     }
     return(BadRequest("Department Name Can't be null"));
 }
Exemplo n.º 2
0
 // POST API/Division
 public IHttpActionResult Post(Division divisions)
 {
     if ((divisions.DivisionName != null) && (divisions.DivisionName != ""))
     {
         division.Create(divisions);
         return(Ok("Division Insert Succesfully!"));
     }
     return(BadRequest("Failed to Insert Division"));
 }
Exemplo n.º 3
0
 public IHttpActionResult Post(DivisionModel divisis)
 {
     if ((divisis.Nama != null) || (divisis.Nama != ""))
     {
         divisi.Create(divisis);
         return(Ok("Division Add Successfully!")); //Status 200 OK
     }
     return(BadRequest("Failed to Add Division"));
 }
Exemplo n.º 4
0
 public IHttpActionResult Post(Division divisions)
 {
     //var getDep = connection.Departments.Where(S => S.Id == divisions.DepartmentId).FirstOrDefault();
     //if  ((getDep.IsDelete is true) && (divisions.DepartmentId == 0))
     //{
     //    return BadRequest("Department not exist");
     //}
     //else
     //{
     if ((divisions.DivisionName != null) && (divisions.DivisionName != ""))
     {
         division.Create(divisions);
         return(Ok("Division Added Succesfully!"));    //Status 200 OK
     }
     return(BadRequest("Failed to Add Division"));
     //}
 }
 public IHttpActionResult Post(Division division)
 {
     repo.Create(division);
     return(Ok("Division Added Succesfully!")); //Status 200 OK
 }