示例#1
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;
            }
        }
    }
示例#2
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);
        }
    }
        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;
            }
        }
        protected void lbStep2_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(ddlDomains.SelectedValue))
            {
                try
                {
                    AppsService      service    = new AppsService(ddlDomains.SelectedValue, UserContext.Current.Organization.GoogleAdminAuthToken);
                    AppsExtendedFeed groupsFeed = service.Groups.RetrieveAllGroups();

                    DataTable dt = new DataTable();
                    dt.Columns.Add(Resources.GoogleIntegrationControl_NameColumn_HeaderText, typeof(string));
                    dt.Columns.Add(Resources.GoogleIntegrationControl_IdColumn_HeaderText, typeof(string));
                    dt.Columns.Add(Resources.GoogleIntegrationControl_DescriptionColumn_HeaderText, typeof(string));
                    dt.Columns.Add(Resources.GoogleIntegrationControl_MembersColumn_HeaderText, typeof(string));

                    for (int i = 0; i < groupsFeed.Entries.Count; i++)
                    {
                        GroupEntry    groupEntry = groupsFeed.Entries[i] as GroupEntry;
                        MemberFeed    memberFeed = service.Groups.RetrieveAllMembers(groupEntry.GroupId);
                        StringBuilder sb         = new StringBuilder();

                        for (int j = 0; j < memberFeed.Entries.Count; j++)
                        {
                            MemberEntry memberEntry = memberFeed.Entries[j] as MemberEntry;
                            if (string.Compare(memberEntry.MemberId, "*", true) == 0)
                            {
                                sb.AppendFormat(Resources.GoogleIntegrationControl_MembersColumn_AllUsersValue);
                            }
                            else
                            {
                                sb.AppendFormat("{0}<br>", memberEntry.MemberId);
                            }
                        }

                        dt.Rows.Add(groupEntry.GroupName, groupEntry.GroupId, groupEntry.Description, sb.ToString());
                    }

                    gvStep2Results.DataSource = dt;
                    gvStep2Results.DataBind();

                    mvStep2.SetActiveView(vwStep2Result);
                }
                catch (AppsException a)
                {
                    lblStep2Error.Text = string.Format(CultureInfo.CurrentCulture, Resources.GoogleIntegrationControl_GoogleAppsError_Text, a.ErrorCode, a.InvalidInput, a.Reason);
                    mvStep2.SetActiveView(vwStep2Error);
                }
                catch (Exception ex)
                {
                    ShowError(ex, lblStep2Error, mvStep2, vwStep2Error);
                }
            }
            else
            {
                lblStep2Error.Text = Resources.GoogleIntegrationControl_DomainMisingError_Text;
                mvStep2.SetActiveView(vwStep2Error);
            }
        }
 private void DisplayView(string Value)
 {
     if (Value == "SYSTRAN")
     {
         mvwProviders.SetActiveView(vwSystran);
     }
     else if (Value == "BING")
     {
         mvwProviders.SetActiveView(vwBing);
     }
 }
 private void DisplaySpecial(IDAssociation association)
 {
     if (Edit)
     {
         v_Editing_mv_Types.SetActiveView(v_Editing_v_ById);
         v_Editing_v_ById_tb_Id.Text = association.ItemID;
     }
     else
     {
         v_Displaing_mv_Types.SetActiveView(v_Displaying_v_ById);
         v_Displaying_v_ById_lbl_Id.Text = association.ItemID;
     }
 }
示例#7
0
 protected void ChangeViewButton_Click(object sender, EventArgs e)
 {
     if (CustomUrlsMultiView.ActiveViewIndex == 0)
     {
         CustomUrlsMultiView.SetActiveView(AdvancedView);
         ChangeViewButton.Text = Resources.CustomUrlsControl_ChangeToSimpleView_Text;
     }
     else
     {
         CustomUrlsMultiView.SetActiveView(SimpleView);
         ChangeViewButton.Text = Resources.CustomUrlsControl_ChangeToAdvancedView_Text;
     }
 }
 void InitView()
 {
     mv_CreateMain.Visible = Edit;
     p_Buttons.Visible     = Edit;
     if (Edit)
     {
         v_Editing_v_ByGroup_cb_Group.DataSource = GroupTypes;
         v_Editing_v_ByGroup_cb_Group.DataBind();
         mv_Main.SetActiveView(v_Editing);
     }
     else
     {
         mv_Main.SetActiveView(v_Displaying);
     }
 }
