Пример #1
0
        public void DeleteChecklistCategory(CheckListCategory checkListCategory)
        {
            var category = _context.CheckListCategory.Where(m => (m.CheckListCategoryID == checkListCategory.CheckListCategoryID || m.CategoryName == checkListCategory.CategoryName)).FirstOrDefault();

            if (category != null)
            {
                category.IsDeleted   = checkListCategory.IsDeleted;
                category.DeletedBy   = checkListCategory.DeletedBy;
                category.DeletedDate = checkListCategory.DeletedDate;
                _context.Update(category);
                _context.SaveChanges();
            }

            return;
        }
Пример #2
0
 public void DeleteCheckList(int CheckListID, TokenModel tokenModel)
 {
     try
     {
         var CheckListVAR = _context.CheckList.Where(m => (m.CheckListID == CheckListID)).FirstOrDefault();
         CheckListVAR.IsDeleted   = true;
         CheckListVAR.DeletedBy   = tokenModel.UserID;
         CheckListVAR.DeletedDate = DateTime.Now;
         _context.Update(CheckListVAR);
         _context.SaveChanges();
         return;
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Пример #3
0
 public JsonModel SavePhoneAddress(Patients patients, bool updated)
 {
     try
     {
         _context.Update(patients);
         _context.SaveChanges();
         if (updated)
         {
             response = new JsonModel(new object(), StatusMessage.ClientAddressUpdated, (int)HttpStatusCodes.OK);
         }
         else
         {
             response = new JsonModel(new object(), StatusMessage.ClientAddressCreated, (int)HttpStatusCodes.OK);
         }
     }
     catch (Exception e) { response = new JsonModel(new object(), StatusMessage.ServerError, (int)HttpStatusCodes.InternalServerError, e.Message); }
     return(response);
 }