コード例 #1
0
 public DTO.SupportData GetSupportData(out Library.DTO.Notification notification)
 {
     notification = new Library.DTO.Notification()
     {
         Type = Library.DTO.NotificationType.Success
     };
     DTO.SupportData supportData = new DTO.SupportData();
     try
     {
         Module.Support.DAL.DataFactory support_factory = new Support.DAL.DataFactory();
         supportData.FactoryAreas = support_factory.GetFactoryArea();
         return(supportData);
     }
     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(supportData);
     }
 }
コード例 #2
0
 public override DTO.EditFormData GetData(int id, out Library.DTO.Notification notification)
 {
     DTO.EditFormData editFormData = new DTO.EditFormData();
     notification = new Library.DTO.Notification()
     {
         Type = Library.DTO.NotificationType.Success
     };
     Module.Support.DAL.DataFactory support_factory = new Support.DAL.DataFactory();
     try
     {
         using (FactoryMaterialReceiptEntities context = CreateContext())
         {
             if (id > 0)
             {
                 FactoryMaterialReceiptMng_FactoryMaterialReceipt_View dbItem;
                 dbItem            = context.FactoryMaterialReceiptMng_FactoryMaterialReceipt_View.FirstOrDefault(o => o.FactoryMaterialReceiptID == id);
                 editFormData.Data = converter.DB2DTO_FactoryMaterialReceipt(dbItem);
             }
             else
             {
                 editFormData.Data        = new DTO.FactoryMaterialReceipt();
                 editFormData.Data.Season = Library.Helper.GetCurrentSeason();
                 editFormData.Data.FactoryMaterialReceiptDetails = new List <DTO.FactoryMaterialReceiptDetail>();
             }
             editFormData.Seasons      = support_factory.GetSeason();
             editFormData.FactoryTeams = support_factory.GetFactoryTeam();
             editFormData.FactoryAreas = support_factory.GetFactoryArea();
             editFormData.FactoryGoodsProcedureDetails = support_factory.GetFactoryGoodsProcedureDetail();
             return(editFormData);
         }
     }
     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(editFormData);
     }
 }