Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                pnlServices.Visible   = true;
                pnlAddService.Visible = false;

                //Get user role
                if (User.Identity.IsAuthenticated)
                {
                    string strID = User.Identity.Name;
                    //string strRole  = lnUser.GetUserRole(strID);
                    if (User.IsInRole("Admin"))
                    {
                        lblRole.Text = "Admin";
                    }
                    if (User.IsInRole("Manager"))
                    {
                        lblRole.Text = "Manager";
                    }
                }
                //Bind Sku Groups
                BD.DataBindToDropDownList(ddlServiceGroupFilter, "SELECT SkuGroupID,SkuGroup FROM EduSphere.SkuGroups WHERE SkuGroupID>=100");
                //In case the logged in role is Admin then display delete button.
                if (User.IsInRole("Admin"))
                {
                    BD.DataBindToGridView(dgServices, "SELECT * FROM EduSphere.Sku WHERE SkuId>=100", "NA");
                }
                else
                {
                    BD.DataBindToGridView(dgServicesView, "SELECT * FROM EduSphere.Sku WHERE SkuId>=100", "NA");
                }
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Get the Test start time only first time.
            if (!this.IsPostBack)
            {
                pnlCreateTest.Visible       = false;
                pnlAssignCandidates.Visible = false;
                pnlCandidate.Visible        = false;
                pnlViewTestResults.Visible  = false;
                //Get user role
                if (User.Identity.IsAuthenticated)
                {
                    string strID = User.Identity.Name;
                    if (User.IsInRole("Admin"))
                    {
                        lblRole.Text = "Admin";
                    }
                    if (User.IsInRole("Manager"))
                    {
                        lblRole.Text = "Manager";
                    }
                }
                //Allow only manager to create test
                if (lblRole.Text == "Manager")
                {
                    lnkBtnCreateTest.Visible = true;
                }

                //Bind the ddlTestSubject to list the subject
                int intProgramID = 100;
                //string strQuery           = string.Format("SELECT CourseID,CourseTitle from EduSphere.Courses where ProgramID='{0}'", intProgramID);
                string strQuery = string.Format("SELECT CourseID,CourseTitle from EduSphere.Courses");
                BD.DataBindToDropDownList(ddlTestSubjectOne, strQuery);
                BD.DataBindToDropDownList(ddlTestSubjectTwo, strQuery);
                BD.DataBindToDropDownList(ddlTestSubjectThree, strQuery);
                BD.DataBindToDropDownList(ddlTestSubjectFour, strQuery);
                //SqlCommand ObjCmdProg       = new SqlCommand(strQuery, BD.ObjCn);
                //DataSet ObjDS               = BD.GetDataSet(ObjCmdProg);
                //ddlTestSubjectOne.DataSource   = ObjDS;
                //ddlTestSubjectOne.DataBind();

                PostBackStr           = Page.ClientScript.GetPostBackEventReference(this, "time");
                lblTestStartTime.Text = DateTime.Now.ToLongTimeString();
                string eventArg = Request["__EVENTARGUMENT"];
                if (eventArg == "time")
                {
                    getNextQuestion();
                }

                //Test code for timer
                if (!SM1.IsInAsyncPostBack)
                {
                    Session["timeout"] = DateTime.Now.AddMinutes(testDuration).ToString();
                }
                //End Test code for timer
            }
        }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string query = string.Format("SELECT ProgramTitle,ProgramId FROM EduSphere.Programs");
         BD.DataBindToDropDownList(ddlProgramId, query);
         //BD.DataBindToDropDownList(ddlFranchiseeID, string.Format("SELECT OrganizationName,OrganizationId FROM EduSphere.Organizations WHERE OrganizationType='{0}'", "FRANCHISEE"));
         BD.DataBindToDropDownList(ddlState, string.Format(@"SELECT *  FROM EduSphere.States"));
     }
 }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BD.DataBindToDropDownList(ddlState, "SELECT StateID,StateName FROM EduSphere.States");
                BD.DataBindToDropDownList(ddlEducationCentre, "SELECT OrganizationID,OrganizationName FROM EduSphere.Organizations WHERE OrganizationType='EDUCATION-CENTRE'");
                ////Check if enquiry is coming from Centre page
                //lblOrgID.Text = Request.QueryString["id"];
                //if(lblOrgID.Text.ToString()!="")
                //{

                //    lblOrgID.Visible = true;

                //}
            }
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //do not call this if its PostBack due to SelectedIndexChanged
            if (!IsPostBack)
            {
                pnlLearningContent.Visible = true;
                pnlTakeQuiz.Visible        = false;

                string strEnrolledProgram = string.Format(@"SELECT p.ProgramID,p.ProgramTitle FROM EduSphere.Programs p 
                                                                                       JOIN EduSphere.ProgramBatch b ON p.ProgramID=b.ProgramID
                                                                                       JOIN EduSphere.Members s ON s.BatchID=b.BatchID
                                                                                       WHERE Email='{0}'", User.Identity.Name.ToString());
                BD.DataBindToDropDownList(ddlMyPrograms, strEnrolledProgram);

                PostBackStr           = Page.ClientScript.GetPostBackEventReference(this, "time");
                lblTestStartTime.Text = DateTime.Now.ToLongTimeString();
                string eventArg = Request["__EVENTARGUMENT"];
                if (eventArg == "time")
                {
                    getNextQuestion();
                }

                //Test code for timer
                if (!SM1.IsInAsyncPostBack)
                {
                    Session["timeout"] = DateTime.Now.AddMinutes(30).ToString();
                }
                //End Test code for timer
            }
        }
Exemplo n.º 6
0
        public void ManageDashboardPanels(object sender, CommandEventArgs e)
        {
            string strCmd;

            strCmd = e.CommandName.ToString();
            switch (strCmd)
            {
            case "pnlAccountTxsDashboard":
                lblDashboardAction.Text          = "Account Transactions";
                pnlAccountTxsDashboard.Visible   = true;
                pnlAddAccountTxs.Visible         = false;
                pnlManageAccountTxTitles.Visible = false;
                string spender = string.Format("SELECT FullName,EmployeeID  FROM EduSphere.Staff");
                BD.DataBindToDropDownList(ddlSpender, spender);
                //Make all stores visible only to admin. The manager can see only his/her store
                SetSalonVisibility(lblRole.Text, User.Identity.Name, ddlSite, ddlSpender);
                break;

            case "pnlAddAccountTxs":
                lblDashboardAction.Text          = "Add AccountTx";
                pnlAccountTxsDashboard.Visible   = false;
                pnlAddAccountTxs.Visible         = true;
                pnlManageAccountTxTitles.Visible = false;
                BD.DataBindToDropDownList(ddlCostSite, string.Format("SELECT OrganizationName,OrganizationID FROM EduSphere.Organizations"));
                BD.DataBindToDropDownList(ddlAccountTxTitle, "SELECT AccountTxTitle,AccountTxTitleID FROM EduSphere.AccountTxTitles");
                BD.DataBindToDropDownList(ddlApprovedBy, "SELECT FullName,EmployeeID FROM EduSphere.Staff");
                break;

            case "pnlManageAccountTxTitles":
                lblDashboardAction.Text          = "Manage AccountTx Titles";
                pnlAccountTxsDashboard.Visible   = false;
                pnlAddAccountTxs.Visible         = false;
                pnlManageAccountTxTitles.Visible = true;
                break;

            case "FromPnlServicesRevenueToNoPanel":
                pnlAccountTxsDashboard.Visible   = false;
                pnlAddAccountTxs.Visible         = false;
                pnlManageAccountTxTitles.Visible = false;
                break;

            default:
                break;
            }
        }