Exemple #1
0
 public DTO.SearchFormFilterData GetSearchFilter(out Library.DTO.Notification notification)
 {
     notification = new Library.DTO.Notification()
     {
         Type = Library.DTO.NotificationType.Success
     };
     DTO.SearchFormFilterData data = new DTO.SearchFormFilterData();
     try
     {
         using (PurchaseRequestMngEntities context = CreateContext())
         {
             var x = context.SupportMng_PurchaseRequestStatus_View.ToList();
             data.PurchaseRequestStatusDTOs = AutoMapper.Mapper.Map <List <SupportMng_PurchaseRequestStatus_View>, List <DTO.PurchaseRequestStatusDTO> >(x);
             return(data);
         }
     }
     catch (Exception ex)
     {
         notification.Type    = Library.DTO.NotificationType.Error;
         notification.Message = ex.Message;
         notification.DetailMessage.Add(ex.Message);
         if (ex.GetBaseException() != null)
         {
             notification.DetailMessage.Add(ex.GetBaseException().Message);
         }
         return(data);
     }
 }
Exemple #2
0
 public DTO.SearchFormFilterData GetSearchFilter(out Library.DTO.Notification notification)
 {
     notification = new Library.DTO.Notification()
     {
         Type = Library.DTO.NotificationType.Success
     };
     DTO.SearchFormFilterData       data            = new DTO.SearchFormFilterData();
     Module.Support.DAL.DataFactory support_factory = new Support.DAL.DataFactory();
     try
     {
         data.ProductionItemTypes = support_factory.GetProductionItemType();
         data.Months = Library.Helper.GetMonths();
         data.Years  = Library.Helper.GetYears();
     }
     catch (Exception ex)
     {
         Exception iEx = Library.Helper.GetInnerException(ex);
         notification.Type    = NotificationType.Error;
         notification.Message = iEx.Message;
     }
     return(data);
 }