public bool DeleteResult()
            {
                OperatorService opServ = new OperatorService();
                bool            f      = opServ.Delete(username, flag);

                return(f);
            }
Пример #2
0
 public bool Delete(Guid key, Operator op)
 {
     if (!IsAuthenticated(key))
     {
         throw new Exception("The key is not authenticated");
     }
     return(OperatorService.Delete(op));
 }
Пример #3
0
 public void Remove(Operator toRemove)
 {
     List();
     if (toRemove == null)
     {
         toRemove = new Operator
         {
             Id = _screen.AskForId("Forneça um ID(Guid):")
         };
     }
     _service.Delete(toRemove);
 }
Пример #4
0
        public async Task <ActionResult> Delete(string id)
        {
            var opera = await operatorService.GetOperatorByCodeAsync(id);

            if (opera != null)
            {
                try
                {
                    operatorService.Delete(opera.OperatorID);
                    return(Json(true, JsonRequestBehavior.AllowGet));
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
            return(Json(false, JsonRequestBehavior.AllowGet));
        }