Ejemplo n.º 1
0
 public IHttpActionResult Put(executers executer)
 {
     bool isUpdated = executerService.UpdateExecuter(executer.exeid, executer);
     if (isUpdated == true)
         return Ok();
     return BadRequest();
 }
Ejemplo n.º 2
0
 public IHttpActionResult Post(executers executer)
 {
     bool isSave = executerService.SaveExecuter(executer);
     if (isSave == true)
         return Ok();
     return BadRequest();
 }
Ejemplo n.º 3
0
        public bool UpdateExecuter(long exeid, executers executer)
        {
            try
            {
                db.Entry(executer).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }

        }
Ejemplo n.º 4
0
        public bool SaveExecuter(executers executer)
        {
            try
            {
                db.executers.Add(executer);
                db.SaveChanges();
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }

        }