private void HighLightCorrectTab() { if (MultiView.GetActiveView() == ListInvoicesView) { SetActiveTab(ListInvoicesLink); return; } if (MultiView.GetActiveView() == SaveRecieptView) { SetActiveTab(SaveRecieptDetailslink); return; } }
private void DisplaySelectedExtension(string extensionType, DropDownList dropDown, MultiView multiView, View notConfiguredView, Dictionary <string, string> extensionSettings) { // Get the new active view name var newActiveViewName = Null.NullString; if (!string.IsNullOrEmpty(dropDown.SelectedValue)) { newActiveViewName = this.GetExtensionViewName(dropDown.SelectedValue, extensionType); } // Get the current active view var activeView = multiView.GetActiveView(); if (activeView != null && activeView.ID.Equals(newActiveViewName, StringComparison.OrdinalIgnoreCase)) { return; // If current and new active view are the same, just return } // Get the new active view View newActiveView = null; if (string.IsNullOrEmpty(newActiveViewName)) { // If <No Visualizer/DataSource> is selected, use the not configured view newActiveView = notConfiguredView; if (ReferenceEquals(newActiveView, null)) { newActiveView = multiView.Views[0]; } } else { // Otherwise, find the view with the new active view name newActiveView = (View)multiView.FindControl(newActiveViewName); } // Set that view as the active view multiView.SetActiveView(newActiveView); // Get the settings control in the new active view var settingsControl = this.GetSettingsControlFromView(newActiveView); // If we successfully got it, load its settings if (settingsControl != null) { settingsControl.LoadSettings(extensionSettings); } }
private void HighLightCorrectTab() { if (MultiView.GetActiveView() == ListSuppliersView) { SetActiveTab(ListSuppliersLink); return; } if (MultiView.GetActiveView() == SavePurchaseView) { SetActiveTab(SavePurchaseLink); return; } if (MultiView.GetActiveView() == SavePaymentVoucherView) { SetActiveTab(SavePaymentVoucherLink); return; } }
private void HighLightCorrectTab() { if (MultiView.GetActiveView() == ListClientsView) { SetActiveTab(ListClientsLink); return; } if (MultiView.GetActiveView() == SaveSaleItemsView) { SetActiveTab(SaveSaleItemsLink); return; } if (MultiView.GetActiveView() == SaveSaleView) { SetActiveTab(SaveSaleLink); return; } if (MultiView.GetActiveView() == SaveInvoiceView) { SetActiveTab(SaveInvoiceLink); return; } }
public bool fn_validator(int current_view = 0, int border = 0, Color?color = null, MultiView mView = null) { //looops through / iterates all items in form and checks for validation color.GetValueOrDefault(Color.Red); View a = mView.GetActiveView(); if (a.HasControls()) { for (int i = 0; i < a.Controls.Count; i++) { Control control = a.Controls[i]; if (check_control(control)) { // set css styling for control return(true); // so we can check on click next page button to deny } } } return(false); }
/// <summary> /// Handles the ItemDataBound event of the gvProjects control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Telerik.Web.UI.GridItemEventArgs"/> instance containing the event data.</param> protected void gvProjects_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridDataItem) { dynamic project = e.Item.DataItem as dynamic; int projectStatusCodeId = project.ProjectStatusCodeId; #region Project Name HtmlAnchor lnkProject = (HtmlAnchor)e.Item.FindControl("lnkProject"); lnkProject.HRef = string.Format("~/Project/ProjectTeam.aspx?projectid={0}", project.ProjectId); lnkProject.InnerText = Support.TruncateString(project.ProjectName, 20); if (project.ProjectName.Length > 20) { lnkProject.Title = project.ProjectName; } #endregion Project Name #region Payment Status MultiView multStatus = (MultiView)e.Item.FindControl("multStatus"); //bool shouldDisplayLastPayment = false; if (project.ProjectStatusCodeId == activeCodeId) { multStatus.ActiveViewIndex = 1; //shouldDisplayLastPayment = true; } else if (projectStatusCodeId == gracePeriodCodeId || projectStatusCodeId == paymentFailed || ((projectStatusCodeId == suspendCodeId || projectStatusCodeId == closedCodeId) && IsPaymentFailedInvoicesExistForCompany)) { multStatus.ActiveViewIndex = 2; View activeView = multStatus.GetActiveView(); Literal ltrlExpiresOn = (Literal)activeView.FindControl("ltrlExpiresOn"); if (projectStatusCodeId == paymentFailed || ((projectStatusCodeId == suspendCodeId || projectStatusCodeId == closedCodeId) && IsPaymentFailedInvoicesExistForCompany)) { plcPayNow.Visible = true; if (projectStatusCodeId == paymentFailed) { ltrlExpiresOn.Text = "Payment Failed | <strong>Project read-only</strong>"; } else { ltrlExpiresOn.Text = "Payment Failed | " + project.ProjectStatus; } } else if (projectStatusCodeId == gracePeriodCodeId) { ltrlExpiresOn.Text = string.Format("Payment Failed"); } } else if (projectStatusCodeId == freeTrialCodeId || projectStatusCodeId == suspendCodeId || projectStatusCodeId == closedCodeId) { multStatus.ActiveViewIndex = 0; Literal ltrlStatus = (Literal)multStatus.GetActiveView().FindControl("ltrlStatus"); ltrlStatus.Text = project.ProjectStatus; } #endregion Payment Status #region Suspend/ReActivate LinkButton lnkReActivate = (LinkButton)e.Item.FindControl("lnkReActivate"); LinkButton lnkSuspend = (LinkButton)e.Item.FindControl("lnkSuspend"); bool isProjectSuspended = (projectStatusCodeId == suspendCodeId); bool isProjectClosed = (projectStatusCodeId == closedCodeId); bool isFreeTrial = (projectStatusCodeId == freeTrialCodeId); //Check if there are any pending invoices.If so disable the ReActivate button. disable the reactivate for suspended company if (lnkReActivate != null) { lnkReActivate.Visible = !IsPaymentFailedCompany && isProjectSuspended && !isProjectClosed && !HasCompanySuspendedBySBAdmin; Label lblDiabledReActivate = (Label)e.Item.FindControl("lblDiabledReActivate"); if (lblDiabledReActivate != null) { lblDiabledReActivate.Visible = (IsPaymentFailedCompany && isProjectSuspended && !isProjectClosed) || (HasCompanySuspendedBySBAdmin && !isProjectClosed); if (HasCompanySuspendedBySBAdmin) { lblDiabledReActivate.ToolTip = "StageBitz Admin Suspended the Company"; } else if (IsPaymentFailedCompany) { lblDiabledReActivate.ToolTip = "Pending Invoice(s) exist"; } } } Label lblDisabledSuspend = (Label)e.Item.FindControl("lblDisabledSuspend"); if (lnkSuspend != null && lblDisabledSuspend != null) { lnkSuspend.Visible = !isProjectSuspended && !isProjectClosed && !isFreeTrial; lblDisabledSuspend.Visible = isFreeTrial; lblDisabledSuspend.ToolTip = "Projects in Free Trial cannot be suspended."; } #endregion Suspend/ReActivate } }