// // CUSTOM FUNCTION HERE // public DTO.SupportFormData GetInitData(int userId, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success }; DTO.SupportFormData data = new DTO.SupportFormData(); data.SaleDTOs = new List <DTO.SaleDTO>(); try { using (AccManagerPerformanceRptEntities context = CreateContext()) { if (fwFactory.HasSpecialPermission(userId, Module.Framework.ConstantIdentifier.SPECIAL_PERMISSION_VIEW_ALL_SALES_DATA)) { data.SaleDTOs.Add(new DTO.SaleDTO { UserID = -1, EmployeeNM = "All Account Manager" }); data.SaleDTOs.AddRange(converter.DB2DTO_Sale(context.SupportMng_ActiveSales_View.ToList())); } else { data.SaleDTOs = converter.DB2DTO_Sale(context.SupportMng_ActiveSales_View.Where(o => o.UserID == userId).ToList()); } } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.HandleExceptionSingleLine(ex); } return(data); }
public object GetProductWithFilters(int userID, System.Collections.Hashtable filters, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification(); notification.Type = Library.DTO.NotificationType.Success; DTO.SupportFormData data = new DTO.SupportFormData(); try { string searchQuery = (filters.ContainsKey("searchQuery") && filters["searchQuery"] != null && !string.IsNullOrEmpty(filters["searchQuery"].ToString())) ? filters["searchQuery"].ToString() : null; string modelID = (filters.ContainsKey("modelID") && filters["modelID"] != null && !string.IsNullOrEmpty(filters["modelID"].ToString())) ? filters["modelID"].ToString() : null; using (var context = CreateContext()) { data.SupportProduct = converter.DB2DTO_ProductPAL(context.ProductBreakDownPAL_function_SupportProductPAL(searchQuery, modelID, userID).ToList()); return(data.SupportProduct); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.GetInnerException(ex).Message; } return(data); }
private void GetQualityInspectionCorrectAction(out DTO.SupportFormData data) { data = new DTO.SupportFormData() { CorrectActionData = new DTO.QualityInspectionCorrectActionData(), CorrectActionList = new List <DTO.QualityInspectionCorrectActionData>() }; using (var context = CreateContext()) { data.CorrectActionList = converter.DB2DTO_QualityInspectionCorrectActions(context.QualityInspectionRpt_QualityInspectionCorrectAction_View.ToList()); } }
private void GetQualityInspectionType(out DTO.SupportFormData data) { data = new DTO.SupportFormData() { TypeData = new DTO.QualityInspectionTypeData(), TypeList = new List <DTO.QualityInspectionTypeData>() }; using (var context = CreateContext()) { data.TypeList = converter.DB2DTO_QualityInspectionTypes(context.QualityInspectionRpt_QualityInspectionType_View.ToList()); } }
private void GetQualityInspectionDefaultSetting(out DTO.SupportFormData data) { data = new DTO.SupportFormData() { SupportWorkCenter = new List <Support.DTO.WorkCenter>(), DefaultSettingData = new DTO.QualityInspectionDefaultSettingData(), DefaultSettingList = new List <DTO.QualityInspectionDefaultSettingData>() }; using (var context = CreateContext()) { data.DefaultSettingList = converter.DB2DTO_QualityInspectionDefaultSettings(context.QualityInspectionRpt_QualityInspectionDefaultSetting_View.ToList()); } Support.DAL.DataFactory supportFactory = new Support.DAL.DataFactory(); data.SupportWorkCenter = supportFactory.GetWorkCenter(); }
// // CUSTOM FUNCTION HERE // public DTO.SupportFormData GetSearchFilter(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success }; DTO.SupportFormData data = new DTO.SupportFormData(); data.QuotationStatusDTOs = new List <DTO.QuotationStatusDTO>(); //try to get data try { using (FactoryQuotation2MngEntities context = CreateContext()) { data.QuotationStatusDTOs = converter.DB2DTO_QuotationStatus(context.SupportMng_QuotationStatus_View.ToList()); // // ADD CUSTOM STATUS AS REQUESTED - HARD CODE // List <int> toBeRemoveItems = new List <int>(); foreach (var item in data.QuotationStatusDTOs) { if (item.QuotationStatusID != 1 && item.QuotationStatusID != 3 && item.QuotationStatusID != 5) { toBeRemoveItems.Add(item.QuotationStatusID); } } foreach (int id in toBeRemoveItems) { data.QuotationStatusDTOs.Remove(data.QuotationStatusDTOs.FirstOrDefault(o => o.QuotationStatusID == id)); } data.QuotationStatusDTOs.Add(new DTO.QuotationStatusDTO { QuotationStatusID = -1, QuotationStatusNM = "ITEMS COSTPRICE" }); data.QuotationStatusDTOs.Add(new DTO.QuotationStatusDTO { QuotationStatusID = -2, QuotationStatusNM = "ITEMS NO COSTPRICE" }); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = ex.Message; } return(data); }
// // CUSTOM FUNCTION HERE // public DTO.SupportFormData GetInitData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success }; DTO.SupportFormData data = new DTO.SupportFormData(); try { data.SupportWorkCenterDTOs = supportFactory.GetWorkCenter(); data.SupportWorkOrderStatusDTOs = supportFactory.GetWorkOrderStatus(); } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.GetInnerException(ex).Message; } return(data); }
// // CUSTOM FUNCTION HERE // public DTO.SupportFormData GetInitData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success }; DTO.SupportFormData data = new DTO.SupportFormData(); try { using (AdditionalConditionEntities context = Createcontext()) { data.AdditionalConditionTypeDTO = converter.DB2DTO_Support_AdditionalConditionTypeDTO(context.Support_AdditionalCondition_View.ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.HandleExceptionSingleLine(ex); } return(data); }
// // CUSTOM FUNCTION HERE // public DTO.SupportFormData GetInitData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success }; DTO.SupportFormData data = new DTO.SupportFormData(); try { using (OfferSeasonQuotationRequestMngEntities context = CreateContext()) { data.FactoryDTOs = converter.DB2DTO_Factory(context.OfferSeasonQuotatonRequestMng_Factory_View.ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.HandleExceptionSingleLine(ex); } return(data); }
// // CUSTOM FUNCTION HERE // public DTO.SupportFormData GetInitData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success }; DTO.SupportFormData data = new DTO.SupportFormData(); data.WorkCenterDTOs = new List <DTO.WorkCenterDTO>(); try { using (MasterGrantChartRptEntities context = CreateContext()) { data.WorkCenterDTOs = converter.DB2DTO_WorkCenterList(context.WorkCenter.ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.GetInnerException(ex).Message; } return(data); }
// // CUSTOM FUNCTION HERE // public DTO.SupportFormData GetInitData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success }; DTO.SupportFormData data = new DTO.SupportFormData(); data.ContainerTypeDTOs = new List <DTO.ContainerTypeDTO>(); try { using (CPLoadingPlanEntities context = CreateContext()) { data.ContainerTypeDTOs = converter.DB2DTO(context.SupportMng_ContainerType_View.ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.GetInnerException(ex).Message; } return(data); }
// // CUSTOM FUNCTION HERE // public DTO.SupportFormData GetInitData(out Library.DTO.Notification notification) { //throw new NotImplementedException(); notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success }; DTO.SupportFormData data = new DTO.SupportFormData(); data.PhongBanDTOs = new List <DTO.PhongBanDTO>(); try { using (NhanVienMngEntities context = CreateContext()) { data.PhongBanDTOs = converter.DB2DTO_PhongBanDTO(context.NhanVienMng_PhongBan_View.ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.GetInnerException(ex).Message; } return(data); }
public DTO.SupportFormData GetFactories(int userId, out Library.DTO.Notification notification) { notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success }; DTO.SupportFormData data = new DTO.SupportFormData(); data.FactoryDTOs = new List <DTO.FactoryDTO>(); try { using (EstimatedPurchasingPriceMngEntities context = CreateContext()) { data.FactoryDTOs = converter.DB2DTO_Factory(context.EstimatedPurchasingPriceMng_function_GetAuthorizedFactory(userId).ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.GetInnerException(ex).Message; } return(data); }
public DTO.SupportFormData GetSearchFilter(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success }; DTO.SupportFormData data = new DTO.SupportFormData(); data.SaleDTOs = new List <DTO.SaleDTO>(); try { using (MIDeltaByClientRptEntities context = CreateContext()) { data.SaleDTOs.Add(new DTO.SaleDTO { UserID = -1, SaleUD = "GEN", EmployeeNM = "General" }); data.SaleDTOs.AddRange(converter.DB2DTO_SaleDTO(context.SupportMng_AccountManager_View.Where(o => o.IsAccountManager).ToList())); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.GetInnerException(ex).Message; } return(data); }
// // CUSTOM FUNCTION HERE // public DTO.SupportFormData GetInitData(out Library.DTO.Notification notification) { notification = new Library.DTO.Notification { Type = Library.DTO.NotificationType.Success }; DTO.SupportFormData data = new DTO.SupportFormData(); try { using (DefectsEntities context = CreateContext()) { data.DefectsGroups = converter.DB2DTO_Defects(context.DefectsGroupMng_DefectsGroup_View.ToList()); } using (DefectsEntities context = CreateContext()) { data.TypeOfDefectDTO = converter.DB2DTO_TypeOfDefects(context.Support_TypeOfDefects_View.ToList()); } } catch (Exception ex) { notification.Type = Library.DTO.NotificationType.Error; notification.Message = Library.Helper.HandleExceptionSingleLine(ex); } return(data); }