Exemplo n.º 1
0
 /// <summary>
 ///  First Get from db then use Delete
 /// </summary>
 /// <param name="item"></param>
 public void Remove(StatusesForPatient item)
 {
     if (item != null)
     {
         control.Remove(item);
     }
     else
     {
         throw new Exception("This item not found in DataBase");
     }
 }
Exemplo n.º 2
0
        public StatusesForPatient Get(int id, string status)
        {
            StatusesForPatient temp = control.GetAll().FirstOrDefault(x => x.Id == id || x.Status == status);

            if (temp != null)
            {
                return(temp);
            }
            else
            {
                throw new Exception("Not Found Status in DataBase");
            }
        }
Exemplo n.º 3
0
        public StatusesForPatient Add(StatusesForPatient item)
        {
            StatusesForPatient temp = control.GetAll().FirstOrDefault(x => x.Status == item.Status);

            if (temp != null)
            {
                temp = control.Add(temp);
                control.SaveChanges();
                return(temp);
            }
            else
            {
                throw new Exception("This Status alredy in base");
            }
        }
Exemplo n.º 4
0
 public void Remove(StatusesForPatient item)
 {
     context.StatusesPatient.Remove(item);
 }
Exemplo n.º 5
0
 public StatusesForPatient Add(StatusesForPatient item)
 {
     return(context.StatusesPatient.Add(item));
 }