private void ChangeView(eViewType viewType, GridControl gridCtl) { switch (viewType) { case eViewType.GridView: gridCtl.MainView = this.grvQrySummary; this.grvQrySummary.ExpandAllGroups(); //GridView gView = (GridView)gridCtl.MainView; //UiUtility.RemoveActiveRow(gView); break; case eViewType.CardView: //gridCtl.MainView = this.cdvQrySummary; break; case eViewType.BandedView: gridCtl.MainView = this.brvQrySummary; this.brvQrySummary.ExpandAllGroups(); //BandedGridView bView = (BandedGridView)gridCtl.MainView; //UiUtility.RemoveActiveRow(bView); break; case eViewType.AdvanceView: break; default: break; } }
private eViewType GetDefaultViewType(GridControl gridCtl) { eViewType result = eViewType.GridView; switch (gridCtl.Views[0].GetType().Name) { case "GridView": result = eViewType.GridView; break; case "CardView": result = eViewType.CardView; break; case "BandedGridView": result = eViewType.BandedView; break; case "AdvBandedGridView": result = eViewType.AdvanceView; break; default: break; } return(result); }
private void ChangeView(eViewType viewType, GridControl gridCtl) { switch (viewType) { case eViewType.GridView: break; case eViewType.CardView: break; case eViewType.BandedView: gridCtl.MainView = this.brvQrySummary; this.brvQrySummary.ExpandAllGroups(); break; case eViewType.AdvanceView: break; default: break; } this.ConditionsColumnView(gridCtl); }
private void SetViewer(eViewType viewType) { if (m_characterViewerDic.ContainsKey(viewType)) { m_viewType = viewType; m_currentSubCharacterViewer = m_characterViewerDic[m_viewType]; m_currentSubCharacterViewer.Init(this); if (m_actorRootLook != null) { } if (m_viewType == eViewType.Map) { } } }
private void OnGUISubEditor() { EditorGUILayout.BeginVertical("box", GUILayout.ExpandWidth(true)); { eViewType newState = (eViewType)GUILayout.Toolbar((int)m_viewType, System.Enum.GetNames(typeof(eViewType))); if (m_viewType != newState) { SetViewer(newState); } EditorGUILayout.BeginVertical("box"); { wantsMouseMove = true; if (m_currentSubCharacterViewer != null) { m_currentSubCharacterViewer.OnGUI(); } } EditorGUILayout.EndVertical(); } EditorGUILayout.EndVertical(); }
private void ViewComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (ViewComboBox.SelectedValue != null) { if (ViewComboBox.SelectedValue.ToString() == eViewType.Coverage.ToString()) { mViewType = eViewType.Coverage; DetailsGrid.Title = "Ginger Automation Coverage"; DetailsGrid.ChangeGridView("Coverage"); ExecutionFilters.Visibility = System.Windows.Visibility.Collapsed; } else { mViewType = eViewType.Execution; DetailsGrid.Title = "Ginger Executions History"; DetailsGrid.ChangeGridView("Execution"); ExecutionFilters.Visibility = System.Windows.Visibility.Visible; } } SetPieData(); }
public static ReportDataSet GetReportDataset(int pViewid, int pCustomerId, eViewType pViewType, int pAccountId = 0, string pDatabaseConnection = "") { /** * reason for this is that web portal calls does not recognize user session instance. * so we needed to override the connection string to accept both web portal and application level. */ if (string.IsNullOrEmpty(pDatabaseConnection)) pDatabaseConnection = UserSession.ProviderConnection; else { pDatabaseConnection = pDatabaseConnection.Replace(""", "'"); pDatabaseConnection = pDatabaseConnection.Replace("metadata=res://*/BrightPlatform.csdl|res://*/BrightPlatform.ssdl|res://*/BrightPlatform.msl;provider=System.Data.SqlClient;provider connection string=", ""); pDatabaseConnection = pDatabaseConnection.Replace("\"", ""); } ReportDataSet adt = new ReportDataSet(); accountTableAdapter ata = new accountTableAdapter(); contactTableAdapter cta = new contactTableAdapter(); customersTableAdapter _taCustomer = new customersTableAdapter(); ata.Connection = new System.Data.SqlClient.SqlConnection(pDatabaseConnection); cta.Connection = new System.Data.SqlClient.SqlConnection(pDatabaseConnection); _taCustomer.Connection = new System.Data.SqlClient.SqlConnection(pDatabaseConnection); if (pViewType == eViewType.AccountsContactsWithDialogData) { ata.Fill(adt.account, pViewid, pAccountId); cta.Fill(adt.contact, pViewid, pAccountId); } else if (pViewType == eViewType.AccountsContactsWithCallAttempts) { ata.FillByGetReportAccountDataWithCallAttempts(adt.account, pViewid, pAccountId); cta.FillByGetReportContactDataWithCallAttempts(adt.contact, pViewid, pAccountId); } _taCustomer.Fill(adt.customers, pCustomerId); return adt; }
/// <summary> /// Sets the focused view instance of the grid. Instantiates the objects that can be used for data manipulation. /// </summary> private void SetFocusedViewInstance(eViewType ViewType) { m_objGridView = null; switch (ViewType) { case eViewType.Company: { m_objCompany = null; m_objGridView = gcCompany.FocusedView as GridView; m_objCompany = m_objGridView.GetFocusedRow() as CTCompanyList; break; } case eViewType.Contact: { m_objContact = null; m_objGridView = gcContact.FocusedView as GridView; m_objContact = m_objGridView.GetFocusedRow() as CTContact; break; } } }
public static ObjectQuery GetSubCampaigns(eViewType ViewType, int CampaignId, int CustomerId) { ObjectQuery objSubCampaignList = null; /* using (BrightPlatformEntities m_objBrightPlatformEntity = new BrightPlatformEntities(UserSession.EntityConnection)) { switch (ViewType) { case eViewType.SubCampaignView_ManagerAdmin: { var objSubCampaigns = from objSubCampaign in m_objBrightPlatformEntity.subcampaigns join objEntityCampaign in m_objBrightPlatformEntity.campaigns on objSubCampaign.campaign_id equals objEntityCampaign.id into objEntityCampaign from objCampaign in objEntityCampaign.DefaultIfEmpty() join objEntityCustomer in m_objBrightPlatformEntity.customers on objCampaign.customer_id equals objEntityCustomer.id into objEntityCustomer from objCustomer in objEntityCustomer.DefaultIfEmpty() join objEntityOwner in m_objBrightPlatformEntity.users on objSubCampaign.campaign_manager_user_id equals objEntityOwner.id into objEntityOwner from objOwner in objEntityOwner.DefaultIfEmpty() join objEntityDialog in m_objBrightPlatformEntity.dialogs on new { sid = objSubCampaign.id, ac = true } equals new { sid = objEntityDialog.subcampaign_id, ac = objEntityDialog.is_active } into objEntityDialog from objDialog in objEntityDialog.DefaultIfEmpty() orderby objCustomer.customer_name, objCampaign.campaign_name, objSubCampaign.title select new SubCampaignInstance { id = objSubCampaign.id, customer_name = objCustomer.customer_name, campaign_name = objCampaign.campaign_name, sub_campaign_name = objSubCampaign.title, campaign_status = objCampaign.status, sub_campaign_status = objSubCampaign.status, dialog_name = objDialog.name, list_name = objSubCampaign.list_name, campaign_owner_name = objOwner.fullname, campaign_priority = (byte)(objCampaign.priority == null ? 0 : objCampaign.priority), sub_campaign_priority = (int)(objSubCampaign.priority == null ? 0 : objSubCampaign.priority), start_date = (DateTime)objSubCampaign.start_date, end_date = (DateTime)objSubCampaign.end_date, campaign_id = (int)(objCampaign.id == null ? 0 : objCampaign.id), customer_id = (int)(objCustomer.id == null ? 0 : objCustomer.id), owner_id = (int)(objOwner.id == null ? 0 : objOwner.id), list_id = 0, //todo: implement later of finalized description = objSubCampaign.description }; objSubCampaignList = (ObjectQuery)objSubCampaigns; break; } case eViewType.SubCampaignView_ManagerUser: { var objSubCampaigns = from objSubCampaign in m_objBrightPlatformEntity.subcampaigns join objCampaign in m_objBrightPlatformEntity.campaigns on objSubCampaign.campaign_id equals objCampaign.id join objUserCustomer in m_objBrightPlatformEntity.user_customers on new { user_id = UserSession.CurrentUser.UserId, customer_id = objCampaign.customer_id } equals new { user_id = objUserCustomer.user_id, customer_id = objUserCustomer.customer_id } //join objEntityCampaign in m_objBrightPlatformEntity.campaigns on objSubCampaign.campaign_id equals objEntityCampaign.id into objEntityCampaign //from objCampaign in objEntityCampaign.DefaultIfEmpty() join objEntityCustomer in m_objBrightPlatformEntity.customers on objCampaign.customer_id equals objEntityCustomer.id into objEntityCustomer from objCustomer in objEntityCustomer.DefaultIfEmpty() join objEntityOwner in m_objBrightPlatformEntity.users on objSubCampaign.campaign_manager_user_id equals objEntityOwner.id into objEntityOwner from objOwner in objEntityOwner.DefaultIfEmpty() join objEntityDialog in m_objBrightPlatformEntity.dialogs on new { sid = objSubCampaign.id, ac = true } equals new { sid = objEntityDialog.subcampaign_id, ac = objEntityDialog.is_active } into objEntityDialog from objDialog in objEntityDialog.DefaultIfEmpty() //where objCampaign.customer_id == CustomerId orderby objCustomer.customer_name, objCampaign.campaign_name, objSubCampaign.title select new SubCampaignInstance { id = objSubCampaign.id, customer_name = objCustomer.customer_name, campaign_name = objCampaign.campaign_name, sub_campaign_name = objSubCampaign.title, campaign_status = objCampaign.status, sub_campaign_status = objSubCampaign.status, dialog_name = objDialog.name, list_name = objSubCampaign.list_name, campaign_owner_name = objOwner.fullname, campaign_priority = (byte)(objCampaign.priority == null ? 0 : objCampaign.priority), sub_campaign_priority = (int)(objSubCampaign.priority == null ? 0 : objSubCampaign.priority), start_date = (DateTime)objSubCampaign.start_date, end_date = (DateTime)objSubCampaign.end_date, campaign_id = (int)(objCampaign.id == null ? 0 : objCampaign.id), customer_id = (int)(objCustomer.id == null ? 0 : objCustomer.id), owner_id = (int)(objOwner.id == null ? 0 : objOwner.id), list_id = 0, //todo: implement later of finalized description = objSubCampaign.description }; objSubCampaignList = (ObjectQuery)objSubCampaigns; break; } case eViewType.ComboListView: { var objSubCampaigns = from objSubCampaign in m_objBrightPlatformEntity.subcampaigns join objCampaign in m_objBrightPlatformEntity.campaigns on objSubCampaign.campaign_id equals objCampaign.id where objSubCampaign.campaign_id == CampaignId && objCampaign.customer_id == CustomerId && objSubCampaign.status != "Deleted" select new { id = objSubCampaign.id, title = objSubCampaign.title }; objSubCampaignList = (ObjectQuery)objSubCampaigns; break; } } } */ /* * https://brightvision.jira.com/browse/PLATFORM-3169 * DAN: In causes the error so remodified the code */ BrightPlatformEntities m_objBrightPlatformEntity = new BrightPlatformEntities(UserSession.EntityConnection); switch (ViewType) { case eViewType.SubCampaignView_ManagerAdmin: { var objSubCampaigns = from objSubCampaign in m_objBrightPlatformEntity.subcampaigns join objEntityCampaign in m_objBrightPlatformEntity.campaigns on objSubCampaign.campaign_id equals objEntityCampaign.id into objEntityCampaign from objCampaign in objEntityCampaign.DefaultIfEmpty() join objEntityCustomer in m_objBrightPlatformEntity.customers on objCampaign.customer_id equals objEntityCustomer.id into objEntityCustomer from objCustomer in objEntityCustomer.DefaultIfEmpty() join objEntityOwner in m_objBrightPlatformEntity.users on objSubCampaign.campaign_manager_user_id equals objEntityOwner.id into objEntityOwner from objOwner in objEntityOwner.DefaultIfEmpty() join objEntityDialog in m_objBrightPlatformEntity.dialogs on new { sid = objSubCampaign.id, ac = true } equals new { sid = objEntityDialog.subcampaign_id, ac = objEntityDialog.is_active } into objEntityDialog from objDialog in objEntityDialog.DefaultIfEmpty() orderby objCustomer.customer_name, objCampaign.campaign_name, objSubCampaign.title select new SubCampaignInstance { id = objSubCampaign.id, customer_name = objCustomer.customer_name, campaign_name = objCampaign.campaign_name, sub_campaign_name = objSubCampaign.title, campaign_status = objCampaign.status, sub_campaign_status = objSubCampaign.status, dialog_name = objDialog.name, list_name = objSubCampaign.list_name, campaign_owner_name = objOwner.fullname, campaign_priority = (byte)(objCampaign.priority == null ? 0 : objCampaign.priority), sub_campaign_priority = (int)(objSubCampaign.priority == null ? 0 : objSubCampaign.priority), start_date = (DateTime)objSubCampaign.start_date, end_date = (DateTime)objSubCampaign.end_date, campaign_id = (int)(objCampaign.id == null ? 0 : objCampaign.id), customer_id = (int)(objCustomer.id == null ? 0 : objCustomer.id), owner_id = (int)(objOwner.id == null ? 0 : objOwner.id), list_id = 0, //todo: implement later of finalized description = objSubCampaign.description }; objSubCampaignList = (ObjectQuery)objSubCampaigns; break; } case eViewType.SubCampaignView_ManagerUser: { var objSubCampaigns = from objSubCampaign in m_objBrightPlatformEntity.subcampaigns join objCampaign in m_objBrightPlatformEntity.campaigns on objSubCampaign.campaign_id equals objCampaign.id join objUserCustomer in m_objBrightPlatformEntity.user_customers on new { user_id = UserSession.CurrentUser.UserId, customer_id = objCampaign.customer_id } equals new { user_id = objUserCustomer.user_id, customer_id = objUserCustomer.customer_id } //join objEntityCampaign in m_objBrightPlatformEntity.campaigns on objSubCampaign.campaign_id equals objEntityCampaign.id into objEntityCampaign //from objCampaign in objEntityCampaign.DefaultIfEmpty() join objEntityCustomer in m_objBrightPlatformEntity.customers on objCampaign.customer_id equals objEntityCustomer.id into objEntityCustomer from objCustomer in objEntityCustomer.DefaultIfEmpty() join objEntityOwner in m_objBrightPlatformEntity.users on objSubCampaign.campaign_manager_user_id equals objEntityOwner.id into objEntityOwner from objOwner in objEntityOwner.DefaultIfEmpty() join objEntityDialog in m_objBrightPlatformEntity.dialogs on new { sid = objSubCampaign.id, ac = true } equals new { sid = objEntityDialog.subcampaign_id, ac = objEntityDialog.is_active } into objEntityDialog from objDialog in objEntityDialog.DefaultIfEmpty() //where objCampaign.customer_id == CustomerId orderby objCustomer.customer_name, objCampaign.campaign_name, objSubCampaign.title select new SubCampaignInstance { id = objSubCampaign.id, customer_name = objCustomer.customer_name, campaign_name = objCampaign.campaign_name, sub_campaign_name = objSubCampaign.title, campaign_status = objCampaign.status, sub_campaign_status = objSubCampaign.status, dialog_name = objDialog.name, list_name = objSubCampaign.list_name, campaign_owner_name = objOwner.fullname, campaign_priority = (byte)(objCampaign.priority == null ? 0 : objCampaign.priority), sub_campaign_priority = (int)(objSubCampaign.priority == null ? 0 : objSubCampaign.priority), start_date = (DateTime)objSubCampaign.start_date, end_date = (DateTime)objSubCampaign.end_date, campaign_id = (int)(objCampaign.id == null ? 0 : objCampaign.id), customer_id = (int)(objCustomer.id == null ? 0 : objCustomer.id), owner_id = (int)(objOwner.id == null ? 0 : objOwner.id), list_id = 0, //todo: implement later of finalized description = objSubCampaign.description }; objSubCampaignList = (ObjectQuery)objSubCampaigns; break; } case eViewType.ComboListView: { var objSubCampaigns = from objSubCampaign in m_objBrightPlatformEntity.subcampaigns join objCampaign in m_objBrightPlatformEntity.campaigns on objSubCampaign.campaign_id equals objCampaign.id where objSubCampaign.campaign_id == CampaignId && objCampaign.customer_id == CustomerId && objSubCampaign.status != "Deleted" select new { id = objSubCampaign.id, title = objSubCampaign.title }; objSubCampaignList = (ObjectQuery)objSubCampaigns; break; } } return objSubCampaignList; }
/// <summary> /// Get sub-campaign records /// </summary> public static List<SubCampaignInstance> GetSubCampaignList(eViewType ViewType, int CampaignId, int CustomerId) { List<SubCampaignInstance> objSubCampaignList = new List<SubCampaignInstance>(); using (BrightPlatformEntities m_objBrightPlatformEntity = new BrightPlatformEntities(UserSession.EntityConnection)) { switch (ViewType) { case eViewType.SubCampaignView_ManagerAdmin: { var objSubCampaigns = from objSubCampaign in m_objBrightPlatformEntity.subcampaigns join objEntityCampaign in m_objBrightPlatformEntity.campaigns on objSubCampaign.campaign_id equals objEntityCampaign.id into objEntityCampaign from objCampaign in objEntityCampaign.DefaultIfEmpty() join objEntityCustomer in m_objBrightPlatformEntity.customers on objCampaign.customer_id equals objEntityCustomer.id into objEntityCustomer from objCustomer in objEntityCustomer.DefaultIfEmpty() join objEntityOwner in m_objBrightPlatformEntity.users on objSubCampaign.campaign_manager_user_id equals objEntityOwner.id into objEntityOwner from objOwner in objEntityOwner.DefaultIfEmpty() join objEntityDialog in m_objBrightPlatformEntity.dialogs on new { sid = objSubCampaign.id, ac = true } equals new { sid = objEntityDialog.subcampaign_id, ac = objEntityDialog.is_active } into objEntityDialog from objDialog in objEntityDialog.DefaultIfEmpty() orderby objCustomer.customer_name, objCampaign.campaign_name, objSubCampaign.title select new SubCampaignInstance { id = objSubCampaign.id, customer_name = objCustomer.customer_name, campaign_name = objCampaign.campaign_name, sub_campaign_name = objSubCampaign.title, campaign_status = objCampaign.status, sub_campaign_status = objSubCampaign.status, dialog_name = objDialog.name, list_name = objSubCampaign.list_name, campaign_owner_name = objOwner.fullname, campaign_priority = (byte)(objCampaign.priority == null ? 0 : objCampaign.priority), sub_campaign_priority = (int)(objSubCampaign.priority == null ? 0 : objSubCampaign.priority), start_date = (DateTime)objSubCampaign.start_date, end_date = (DateTime)objSubCampaign.end_date, campaign_id = (int)(objCampaign.id == null ? 0 : objCampaign.id), customer_id = (int)(objCustomer.id == null ? 0 : objCustomer.id), owner_id = (int)(objOwner.id == null ? 0 : objOwner.id), list_id = 0, //todo: implement later of finalized description = objSubCampaign.description }; objSubCampaignList = objSubCampaigns.ToList(); break; } case eViewType.SubCampaignView_ManagerUser: { var objSubCampaigns = from objSubCampaign in m_objBrightPlatformEntity.subcampaigns join objCampaign in m_objBrightPlatformEntity.campaigns on objSubCampaign.campaign_id equals objCampaign.id join objUserCustomer in m_objBrightPlatformEntity.user_customers on new { user_id = UserSession.CurrentUser.UserId, customer_id = objCampaign.customer_id } equals new { user_id = objUserCustomer.user_id, customer_id = objUserCustomer.customer_id } //join objEntityCampaign in m_objBrightPlatformEntity.campaigns on objSubCampaign.campaign_id equals objEntityCampaign.id into objEntityCampaign //from objCampaign in objEntityCampaign.DefaultIfEmpty() join objEntityCustomer in m_objBrightPlatformEntity.customers on objCampaign.customer_id equals objEntityCustomer.id into objEntityCustomer from objCustomer in objEntityCustomer.DefaultIfEmpty() join objEntityOwner in m_objBrightPlatformEntity.users on objSubCampaign.campaign_manager_user_id equals objEntityOwner.id into objEntityOwner from objOwner in objEntityOwner.DefaultIfEmpty() join objEntityDialog in m_objBrightPlatformEntity.dialogs on new { sid = objSubCampaign.id, ac = true } equals new { sid = objEntityDialog.subcampaign_id, ac = objEntityDialog.is_active } into objEntityDialog from objDialog in objEntityDialog.DefaultIfEmpty() //where objCampaign.customer_id == CustomerId orderby objCustomer.customer_name, objCampaign.campaign_name, objSubCampaign.title select new SubCampaignInstance { id = objSubCampaign.id, customer_name = objCustomer.customer_name, campaign_name = objCampaign.campaign_name, sub_campaign_name = objSubCampaign.title, campaign_status = objCampaign.status, sub_campaign_status = objSubCampaign.status, dialog_name = objDialog.name, list_name = objSubCampaign.list_name, campaign_owner_name = objOwner.fullname, campaign_priority = (byte)(objCampaign.priority == null ? 0 : objCampaign.priority), sub_campaign_priority = (int)(objSubCampaign.priority == null ? 0 : objSubCampaign.priority), start_date = (DateTime)objSubCampaign.start_date, end_date = (DateTime)objSubCampaign.end_date, campaign_id = (int)(objCampaign.id == null ? 0 : objCampaign.id), customer_id = (int)(objCustomer.id == null ? 0 : objCustomer.id), owner_id = (int)(objOwner.id == null ? 0 : objOwner.id), list_id = 0, //todo: implement later of finalized description = objSubCampaign.description }; objSubCampaignList = objSubCampaigns.ToList(); break; } } } return objSubCampaignList; }
/// <summary> /// Gets the manager records /// </summary> public static ObjectQuery GetCustomers(eViewType ViewType) { BrightPlatformEntities m_objBrightPlatformEntity = new BrightPlatformEntities(UserSession.EntityConnection); ObjectQuery objCustomers = null; switch (ViewType) { #region eViewType.SubCampaignView case eViewType.SubCampaignView: { var objEntityCustomers = from objCustomer in m_objBrightPlatformEntity.customers where objCustomer.customer_name != "" orderby objCustomer.customer_name select new { id = objCustomer.id, name = objCustomer.customer_name }; objCustomers = (ObjectQuery) objEntityCustomers; break; } #endregion #region eViewType.UserView case eViewType.UserView: { var objEntityCustomers = from objCustomer in m_objBrightPlatformEntity.customers orderby objCustomer.customer_name select new { id = objCustomer.id, customer_name = objCustomer.customer_name }; objCustomers = (ObjectQuery) objEntityCustomers; break; } #endregion #region eViewType.CustomerView case eViewType.CustomerView: { var objEntityCustomers = from objCustomer in m_objBrightPlatformEntity.customers where objCustomer.customer_name != "" orderby objCustomer.customer_name select new ObjectCustomer.CustomerInstance { id = objCustomer.id, customer_name = objCustomer.customer_name, org_no = objCustomer.org_no, reference_no = objCustomer.reference_no, active = objCustomer.disabled.Equals("0")? true: false, owner_name = objCustomer.owner, address = objCustomer.ship_address1 + " " + objCustomer.ship_address2 + " " + objCustomer.ship_address3 + " " + objCustomer.ship_address4 + " " + objCustomer.ship_address5, description = objCustomer.description }; objCustomers = (ObjectQuery) objEntityCustomers; break; } #endregion #region eViewType.ComboListView case eViewType.ComboListView: { var objEntityCustomers = from objCustomer in m_objBrightPlatformEntity.customers orderby objCustomer.customer_name where objCustomer.customer_name != "" select new { id = objCustomer.id, customer_name = objCustomer.customer_name }; objCustomers = (ObjectQuery) objEntityCustomers; break; } #endregion #region eViewType.CustomerCampaign_ManagerAdmin case eViewType.CustomerCampaign_ManagerAdmin: { var objEntityCustomers = from objCustomer in m_objBrightPlatformEntity.customers where objCustomer.customer_name != "" orderby objCustomer.customer_name select new ObjectCustomer.CustomerInstance { id = objCustomer.id, customer_name = objCustomer.customer_name, org_no = objCustomer.org_no, reference_no = objCustomer.reference_no, active = objCustomer.disabled.Equals("0") ? true : false, owner_name = objCustomer.owner, address = objCustomer.ship_address1 + " " + objCustomer.ship_address2 + " " + objCustomer.ship_address3 + " " + objCustomer.ship_address4 + " " + objCustomer.ship_address5, description = objCustomer.description }; objCustomers = (ObjectQuery)objEntityCustomers; break; } #endregion #region eViewType.CustomerCampaign_ManagerUser case eViewType.CustomerCampaign_ManagerUser: { var objEntityCustomers = from objCustomer in m_objBrightPlatformEntity.customers join objUserCustomer in m_objBrightPlatformEntity.user_customers on objCustomer.id equals objUserCustomer.customer_id where objCustomer.customer_name != "" && objUserCustomer.user_id == UserSession.CurrentUser.UserId orderby objCustomer.customer_name select new ObjectCustomer.CustomerInstance { id = objCustomer.id, customer_name = objCustomer.customer_name, org_no = objCustomer.org_no, reference_no = objCustomer.reference_no, active = objCustomer.disabled.Equals("0") ? true : false, owner_name = objCustomer.owner, address = objCustomer.ship_address1 + " " + objCustomer.ship_address2 + " " + objCustomer.ship_address3 + " " + objCustomer.ship_address4 + " " + objCustomer.ship_address5, description = objCustomer.description }; objCustomers = (ObjectQuery)objEntityCustomers; break; } #endregion } return objCustomers; }
public static void SetViewPorts(int bufferWidth, int bufferHeight, int nrOfViewPorts, eViewType viewType) { ViewType = viewType; if (viewType == eViewType.Normal) { #region normal ViewPorts.Clear(); switch (nrOfViewPorts) { case 1: ViewPorts.Add(new Viewport(0, 0, bufferWidth, bufferHeight)); break; case 2: ViewPorts.Add(new Viewport(0, 0, bufferWidth, bufferHeight / 2)); ViewPorts.Add(new Viewport(0, bufferHeight / 2, bufferWidth, bufferHeight / 2)); break; case 3: throw new NotImplementedException(); case 4: Viewport vp = new Viewport(); vp.X = 0; vp.Y = 0; vp.Width = bufferWidth / 2; vp.Height = bufferHeight / 2; ViewPorts.Add(vp); vp.X = bufferWidth / 2;; vp.Y = 0; vp.Width = bufferWidth / 2; vp.Height = bufferHeight / 2; ViewPorts.Add(vp); vp.X = 0; vp.Y = bufferHeight / 2; vp.Width = bufferWidth / 2; vp.Height = bufferHeight / 2; ViewPorts.Add(vp); vp.X = bufferWidth / 2; vp.Y = bufferHeight / 2; vp.Width = bufferWidth / 2; vp.Height = bufferHeight / 2; ViewPorts.Add(vp); break; default: throw new CaseStatementMissingException(); } #endregion } else { #region vertical ViewPorts.Clear(); switch (nrOfViewPorts) { case 1: ViewPorts.Add(new Viewport(0, 0, bufferWidth, bufferHeight)); break; case 2: ViewPorts.Add(new Viewport(0, 0, bufferWidth / 2, bufferHeight)); ViewPorts.Add(new Viewport(bufferWidth / 2, 0, bufferWidth / 2, bufferHeight)); break; case 3: throw new NotImplementedException(); case 4: ViewPorts.Add(new Viewport(0, 0, bufferWidth / 4, bufferHeight)); ViewPorts.Add(new Viewport(bufferWidth / 4, 0, bufferWidth / 4, bufferHeight)); ViewPorts.Add(new Viewport(bufferWidth / 2, 0, bufferWidth / 4, bufferHeight)); ViewPorts.Add(new Viewport(bufferWidth / 2 + bufferWidth / 4, 0, bufferWidth / 4, bufferHeight)); break; default: throw new CaseStatementMissingException(); } #endregion } }