Example #1
0
        protected void btnLeaveConfirmLeave_Click(object sender, EventArgs e)
        {
            int hash = sender.GetHashCode();

            for (int i = 0; i < subjectsCatalogRepeater.Items.Count; i++)
            {
                Button button = (Button)subjectsCatalogRepeater.Items[i].FindControl("btnLeaveConfirmLeave");

                if (button.GetHashCode() == hash)
                {
                    Label label = (Label)subjectsCatalogRepeater.Items[i].FindControl("lblSubjectCode");

                    using (DatabaseDataContext db = new DatabaseDataContext())
                    {
                        tblStudentSubject studentSubject = db.tblStudentSubjects.Where(x => x.subjectCode == Convert.ToInt32(label.Text) && x.isVisible && x.studentID == SessionManager.StudentID).FirstOrDefault();

                        studentSubject.isVisible = false;
                        db.SubmitChanges();
                    }

                    MultiView mv = (MultiView)subjectsCatalogRepeater.Items[i].FindControl("mvPanelBody");
                    mv.ActiveViewIndex = 0;

                    mv = (MultiView)subjectsCatalogRepeater.Items[i].FindControl("mvPanelFooter");
                    mv.ActiveViewIndex = 1;
                }
            }
        }
Example #2
0
        protected void btnEnroll_Click(object sender, EventArgs e)
        {
            int hash = sender.GetHashCode();

            for (int i = 0; i < subjectsCatalogRepeater.Items.Count; i++)
            {
                Button button = (Button)subjectsCatalogRepeater.Items[i].FindControl("btnEnroll");

                if (button.GetHashCode() == hash)
                {
                    Label label = (Label)subjectsCatalogRepeater.Items[i].FindControl("lblSubjectCode");

                    DropDownList ddl = (DropDownList)subjectsCatalogRepeater.Items[i].FindControl("ddlChangeTeacher");

                    using (DatabaseDataContext db = new DatabaseDataContext())
                    {
                        var teachers = db.tblTeachers.Where(x => x.subjectCode == Convert.ToInt32(label.Text));

                        ddl.DataTextField  = "teacherFullName";
                        ddl.DataValueField = "teacherID";

                        ControlManager.populateControl(teachers, ddl);

                        Session["ddl"] = Convert.ToInt32(ddl.Items[0].Value);
                    }

                    MultiView mv = (MultiView)subjectsCatalogRepeater.Items[i].FindControl("mvPanelFooter");
                    mv.ActiveViewIndex = 4;

                    mv = (MultiView)subjectsCatalogRepeater.Items[i].FindControl("mvPanelBody");
                    mv.ActiveViewIndex = 1;
                }
            }
        }
        protected override void OnInit(EventArgs e)
        {
            objectdatasourceList = (ObjectDataSource)this.FindControl("objectdatasourceList");
            mvControl            = (MultiView)this.FindControl("mvControl");
            gvList     = (GridView)this.FindControl("gvList");
            lblMessage = (Label)this.FindControl("lblMessage");
            lblCount   = (Label)this.FindControl("lblCount");
            pnlAdd     = (Panel)this.FindControl("pnlAdd");

            profileControl = (UcAppBaseProfileControl)this.FindControl("profileControl");


            objectdatasourceList.SelectMethod = ucDataSourceSelectMethod;

            gvList.DataSourceID        = "objectdatasourceList";
            gvList.AutoGenerateColumns = false;

            gvList.AllowSorting  = _allowSort;
            gvList.AllowPaging   = true;
            gvList.EmptyDataText = "No records found";

            gvList.CssClass             = "GridView";
            gvList.HeaderStyle.CssClass = "GridViewHeader";
            gvList.PagerStyle.CssClass  = "GridViewPager";

            gvList.CellPadding = 5;
            gvList.EnableSortingAndPagingCallbacks = false;
            gvList.Width    = Unit.Percentage(100);
            gvList.PageSize = UCENTRIK.AppSettings.UcConfParameters.UcGridViewPageRows;

            gvList.RowCreated   += GridView_RowCreated;
            gvList.RowDataBound += GridView_RowDataBound;
            gvList.RowDeleting  += GridView_RowDeleting;
            gvList.RowDeleted   += GridView_RowDeleted;



            Int32 lastColumn = gvList.Columns.Count - 1;

            if (_allowDelete)
            {
                gvList.Columns[0].Visible          = false;
                gvList.Columns[1].Visible          = true;
                gvList.Columns[lastColumn].Visible = true;

                pnlAdd.Visible = true;
            }
            else
            {
                gvList.Columns[0].Visible          = true;
                gvList.Columns[1].Visible          = false;
                gvList.Columns[lastColumn].Visible = false;

                pnlAdd.Visible = false;
            }



            base.OnInit(e);
        }