示例#9
0
        protected void GetUserGroupsButton_Click(object sender, EventArgs e)
        {
            GetUserGroupsTimer.Enabled = true;
            GetUserGroupsMultiView.SetActiveView(GetUserGroupsViewProcess);

            Thread thread = new Thread(LdapProcessGetUserGroups);

            thread.CurrentCulture   = CultureInfo.CurrentCulture;
            thread.CurrentUICulture = CultureInfo.CurrentUICulture;
            thread.Priority         = ThreadPriority.Lowest;
            thread.IsBackground     = true;
            thread.Start(UserContext.Current.OrganizationId);

            GetUserGroupsButton.Enabled = false;
        }
        void cb_AssType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Create_cb_AssType.SelectedValue))
            {
                var type = (AssType)Convert.ToInt32(Create_cb_AssType.SelectedValue);
                switch (type)
                {
                case AssType.ID: mv_CreateMain.SetActiveView(mv_CreateMain.Views[0]); break;

                case AssType.Group: mv_CreateMain.SetActiveView(mv_CreateMain.Views[1]); break;

                case AssType.ContentType: mv_CreateMain.SetActiveView(mv_CreateMain.Views[2]); break;
                }
            }
        }
示例#11
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;
        }
        }
    }
示例#12
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;
        }
        }
    }
示例#13
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 SaveSaleCompleted(object sender, EventArgs e)
    {
        MyEventArgs eventArgs = e as MyEventArgs;

        SaveInvoiceControl.LoadDataSpecificForSale(eventArgs);
        MultiView.SetActiveView(SaveInvoiceView);
        HighLightCorrectTab();
    }
示例#15
0
    protected void ddlComplaintTypeUps_DataBound(object sender, EventArgs e)
    {
        FormView     fv             = ((FormView)mvAssignOfficer.FindControl("FvInvestigationdetail"));
        DropDownList ddl            = ((DropDownList)fv.FindControl("ddlComplaintTypeUps"));
        MultiView    mvComplainType = ((MultiView)fv.FindControl("mvComplainDetails"));

        switch (ddl.SelectedItem.Text)
        {
        case "Internal":
            mvComplainType.SetActiveView(mvComplainType.Views[1]);
            break;

        case "External":
            mvComplainType.SetActiveView(mvComplainType.Views[0]);
            break;
        }
    }
示例#16
0
    private void CompleteVoucherPaymentEventRaised(object sender, EventArgs e)
    {
        MyEventArgs eventArgs = e as MyEventArgs;

        MultiView.SetActiveView(SaveRecieptView);
        SaveRecieptUserControl.ShowExternalMessage();
        HighLightCorrectTab();
    }
示例#17
0
    protected void ddlComplaintTypeUps_SelectedIndexChanged(object sender, EventArgs e)
    {
        FormView     fv             = ((FormView)mvComplain.FindControl("fvComplain"));
        DropDownList ddl            = ((DropDownList)fv.FindControl("ddlComplaintTypeUps"));
        MultiView    mvComplainType = ((MultiView)fv.FindControl("mvPropertyDetailsUps"));

        switch (ddl.SelectedItem.Text)
        {
        case "Internal":
            mvComplainType.SetActiveView(mvComplainType.Views[1]);
            break;

        case "External":
            mvComplainType.SetActiveView(mvComplainType.Views[0]);
            break;
        }
    }
        protected void lbStep1_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(ddlDomains.SelectedValue))
            {
                try
                {
                    AppsService service  = new AppsService(ddlDomains.SelectedValue, UserContext.Current.Organization.GoogleAdminAuthToken);
                    UserFeed    userFeed = service.RetrieveAllUsers();

                    DataTable dt = new DataTable();
                    dt.Columns.Add(Resources.GoogleIntegrationControl_UsernameColumn_HeaderText, typeof(string));
                    dt.Columns.Add(Resources.GoogleIntegrationControl_FirstNameColumn_HeaderText, typeof(string));
                    dt.Columns.Add(Resources.GoogleIntegrationControl_LastNameColumn_HeaderText, typeof(string));
                    dt.Columns.Add(Resources.GoogleIntegrationControl_AdminColumn_HeaderText, typeof(string));

                    for (int i = 0; i < userFeed.Entries.Count; i++)
                    {
                        UserEntry userEntry = userFeed.Entries[i] as UserEntry;
                        dt.Rows.Add(userEntry.Login.UserName, userEntry.Name.GivenName, userEntry.Name.FamilyName, userEntry.Login.Admin ? Resources.GoogleIntegrationControl_AdminColumn_Value : string.Empty);
                    }

                    gvStep1Results.DataSource = dt;
                    gvStep1Results.DataBind();

                    mvStep1.SetActiveView(vwStep1Result);

                    lbImportUsers.Text    = Resources.GoogleIntegrationControl_ImportUsers_LinkButton_Text;
                    lbImportUsers.Visible = lbImportUsers.Enabled = dt.Rows.Count > 0;
                }
                catch (AppsException a)
                {
                    lblStep1Error.Text = string.Format(CultureInfo.CurrentCulture, Resources.GoogleIntegrationControl_GoogleAppsError_Text, a.ErrorCode, a.InvalidInput, a.Reason);
                    mvStep1.SetActiveView(vwStep1Error);
                }
                catch (Exception ex)
                {
                    ShowError(ex, lblStep1Error, mvStep1, vwStep1Error);
                }
            }
            else
            {
                lblStep1Error.Text = Resources.GoogleIntegrationControl_DomainMisingError_Text;
                mvStep1.SetActiveView(vwStep1Error);
            }
        }
