// // CUSTOM FUNCTION HERE // public SupportFormData GetInitData(int userID, out Notification notification) { notification = new Notification() { Type = NotificationType.Success }; SupportFormData data = new SupportFormData(); data.EmployeeDTOs = new List <EmployeeDTO>(); data.CompanyDTOs = new List <CompanyDTO>(); data.AnnualLeaveStatusDTOs = new List <AnnualLeaveStatusDTO>(); try { using (AnnualLeaveMngEntities context = CreateContext()) { data.EmployeeDTOs = converter.DB2DTO_EmployeeDTO(context.AnnualLeaveMng_Employee_View.ToList()); data.AnnualLeaveStatusDTOs = converter.DB2DTO_AnnualLeaveStatusDTO(context.AnnualLeaveMng_AnnualLeaveStatus_View.ToList()); data.CompanyDTOs = converter.DB2DTO_CompanyDTO(context.AnnualLeaveMng_Company_View.ToList()); } return(data); } catch (Exception ex) { notification.Type = NotificationType.Error; notification.Message = ex.Message; return(data); } }
// // CUSTOM FUNCTION HERE // public override object GetInitData(int userID, out Notification notification) { notification = new Notification() { Type = NotificationType.Success }; Module.Framework.DAL.DataFactory fwFactory = new Module.Framework.DAL.DataFactory(); int?companyID = fwFactory.GetCompanyID(userID); SupportFormData data = new SupportFormData(); data.EmployeeDTOs = new List <EmployeeDTO>(); data.CompanyDTOs = new List <CompanyDTO>(); try { using (AnnualLeaveRptEntities context = CreateContext()) { data.EmployeeDTOs = converter.DB2DTO_EmployeeDTO(context.AnnualLeaveRpt_Employee_View.ToList()); data.CompanyDTOs = converter.DB2DTO_CompanyDTO(context.AnnualLeaveRpt_Company_View.Where(s => s.CompanyID == companyID).ToList()); } return(data); } catch (Exception ex) { notification.Type = NotificationType.Error; notification.Message = ex.Message; return(data); } }
// // CUSTOM FUNCTION HERE // public DTO.SupportFormData GetInitData(out Library.DTO.Notification notification) { SupportFormData data = new SupportFormData(); notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; data.CompanyDTOs = new List <CompanyDTO>(); try { using (AnnualLeaveCalendarMngEntities context = CreateContext()) { data.CompanyDTOs = converter.DB2DTO_CompanyDTOs(context.AnnualLeaveCalendarMng_Company_View.ToList()); } } catch (Exception ex) { notification = new Library.DTO.Notification() { Message = ex.Message, Type = Library.DTO.NotificationType.Error }; } return(data); }
/// <summary> /// List UserNames /// </summary> /// <returns>SupportFormData Dataset</returns> public static SupportFormData ListUserNames() { SupportFormData supportForm = new SupportFormData(); Hashtable ht = new Hashtable(); Utility.LoadDataSet(supportForm.ListUsers, "f9016_pclst_UserNames", ht); return(supportForm); }
/// <summary> /// Gets the form details. /// </summary> /// <param name="form">The form.</param> /// <param name="userId">The user id.</param> /// <returns>Typed dataset</returns> public static SupportFormData F9002_GetFormManagementDetails(int form, int userId) { SupportFormData supportForm = new SupportFormData(); Hashtable ht = new Hashtable(); ht.Add("@Form", form); ht.Add("@UserID", userId); Utility.LoadDataSet(supportForm.GetFormManagementDetails, "f9002_pcget_FormManagement", ht); return(supportForm); }
/// <summary> /// Gets the FormDetails /// </summary> /// <param name="form">The form.</param> /// <param name="userId">The user id.</param> /// <returns>SupportFormData Dataset</returns> public static SupportFormData GetFormDetails(int form, int userId) { SupportFormData supportForm = new SupportFormData(); Hashtable ht = new Hashtable(); ht.Add("@Form", form); ht.Add("@UserID", userId); Utility.LoadDataSet(supportForm.GetFormDetails, "f9016_pcget_SupportFormCall", ht); return(supportForm); }
public SupportFormData GetSupportData(string formName, out Library.DTO.Notification notification) { SupportFormData data = new SupportFormData(); notification = new Library.DTO.Notification() { Type = Library.DTO.NotificationType.Success }; data.MeetingLocationDTOs = new List <MeetingLocationDTO>(); data.Users = new List <Support.DTO.User2>(); data.Sales = new List <SaleDTO>(); data.EmployeeDepartmentDTOs = new List <EmployeeDepartmentDTO>(); data.TimeRange = new List <string>(); data.AppointmentAttachedFileTypes = new List <Support.DTO.AppointmentAttachedFileType>(); try { using (PurchasingCalendarMngEntities context = CreateContext()) { switch (formName) { case "calendar": foreach (PurchasingCalendarMng_MeetingLocation_View location in context.PurchasingCalendarMng_MeetingLocation_View.ToList()) { data.MeetingLocationDTOs.Add(new MeetingLocationDTO() { MeetingLocationID = location.MeetingLocationID.Value, MeetingLocationNM = location.MeetingLocationNM, IsSelected = false }); } break; case "editEvent": data.Users = supportFactory.GetUsers2(); data.EmployeeDepartmentDTOs = converter.DB2DTO_EmployeeDepartment(context.PurchasingCalendarMng_Employee_View.ToList()); data.TimeRange = supportFactory.GetTimeRange(); data.AppointmentAttachedFileTypes = supportFactory.GetAppointmentAttachedFileType(); data.Sales = converter.DB2DTO_SaleList(context.PurchasingCalendarMng_Sale_View.Where(o => o.CompanyID.Value != 3).ToList()); // company different than AVT break; default: break; } } } catch (Exception ex) { notification = new Library.DTO.Notification() { Message = ex.Message, Type = Library.DTO.NotificationType.Error }; } return(data); }
/// <summary> /// Gets the translated form details. /// </summary> /// <param name="formNo">The form no.</param> /// <param name="keyValue">The key value.</param> /// <returns>The support form dataset.</returns> public static SupportFormData GetTranslatedFormDetails(int formNo, string keyValue) { SupportFormData formCallTranslator = new SupportFormData(); Hashtable htt = new Hashtable(); htt.Add("@Form", formNo); htt.Add("@Param1In", keyValue); htt.Add("@Param1Out", 0); htt.Add("@Param2", null); htt.Add("@Param3", null); htt.Add("@Param4", null); Utility.FetchSPExecuteOutputValue(formCallTranslator.FormCallTranslate, "f9016_pcget_FormCallTranslate", htt); return(formCallTranslator); }
// // CUSTOM FUNCTION HERE // public SupportFormData GetInitData(out Notification notification) { notification = new Notification(); notification.Type = NotificationType.Success; SupportFormData data = new SupportFormData(); try { using (ModuleStatusMngEntities context = CreateContext()) { data.Modules = converter.DB2DTO_Modules(context.ModuleStatusMng_Module_View.ToList()); } } catch (Exception ex) { notification.Type = NotificationType.Error; notification.Message = Helper.GetInnerException(ex).Message; } return(data); }