Exemple #1
0
 public IHttpActionResult SaveStatusDetails(StatusTypeAc status)
 {
     try
     {
         var statusdetails = _workFlowRepository.SaveStatusDetails(status);
         return(Ok(statusdetails));
     }
     catch (Exception ex)
     {
         _errorLog.LogException(ex);
         throw;
     }
 }
Exemple #2
0
 public List <StatusTypeAc> GetallStatus()
 {
     try
     {
         var statusCollection = new List <StatusTypeAc>();
         foreach (var status in _statusDataRepository.GetAll().ToList())
         {
             var statusAc = new StatusTypeAc();
             statusAc          = ApplicationClassHelper.ConvertType <StatusType, StatusTypeAc>(status);
             statusAc.StatusId = status.Id;
             statusCollection.Add(statusAc);
         }
         return(statusCollection);
     }
     catch (Exception ex)
     {
         _errorLog.LogException(ex);
         throw;
     }
 }
Exemple #3
0
 public StatusType SaveStatusDetails(StatusTypeAc status)
 {
     try
     {
         var statusType = new StatusType
         {
             Name            = status.Name,
             IsClosed        = status.IsClosed,
             CreatedDateTime = DateTime.UtcNow
         };
         _statusDataRepository.Add(statusType);
         _statusDataRepository.SaveChanges();
         return(statusType);
     }
     catch (Exception ex)
     {
         _errorLog.LogException(ex);
         throw;
     }
 }
Exemple #4
0
 public IHttpActionResult UpdateStatusDetails(StatusTypeAc statusTypeDetails)
 {
     try
     {
         if (HttpContext.Current.User.Identity.IsAuthenticated)
         {
             var statusCollection = _workFlowRepository.UpdateStatusDetails(statusTypeDetails);
             return(Ok(statusCollection));
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception ex)
     {
         _errorLog.LogException(ex);
         throw;
     }
 }
Exemple #5
0
 public StatusTypeAc UpdateStatusDetails(StatusTypeAc status)
 {
     try
     {
         int statusCount = _statusDataRepository.Fetch(x => x.Name == status.Name && x.Id != status.StatusId).Count();
         if (statusCount != 0)
         {
             throw new ArgumentException("Name already exists.");
         }
         var statusdetails = _statusDataRepository.GetById(status.StatusId);
         statusdetails.Name             = status.Name;
         statusdetails.IsClosed         = status.IsClosed;
         statusdetails.ModifiedDateTime = DateTime.UtcNow;
         statusdetails.ModifiedDateTime = DateTime.UtcNow;
         _statusDataRepository.Update(statusdetails);
         _statusDataRepository.SaveChanges();
         return(status);
     }
     catch (Exception ex)
     {
         _errorLog.LogException(ex);
         throw;
     }
 }