示例#19
0
        protected void ReconnectUserToLdapButton_Click(object sender, EventArgs e)
        {
            UserContext user = UserContext.Current;

            if (user != null)
            {
                ReconnectUserToLdapTimer.Enabled = true;
                ReconnectUserToLdapMultiView.SetActiveView(ReconnectUserToLdapViewProcess);

                Thread thread = new Thread(LdapProcessReconnectUserToLdap);
                thread.CurrentCulture   = CultureInfo.CurrentCulture;
                thread.CurrentUICulture = CultureInfo.CurrentUICulture;
                thread.Priority         = ThreadPriority.Lowest;
                thread.IsBackground     = true;
                thread.Start(UserContext.Current);
                ReconnectUserToLdapButton.Enabled = false;
            }
        }
    private void GeneratePaymentVoucherEventRaised(object sender, EventArgs e)
    {
        MyEventArgs eventArgs     = e as MyEventArgs;
        string      invoiceNumber = eventArgs.PegPayId;

        MultiView.SetActiveView(SavePaymentVoucherView);
        SavePaymentVoucherUserControl.SetInvoiceSelected(invoiceNumber);
        SavePaymentVoucherUserControl.ShowExternalMessage();
    }
示例#21
0
    private void GenerateInvoiceEventRaised(object sender, EventArgs e)
    {
        MyEventArgs eventArgs     = e as MyEventArgs;
        string      invoiceNumber = eventArgs.PegPayId;

        MultiView.SetActiveView(SaveInvoiceView);
        SaveInvoiceUserControl.LoadDataSpecificForSale(eventArgs);
        SaveInvoiceUserControl.ShowExternalMessage();
    }
    private void MakeASaleEventRaised(object sender, EventArgs e)
    {
        MyEventArgs eventArgs = e as MyEventArgs;

        MultiView.SetActiveView(SaveSaleItemsView);
        SaveSaleItemsControl.LoadDataSpecificForSale(eventArgs);
        SaveSaleItemsControl.ShowExternalMessage();
        HighLightCorrectTab();
    }
    private void SavePurchaseCompleted(object sender, EventArgs e)
    {
        MyEventArgs eventArgs = e as MyEventArgs;

        MultiView.SetActiveView(SavePaymentVoucherView);
        SavePaymentVoucher.SetInvoiceSelected(eventArgs.ThirdPartyId);
        SavePaymentVoucher.ShowExternalMessage();
        HighLightCorrectTab();
    }
    private void RegisterPurchaseRaised(object sender, EventArgs e)
    {
        MyEventArgs eventArgs = e as MyEventArgs;
        string      Id        = eventArgs.PegPayId;

        SavePurchase.LoadDataSpecificForSupplier(Id);
        MultiView.SetActiveView(SavePurchaseView);
        HighLightCorrectTab();
    }