Example #4
0
    protected void LinkButton7_Click(object sender, EventArgs e)
    {
        ContentPlaceHolder placeholder_master = (ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1");
        MultiView          mview_default      = (MultiView)placeholder_master.FindControl("MultiView_Admin");

        mview_default.ActiveViewIndex = 1;
    }
Example #5
0
        protected virtual void SetarModoPagina(ModosPagina modo)
        {
            try
            {
                this.ModoPagina = modo;
                MultiView   mtvPrincipal  = (MultiView)this.LocalizarControle("mtvPrincipal", this.Controls);
                Button      btnExcluir    = (Button)this.LocalizarControle("btnExcluir", this.Controls);
                Button      btnSalvar     = (Button)this.LocalizarControle("btnSalvar", this.Controls);
                Button      btnListagem   = (Button)this.LocalizarControle("btnListagem", this.Controls);
                Label       lblTitulo     = (Label)this.LocalizarControle("lblTitulo", this.Controls);
                ProPanel    pnlManutencao = (ProPanel)this.LocalizarControle("pnlManutencao", this.Controls);
                ProPanel    pnlConsulta   = (ProPanel)this.LocalizarControle("pnlConsulta", this.Controls);
                ProGridView grdListagem   = (ProGridView)this.LocalizarControle("grdListagem", this.Controls);

                btnSalvar.Visible   = true;
                btnListagem.Visible = true;
                switch (modo)
                {
                case ModosPagina.Listar:
                    PopularGridView();
                    lblTitulo.Text               = "<b>" + this.TituloPagina + ":</b> Consulta";
                    pnlConsulta.Visible          = true;
                    mtvPrincipal.ActiveViewIndex = 0;
                    btnExcluir.Visible           = false;
                    btnSalvar.Visible            = false;
                    btnListagem.Visible          = false;
                    break;

                case ModosPagina.Inserir:
                    lblTitulo.Text = "<b>" + this.TituloPagina + ":</b> InclusĂŁo";
                    pnlManutencao.Clear();
                    mtvPrincipal.ActiveViewIndex = 1;
                    btnExcluir.Visible           = false;
                    pnlConsulta.Visible          = false;
                    grdListagem.SelectedIndex    = -1;
                    this.grdListagem_SelectedIndexChanged(this, EventArgs.Empty);
                    if (FocoInicial != null)
                    {
                        Focus(FocoInicial);
                    }
                    break;

                case ModosPagina.Alterar:
                    lblTitulo.Text = "<b>" + this.TituloPagina + ":</b> Alteração";
                    mtvPrincipal.ActiveViewIndex = 1;
                    btnExcluir.Visible           = true;
                    pnlConsulta.Visible          = false;
                    if (FocoInicial != null)
                    {
                        Focus(FocoInicial);
                    }
                    break;
                }
                VerificarPermissoes();
            }
            catch (Exception ex)
            {
                this.ExibirExcecao(ex);
            }
        }
Example #6
0
    protected void ddlTypeOfPropertyItm_DataBound(object sender, EventArgs e)
    {
        String PropertyType = ((DropDownList)fvReadOnly.FindControl("ddlTypeOfPropertyItm")).SelectedItem.Text;

        switch (PropertyType)
        {
        case "Residencial":
        {
            MultiView mvR = ((MultiView)fvReadOnly.FindControl("mvPropertyDetailsItm"));
            mvR.SetActiveView(mvR.Views[0]);
            break;
        }

        case "Commercial":
        {
            MultiView mvC = ((MultiView)fvReadOnly.FindControl("mvPropertyDetailsItm"));
            mvC.SetActiveView(mvC.Views[1]);
            break;
        }

        case "Industrial":
        {
            MultiView mvi = ((MultiView)fvReadOnly.FindControl("mvPropertyDetailsItm"));
            mvi.SetActiveView(mvi.Views[2]);
            break;
        }
        }
    }
        protected void HomeMenu_MenuItemClick(object sender, MenuEventArgs e)
        {
            MultiView mview = c1.FindControl("MultiViewLogin") as MultiView;

            switch (HomeMenu.SelectedItem.Text)
            {
            case "Login": View loginView = c1.FindControl("LoginView") as View;
                mview.SetActiveView(loginView);
                break;

            case "Log Out":
                Session["CustomerID"] = null;
                //clear the customerIdsession
                FormsAuthentication.SignOut();
                Response.Redirect("~/Login.aspx");
                break;

            case "Register":

                mview.Visible = true;
                View view = c1.FindControl("viewRegister") as View;
                //mview.ActiveViewIndex = 0;

                mview.SetActiveView(view);
                break;

            case "Home": Session["selectedAccountID"] = null;
                Response.Redirect("Home.axpx");
                break;
            }
        }
Example #8
0
    //Display grid based on tab index
    private void showtabItem(int index)
    {
        try
        {
            object    sender = new object();
            EventArgs e      = new EventArgs();
            MultiView c      = (MultiView)this.FindControl("MultiViewRelatedContent");
            //check for valid parameters before hiding taking any others actions
            if (ValidateGridDisplayParameters(index))
            {
                switch (index)
                {
                case 0:
                    OrganizationsGridViewPanel.Visible = true;
                    this.renderOrganizationsGridView(SaltShakerSession.selectedMemberID);
                    break;

                case 1:
                    RolesGridViewPanel.Visible = true;
                    this.renderRolesGridView(SaltShakerSession.selectedMemberID);
                    break;
                }
            }
            c.ActiveViewIndex = index;
            GlobalUtils.SetAccessToControls(this.Page, SaltShakerSession.CurrentRole);
        }
        catch (Exception ex)
        {
            logger.Error("Exception in uc_MemberDetail.showtabItem:" + ex.Message);
            ExceptionMessageException Oops = new ExceptionMessageException(ex.Message);
            ShowMessage(String.Format(GlobalMessages.sMSG_WARNING, Oops.Message));
        }
    }
Example #9
0
        private void ChangeTabPage(int _tabIndex)
        {
            MultiView _mv = (MultiView)this.Parent.FindControl(this.TargetMultiView);

            if (_mv != null)
            {
                _mv.ActiveViewIndex = _tabIndex;
            }

            for (int _i = 0; _i < this._tabTitlePanels.Length; _i++)
            {
                if (this._tabTitlePanels[_i] == null)
                {
                    break;
                }
                if (_tabIndex == _i)
                {
                    _tabTitlePanels[_i].CssClass = "ajax-tab-container active";
                }
                else
                {
                    _tabTitlePanels[_i].CssClass = "ajax-tab-container";
                }
            }

            TabsControlEventArgs _me = new TabsControlEventArgs(_tabIndex);

            OnTabsControlClick(_me);
        }
    protected void gvMilestoneProgress_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e == null)
        {
            throw new ArgumentNullException(nameof(e));
        }
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            MilestoneItem mi = (MilestoneItem)e.Row.DataItem;
            MultiView     mv = (MultiView)e.Row.FindControl("mvProgress");
            if (mi.Type == MilestoneItem.MilestoneType.AchieveOnce)
            {
                mv.ActiveViewIndex = 1;
                HyperLink l = (HyperLink)e.Row.FindControl("lnkFlight");
                l.NavigateUrl = String.Format(CultureInfo.InvariantCulture, "~/Public/ViewPublicFlight.aspx/{0}", mi.MatchingEventID);

                MultiView mvAchievedStatus = (MultiView)e.Row.FindControl("mvAchievement");
                mvAchievedStatus.ActiveViewIndex = (mi.IsSatisfied) ? 0 : 1;
            }
            else
            {
                mv.ActiveViewIndex = 0;
                HtmlControl c = (HtmlControl)mv.FindControl("divPercent");
                int         cappedPercentage = (int)Math.Min(mi.Percentage, 100);
                c.Style["width"]            = String.Format(CultureInfo.InvariantCulture, "{0}%", cappedPercentage);
                c.Style["background-color"] = (cappedPercentage < 100) ? "#CCCCCC" : "limegreen";
            }

            Panel pnlNote = (Panel)e.Row.FindControl("pnlNote");
            pnlNote.Visible = !String.IsNullOrEmpty(mi.Note);
        }
    }
Example #11
0
        private void StartNewMulti(string s)
        {
            MultiView multi = new MultiView(communicator, s);

            multi.NotifyFinish += FinishGame;
            Show();
        }
Example #12
0
    protected void menuTabs_MenuItemClick(object sender, MenuEventArgs e)
    {
        Menu      menuTabs  = sender as Menu;
        MultiView multiTabs = this.FindControl("MultiView1") as MultiView;

        multiTabs.ActiveViewIndex = Int32.Parse(menuTabs.SelectedValue);
    }
Example #13
0
    protected void gvTemplates_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e == null)
        {
            throw new ArgumentNullException("e");
        }

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            UserPropertyTemplate pt = (UserPropertyTemplate)e.Row.DataItem;

            bool fOwned = pt.Owner.CompareCurrentCultureIgnoreCase(User.Identity.Name) == 0;

            MultiView mvStatus = (MultiView)e.Row.FindControl("mvStatus");

            if (fOwned)
            {
                mvStatus.SetActiveView((View)mvStatus.FindControl("vwOwned"));
            }
            else if (AddedTemplates.Contains(pt.ID))
            {
                mvStatus.SetActiveView((View)mvStatus.FindControl("vwAdded"));
            }
            else
            {
                mvStatus.SetActiveView((View)mvStatus.FindControl("vwUnOwned"));
            }

            if (MatchingOwnedTemplate(pt) != null)
            {
                ((AjaxControlToolkit.ConfirmButtonExtender)e.Row.FindControl("confirmOverwrite")).Enabled = true;
            }
        }
    }