示例#25
0
    protected void LoadData(string bulan)
    {
        using (DataClassesDatabaseDataContext db = new DataClassesDatabaseDataContext())
        {
            HiddenFieldIDBulan.Value = bulan;
            LabelHeader.Text         = "PENYESUAIAN PRESENSI (" + new DateTime(DropDownListTahun.SelectedValue.ToInt(), bulan.ToInt(), 1).Date.ToString("MMMM").ToUpper() + ")";
            Dictionary <int, string[]> ListData = new Dictionary <int, string[]>();

            int JumlahHari = DateTime.DaysInMonth(int.Parse(DropDownListTahun.SelectedItem.Value), int.Parse(bulan));

            //CARI DI DATABASE
            var ListSchedulling = db.TBPenggunaLogKehadirans
                                  .Where(item =>
                                         item.IDPengguna == int.Parse(DropDownListPegawai.SelectedItem.Value) &&
                                         item.JamMasuk.Value.Year == new DateTime(DropDownListTahun.SelectedValue.ToInt(), bulan.ToInt(), 1).Year&&
                                         item.JamKeluar.Value.Month == new DateTime(DropDownListTahun.SelectedValue.ToInt(), bulan.ToInt(), 1).Month)
                                  .Select(item => new
            {
                Hari = item.JamMasuk.Value.Day,
                item.JamMasuk,
                item.JamKeluar,
                Keterangan = item.Keterangan
            });

            MultiView.Visible = true;
            MultiView.SetActiveView(ScheduleHarian);

            for (int i = 1; i <= JumlahHari; i++)
            {
                string[] dataSchedulling = new string[3];

                var Schedule = ListSchedulling.FirstOrDefault(item => item.Hari == i);

                if (Schedule != null)
                {
                    dataSchedulling[0] = Schedule.JamMasuk.Value.ToString("HH:mm");
                    dataSchedulling[1] = Schedule.JamKeluar.Value.ToString("HH:mm");
                    dataSchedulling[2] = Schedule.Keterangan;
                    ListData.Add(i, dataSchedulling);
                }
                else
                {
                    ListData.Add(i, dataSchedulling);
                }
            }

            RepeaterSchedule1.DataSource = ListData.Take(10);
            RepeaterSchedule1.DataBind();

            RepeaterSchedule2.DataSource = ListData.Skip(10).Take(10);
            RepeaterSchedule2.DataBind();

            RepeaterSchedule3.DataSource = ListData.Skip(20);
            RepeaterSchedule3.DataBind();
        }
    }
示例#26
0
    protected void ddlTypeOfAppealIns_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList ddl = (DropDownList)fvAppeal.FindControl("ddlTypeOfAppealIns");
        MultiView    mv  = ((MultiView)fvAppeal.FindControl("viewAppealType"));

        switch (ddl.SelectedItem.Text)

        {
        case "Stamp":

            mv.SetActiveView(mvAppealType.Views[1]);
            break;

        case "Registartion":

            mv.SetActiveView(mvAppealType.Views[0]);
            break;
        }
    }
示例#27
0
    private void GenerateRecieptEventRaised(object sender, EventArgs e)
    {
        MyEventArgs eventArgs     = e as MyEventArgs;
        string      invoiceNumber = eventArgs.PegPayId;

        MultiView.SetActiveView(SaveRecieptView);
        SaveRecieptUserControl.LoadDataSpecificForSale(invoiceNumber);
        SaveRecieptUserControl.ShowExternalMessage();
        HighLightCorrectTab();
    }
示例#28
0
 //Standard- GoBack- Methode
 public void GoBackOrStartNewHistory(MultiView MultiView1, HttpResponse Response, View SartView)
 {
     if (!GoBack(MultiView1))
     {
         if (!GoBack(Response))
         {
             reset();
             MultiView1.SetActiveView(SartView);
         }
     }
 }
示例#29
0
 /// <summary>
 /// Sets active view by the specifed id
 /// </summary>
 /// <param name="mv"></param>
 /// <param name="viewId"></param>
 public static void SetActiveViewById(this MultiView mv, string viewId)
 {
     foreach (View tab in mv.Views)
     {
         if (tab.ID.Equals(viewId))
         {
             mv.SetActiveView(tab);
             //
             break;
         }
     }
 }
示例#30
0
        /// <summary>
        /// automatically bind if it's not explicitly called.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            View view = FindControl(ViewerStyle.ToString()) as View;

            MultiView.SetActiveView(view);

            if (m_IsBound == false)
            {
                DataBind();
            }
        }
示例#31
0
 protected void setMultiViewActive(MultiView mvName, View vName)
 {
     mvName.SetActiveView(vName);
 }