Example #14
0
        public static void EventsTest(Page p)
        {
            MultiView MultiView1 = new MultiView();

            MultiView1.ID = "MultiView1";
            View view_1 = new View();

            view_1.ID = "view_1";
            View view_2 = new View();

            view_2.ID = "view_2";
            Button bt = new Button();

            bt.ID          = "bt";
            bt.CommandName = "NextView";

            view_1.Controls.Add(bt);
            view_1.Controls.Add(new LiteralControl("View_1_is_active"));
            view_2.Controls.Add(new LiteralControl("View_2_is_active"));

            view_1.Activate   += new EventHandler(view_1_Activate);
            view_1.Deactivate += new EventHandler(view_1_Deactivate);
            MultiView1.Views.Add(view_1);
            MultiView1.Views.Add(view_2);
            p.Controls.Add(MultiView1);
            MultiView1.ActiveViewIndex = 0;
        }
Example #15
0
        public static void EventsTest(Page p)
        {
            MultiView MultiView1 = new MultiView();

            MultiView1.ID = "MultiView1";
            View view_1 = new View();

            view_1.ID = "view_1";
            View view_2 = new View();

            view_2.ID = "view_2";
            Button bt = new Button();

            bt.ID = "bt";


            view_1.Controls.Add(bt);
            view_1.Controls.Add(new LiteralControl("View_1_is_active"));
            view_2.Controls.Add(new LiteralControl("View_2_is_active"));
            MultiView1.Views.Add(view_1);
            MultiView1.Views.Add(view_2);
            MultiView1.ActiveViewIndex    = 0;
            MultiView1.ActiveViewChanged += new EventHandler(MultiView1_ActiveViewChanged);
            p.Controls.Add(MultiView1);

            if (p.IsPostBack)
            {
                MultiView1.ActiveViewIndex = 1;
            }
        }
Example #16
0
        protected void menuTabsCurrent_MenuItemClick(object sender, MenuEventArgs e)
        {
            System.Web.UI.WebControls.Menu menuTabsCurrent = sender as System.Web.UI.WebControls.Menu;
            MultiView multiTabs = this.FindControl("multiviewStudent") as MultiView;

            multiTabs.ActiveViewIndex = Int32.Parse(menuTabsCurrent.SelectedValue);
        }
Example #17
0
        protected void CoordinatorMenu_MenuItemClick(object sender, MenuEventArgs e)
        {
            System.Web.UI.WebControls.Menu CoordinatorMenu = sender as System.Web.UI.WebControls.Menu;
            MultiView multiTabs = this.FindControl("CoordinatorMultiView") as MultiView;

            multiTabs.ActiveViewIndex = Int32.Parse(CoordinatorMenu.SelectedValue);
        }
        protected void panelSetup(List <tblAssignment> assignments)
        {
            bool[] panelShow = new bool[assignments.Count];

            if (Session["panelShow"] == null)
            {
                Session["panelShow"] = panelShow;
            }

            panelShow = Session["panelShow"] as bool[];

            foreach (RepeaterItem item in rAssignment.Items)
            {
                MultiView mv = item.FindControl("mvToggle") as MultiView;
                Panel     pAssignmentBody = item.FindControl("pAssignmentBody") as Panel;

                if (panelShow[item.ItemIndex])
                {
                    mv.ActiveViewIndex      = 0;
                    pAssignmentBody.Visible = true;
                }
                else
                {
                    mv.ActiveViewIndex      = 1;
                    pAssignmentBody.Visible = false;
                }
            }
        }
Example #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                MultiView mTabControl = (MultiView)FindRecursiveControl(this.Page, "mTabControl");

                if (mTabControl != null)
                {
                    if (!MyContent.ShowBoth && !MyContent.ShowNone)
                    {
                        if (!MyContent.ShowActive)
                        {
                            mTabControl.ActiveViewIndex = 1;

                            HtmlControl tabActiveGiftsDiv = (HtmlControl)FindRecursiveControl(this.Page, "tabActiveGiftsDiv");
                            tabActiveGiftsDiv.Style.Add("display", "none");

                            HtmlControl tabHistoryGiftsDiv = (HtmlControl)FindRecursiveControl(this.Page, "tabHistoryGiftsDiv");
                            tabHistoryGiftsDiv.Attributes["class"] += " TransactionManagerCurrentTab";
                        }

                        if (!MyContent.ShowHistory)
                        {
                            LinkButton lnkHistoryTab = (LinkButton)FindRecursiveControl(this.Page, MyContent.HistoryLinkName);
                            lnkHistoryTab.Visible = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #20
0
        protected void Volunteer_MenuItemClick(object sender, MenuEventArgs e)
        {
            System.Web.UI.WebControls.Menu Volunteer = sender as System.Web.UI.WebControls.Menu;
            MultiView multiTabs = this.FindControl("VolunteerView") as MultiView;

            multiTabs.ActiveViewIndex = Int32.Parse(MasterMenu.SelectedValue);
        }
        protected void aHide_ServerClick(object sender, EventArgs e)
        {
            int hash = sender.GetHashCode();

            foreach (RepeaterItem item in rAssignment.Items)
            {
                Control a     = item.FindControl("aHide") as Control;
                Panel   panel = item.FindControl("pAssignmentBody") as Panel;

                if (a.GetHashCode() == hash)
                {
                    panel.Visible = false;

                    MultiView mv = item.FindControl("mvToggle") as MultiView;

                    mv.ActiveViewIndex = 1;

                    bool[] panelShow = Session["panelShow"] as bool[];
                    panelShow[item.ItemIndex] = false;
                    Session["panelShow"]      = panelShow;

                    break;
                }
            }
        }
Example #22
0
    //**********************************************
    //*  Name: LinkButton1_Click
    //*  Description: Handles the logic for LinkButton1 being clicked
    //****VARIABLES****
    //*  mvLogging               -local handle of the multiview on loggingform.ascx
    //*  vLogForm                -local handle for the view "LogForm"
    //*********************************************
    protected void LinkButton1_Click(object sender, System.EventArgs e)
    {
        MultiView mvLogging = (MultiView)this.Parent.FindControl("mvGiveAnAward");
        View      vLogForm  = (View)mvLogging.FindControl("LogForm");

        mvLogging.SetActiveView(vLogForm);
    }
        private void AddValues(IOrderedDictionary values)
        {
            //the settings property holds either MSMQ or FTP settings
            //and as it is a "special" property we need to help the databinding a little
            MultiView          multiView = GetControl <MultiView>("MultiViewSettings", PageFormView);
            ConnectionSettings connectionSettings;

            if (
                (Integration.Connection.ChannelTypeEnum)Enum.Parse(typeof(Integration.Connection.ChannelTypeEnum), GetControl <DropDownList>("DropDownListChannel", PageFormView).SelectedValue) ==
                Integration.Connection.ChannelTypeEnum.MSMQ)
            {
                connectionSettings = new MSMQConnectionSettings();

                ((MSMQConnectionSettings)connectionSettings).QueueName =
                    GetControl <DropDownList>("DropDownListQueues", multiView).Text;
            }
            else
            {
                connectionSettings = new FTPConnectionSettings();

                ((FTPConnectionSettings)connectionSettings).Port      = Convert.ToInt32(GetControl <TextBox>("TextBoxPort", multiView).Text);
                ((FTPConnectionSettings)connectionSettings).IpAddress =
                    GetControl <TextBox>("TextBoxIPAddress", multiView).Text;
                ((FTPConnectionSettings)connectionSettings).Password =
                    GetControl <TextBox>("TextBoxPassword", multiView).Text;
                ((FTPConnectionSettings)connectionSettings).Username =
                    GetControl <TextBox>("TextBoxUserName", multiView).Text;

                ((FTPConnectionSettings)connectionSettings).ErrorCount =
                    Convert.ToInt32(GetControl <TextBox>("TextBoxErrorCount", multiView).Text);
            }
            values.Add("Settings", connectionSettings);
        }
Example #24
0
        public static void EventsTest_4(Page p)
        {
            MultiView MultiView1 = new MultiView();

            MultiView1.ID = "MultiView1";
            View view_1 = new View();

            view_1.ID = "view_1";
            View view_2 = new View();

            view_2.ID = "view_2";
            Button bt = new Button();

            bt.ID              = "bt";
            bt.CommandName     = "SwitchViewByIndex";
            bt.CommandArgument = "1";
            view_1.Controls.Add(bt);
            view_1.Controls.Add(new LiteralControl("View_1_is_active"));
            view_2.Controls.Add(new LiteralControl("View_2_is_active"));
            MultiView1.Views.Add(view_1);
            MultiView1.Views.Add(view_2);
            MultiView1.ActiveViewIndex    = 0;
            MultiView1.ActiveViewChanged += new EventHandler(MultiView1_ActiveViewChanged);
            p.Controls.Add(MultiView1);
        }
        public void Refresh()
        {
            Club c = ActiveClub;

            if (c == null)
            {
                return;
            }

            fvClub.DataSource = new List <Club> {
                c
            };
            fvClub.DataBind();

            // Show the link or don't
            if (fvClub.CurrentMode == FormViewMode.ReadOnly)
            {
                MultiView mv = (MultiView)fvClub.FindControl("mvClubHeader");
                if (mv != null)
                {
                    mv.ActiveViewIndex = (LinkToDetails ? 0 : 1);
                }
            }
            else
            {
                Button b = (Button)fvClub.FindControl("btnCancel");
                b.Visible = ShowCancel;
                b         = (Button)fvClub.FindControl("btnDelete");
                b.Visible = ShowDelete;
            }
        }
Example #26
0
    protected void ddlTypeOfPropertyIns_SelectedIndexChanged(object sender, EventArgs e)
    {
        String PropertyType = ((DropDownList)FvValuationForm.FindControl("ddlTypeOfPropertyIns")).SelectedItem.Text;

        switch (PropertyType)
        {
        case "Residencial":
        {
            MultiView mvR = ((MultiView)FvValuationForm.FindControl("mvPropertyDetailsIns"));
            mvR.SetActiveView(mvR.Views[0]);
            break;
        }

        case "Commercial":
        {
            MultiView mvC = ((MultiView)FvValuationForm.FindControl("mvPropertyDetailsIns"));
            mvC.SetActiveView(mvC.Views[1]);
            break;
        }

        case "Industrial":
        {
            MultiView mvi = ((MultiView)FvValuationForm.FindControl("mvPropertyDetailsIns"));
            mvi.SetActiveView(mvi.Views[2]);
            break;
        }
        }
    }
Example #27
0
        //- $__BuildCommentMultiViewControl -//
        private MultiView __BuildCommentMultiViewControl()
        {
            MultiView mv = new MultiView();

            mv.ID = "mvCommentContent";
            //+
            vNothing = new View()
            {
                ID = "vNothing"
            };
            mv.Controls.Add(vNothing);
            //+
            vShowComments    = __BuildShowCommentsViewControl();
            vShowComments.ID = "vShowComments";
            mv.Controls.Add(vShowComments);
            //+
            vCommentsDisabled = new View()
            {
                ID = "vCommentsDisabled"
            };
            if (!String.IsNullOrEmpty(this.DisabledCommentText))
            {
                vCommentsDisabled.Controls.Add(new System.Web.UI.WebControls.Literal
                {
                    Text = @"<p class=""comment-status"">" + this.DisabledCommentText + "</p>"
                });
            }
            mv.Controls.Add(vCommentsDisabled);
            //+
            return(mv);
        }
Example #28
0
    protected void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        MultiView mv         = e.Item.FindControl("multiView") as MultiView;
        View      view       = null;
        string    productSku = DataBinder.Eval(e.Item.DataItem, "ProductSku") as string;
        int       categoryID = (int)DataBinder.Eval(e.Item.DataItem, "CategoryID");

        if (!CanEdit)
        {
            if (productSku != string.Empty && productSku != null && productSku != "0")
            {
                view = mv.FindControl("hasSku") as View;
                mv.SetActiveView(view);
            }
            else if (categoryID != 0)
            {
                view = mv.FindControl("hasCategoryId") as View;
                mv.SetActiveView(view);
            }
            else
            {
                view = mv.FindControl("noSkuOrCategoryId") as View;
                mv.SetActiveView(view);
            }
        }
        else
        {
            view = mv.FindControl("canEdit") as View;
            mv.SetActiveView(view);
        }
    }
Example #29
0
        private void LoadExtensionSettings(string extensionType, ref string extensionName, string nameResourceKey,
                                           string typeResourceKey, string defaultExtension, DropDownList dropDown,
                                           MultiView multiView, View notConfiguredView,
                                           Dictionary <string, string> extensionSettings, string resxFileName,
                                           bool buildNotSpecifiedItem)
        {
            // Build the list of Data Sources
            this.BuildExtensionList(extensionType, resxFileName, nameResourceKey,
                                    typeResourceKey, dropDown, multiView, true, buildNotSpecifiedItem);

            // Check that the Report has a Data Source, if not, use the default
            if (string.IsNullOrEmpty(extensionName))
            {
                extensionName = defaultExtension;
            }

            // Find that data source and select it
            var extensionItem = dropDown.Items.FindByValue(extensionName);

            if (extensionItem != null)
            {
                extensionItem.Selected = true;
                this.DisplaySelectedExtension(extensionType, dropDown, multiView, notConfiguredView, extensionSettings);
            }
        }
        protected void rAssignment_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            MultiView mv = e.Item.FindControl("mvToggle") as MultiView;

            mv.ActiveViewIndex = 0;

            Label label        = e.Item.FindControl("lblAssignmentID") as Label;
            int   assignmentID = Convert.ToInt32(label.Text);

            using (DatabaseDataContext db = new DatabaseDataContext())
            {
                tblAssignment assignment = db.tblAssignments.Where(x => x.assignmentID == assignmentID).FirstOrDefault();
                LinkButton    linkButton = e.Item.FindControl("btnDownloadFiles") as LinkButton;

                if (assignment.fileName == null)
                {
                    linkButton.Visible = false;
                }

                if (assignment.assignmentEndDate > DateTime.Now)
                {
                    Button button = e.Item.FindControl("btnArchive") as Button;
                    button.Enabled = false;

                    button         = e.Item.FindControl("btnGrade") as Button;
                    button.Enabled = false;
                }
            }
        }
Example #31
0
 public static MultiView GetMultiView()
 {
     var view =  (MultiView) CallContext.GetData("View");
     if(view==null)
     {
         view = new MultiView();
         CallContext.SetData("View", view);
     }
     return view;
 }
		/// <summary>
		/// Creates TabContainer and MultiView 
		/// </summary>
		protected virtual Control CreateContent(TabContainer menu, MultiView body)
		{
			Control content = new Control();

			WebControl menuPanel = new WebControl(HtmlTextWriterTag.Div);
			menuPanel.CssClass = TabularMenuCSS;
			menuPanel.Controls.Add(menu);
			content.Controls.Add(menuPanel);

			WebControl bodyPanel = new WebControl(HtmlTextWriterTag.Div);
			bodyPanel.CssClass = TabularBodyCSS;
			bodyPanel.Controls.Add(body);
			content.Controls.Add(bodyPanel);

			return content;
		}
		/// <summary>
		/// Creates child controls.
		/// </summary>
		protected override void CreateChildControls()
		{
			// create menu tabstrip
			_tabContainer = CreateTabContainer();
			_tabContainer.Click += new TabCommandEventHandler(OnSelectTabCommand);

			// create multiview container
			_multiView = new MultiView();
			_multiView.ActiveViewChanged += new EventHandler(OnActiveViewChanged);

			// add views previously parsed
			for (int i = 0; i < _parsedViews.Count; i++) _multiView.Controls.Add((Control) _parsedViews[i]);
			_parsedViews = null;

			// select defined view
			if (_activeViewIndexCached != -1)
			{
				_multiView.ActiveViewIndex = _activeViewIndexCached;
				_activeViewIndexCached = -1;
			}

			// create content pane
			Control content = CreateContent(_tabContainer, _multiView);
			Controls.Add(content);

			RebuildTabs();
		}
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlGenericControl li = (HtmlGenericControl)this.Page.Master.FindControl("Ulnav").FindControl("liuserRoutines");
        li.Attributes.Add("class", "active");

        manager = new routineManager();
        authenticated = System.Web.HttpContext.Current.User.Identity.IsAuthenticated;
        currentUser = authenticated ? HttpContext.Current.User.Identity.Name : "";
        if (authenticated)
        {
            cnr = LoginView1.FindControl("CreateNewRoutine") as ui_uc_CreateNewRoutine;
            dmr = LoginView1.FindControl("DeleteModifyRoutine") as ui_uc_DeleteModifyRoutine;
            crl = LoginView1.FindControl("ucCreateRoutineLog") as ui_uc_ucCreateRoutineLog;
            mdrl = LoginView1.FindControl("ucModifyDeleteRoutineLog") as ui_uc_ucModifyDeleteRoutineLog;
            mvRoutines = LoginView1.FindControl("mvRoutine") as MultiView;
            pnlButtons = LoginView1.FindControl("pnlButtons") as Panel;
            btnBack = LoginView1.FindControl("btnBack") as Button;
            lbRoutines = LoginView1.FindControl("lbRoutines") as ListBox;
            pnlRoutineList = LoginView1.FindControl("pnlRoutineList") as Panel;

        }
        if (!IsPostBack)
        {
            pnlRoutineList.Visible = false;
            if (authenticated)
            {
                pnlButtons.Visible = true;
                btnBack.Visible = false;
            }
        }

        if (authenticated && cnr != null)
        {
            cnr.userID = manager.getUserID(currentUser);
        }
        if (authenticated && dmr != null)
        {
            dmr.userID = manager.getUserID(currentUser);
        }
        if (authenticated && crl != null)
        {
            crl.userID = manager.getUserID(currentUser);
        }
        if (authenticated && mdrl != null)
        {
            mdrl.userID = manager.getUserID(currentUser);
        }
    }
 protected void setMultiViewActive(MultiView mvName, View vName)
 {
     mvName.SetActiveView(vName);
 }