Example #1
0
    public void Applied_Chapter_Topics()
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);

        obj_Teacher_Dashboard.Month = Convert.ToInt16(ddlMonthYear.SelectedValue);
        String[] Year = ddlMonthYear.SelectedItem.ToString().Split('-');
        obj_Teacher_Dashboard.Year = Convert.ToInt32(Year[1]);

        DataSet dsSelect = new DataSet();

        dsSelect = obj_BAL_Teacher_Dashboard.BAL_Select_Applied_Rescheduling_Data_Of_Teacher(obj_Teacher_Dashboard);

        if (dsSelect.Tables[0].Rows.Count > 0)
        {
            grvReschedulingData.DataSource = dsSelect.Tables[0];
            grvReschedulingData.DataBind();
        }
        else
        {
            grvReschedulingData.DataSource = null;
            grvReschedulingData.DataBind();
        }
    }
    public static void Log_StudentActivity(Int32 SchoolID, Int32 StudentID, Int16 DivisionID, String PageName, String ControlName, String EventName, DateTime ActivityDate, String SessionID, String Activity, String Remark, Int32 BMSSCTID)
    {
        Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        DataSet dsSettings = new DataSet();

        dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_Maintain_activity_log_Settings();

        object datatype = dsSettings.Tables[0].Rows[0]["Type"].ToString();
        object val      = dsSettings.Tables[0].Rows[0]["value"].ToString();

        if (Convert.ToBoolean(Convert.ToInt16(val)))
        {
            DataAccess DAL_Teacher_Dashboard = new DataAccess();
            ArrayList  arrParameter          = new ArrayList();

            arrParameter.Add(new parameter("SchoolID", SchoolID));
            arrParameter.Add(new parameter("EmployeeID", StudentID));
            arrParameter.Add(new parameter("DivisionID", DivisionID));
            arrParameter.Add(new parameter("PageName", PageName));
            arrParameter.Add(new parameter("ControlName", ControlName));
            arrParameter.Add(new parameter("EventName", EventName));
            arrParameter.Add(new parameter("ActivityDate", ActivityDate));
            arrParameter.Add(new parameter("SessionID", SessionID));
            arrParameter.Add(new parameter("Activity", Activity));
            arrParameter.Add(new parameter("Remark", Remark));
            arrParameter.Add(new parameter("BMSSCTID", BMSSCTID));
            arrParameter.Add(new parameter("RoleID", AppSessions.RoleID));

            DAL_Teacher_Dashboard.DAL_InsertUpdate("sp_Log_StudentActivity", arrParameter);
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID     = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID = Convert.ToInt16(Session["SubjectID"]);

        obj_Teacher_Dashboard.ChapterID = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID   = Convert.ToInt64(ddlTopic.SelectedValue);

        int bmssctid = obj_BAL_Teacher_Dashboard.BAL_Select_BMS_SCTID(obj_Teacher_Dashboard);

        if (bmssctid > (int)EnumFile.AssignValue.Zero)
        {
            Session["ChapterTopic"] = ddlChapter.SelectedItem.ToString() + " >> " + ddlTopic.SelectedItem.ToString();
            Session["BMSSCTID"]     = bmssctid;
            String Path1 = Server.MapPath("../EduResource/" + bmssctid);
            if (Directory.Exists(Path1))
            {
                Response.Redirect("EducationalResource.aspx?Type=Student");
            }
            else
            {
                WebMsg.Show("No Educational Resource Available.");
            }
        }
        else
        {
            WebMsg.Show("No Educational Resource Available.");
        }
    }
    protected void ddlselectoption_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(ddlselectoption.SelectedItem.Value))
        {
            obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
            obj_Teacher_Dashboard     = new Teacher_Dashboard();

            obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
            obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
            obj_Teacher_Dashboard.EmployeeID = AppSessions.EmpolyeeID;

            DataSet dsSelect = new DataSet();
            dsSelect = obj_BAL_Teacher_Dashboard.BAL_Select_Chapters_Topics_By_CoveredStatus(obj_Teacher_Dashboard, ddlselectoption.SelectedItem.Value);

            GVChapter.DataSource = dsSelect.Tables[0];
            GVChapter.DataBind();

            if (dsSelect.Tables[0].Rows.Count > 0)
            {
                btnsearcksubmit.Enabled = true;
            }
            else
            {
                btnsearcksubmit.Enabled = false;
            }
        }
        else
        {
            GVChapter.DataSource = null;
            GVChapter.DataBind();
            btnsearcksubmit.Enabled = false;
        }
    }
    public void Fill_Rescheduling_Chapter_Topic()
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);

        DataSet dsSelect = new DataSet();

        dsSelect = obj_BAL_Teacher_Dashboard.BAL_Select_Rescheduling_Data(obj_Teacher_Dashboard);

        if (dsSelect.Tables[0].Rows.Count > ((int)EnumFile.AssignValue.Zero))
        {
            gvRescheduing.DataSource = dsSelect;
            gvRescheduing.DataBind();
        }
        else
        {
            gvRescheduing.DataSource = null;
            gvRescheduing.DataBind();
        }
    }
    protected void btnpromote_Click(object sender, EventArgs e)
    {
        divpromot.Visible = true;
        int studentcnt = 0;


        foreach (GridViewRow gvrow in gvstudentList.Rows)
        {
            CheckBox chk = (CheckBox)gvrow.FindControl("chk");
            if (chk != null & chk.Checked)
            {
                studentcnt        = studentcnt + 1;
                divpromot.Visible = true;

                DataSet dsSettings = new DataSet();
                Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
                dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("CurrentAcademicYear");
                string CurrentAcademicYear = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();
                lblnextacedemicyear.Text = CurrentAcademicYear;
            }
        }

        if (studentcnt <= 0)
        {
            WebMsg.Show("please select atleast one student");
            divpromot.Visible = false;
        }
    }
Example #7
0
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        BtnPDF.Visible = false;

        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);
        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);

        obj_Teacher_Dashboard.ChapterID = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID   = Convert.ToInt64(ddlTopic.SelectedValue);

        Int64 bmssctid = Convert.ToInt64(obj_BAL_Teacher_Dashboard.Get_BMSSCTID(obj_Teacher_Dashboard));

        if (bmssctid == ((int)EnumFile.AssignValue.Zero))
        {
            WebMsg.Show("BMSSCT does not exists.");
        }
        else
        {
            obj_Teacher_Dashboard.BMSSCTID = Convert.ToInt64(bmssctid);

            DataSet dsStudentList = new DataSet();
            dsStudentList = obj_BAL_Teacher_Dashboard.Get_Student_ExamSummary_Report(obj_Teacher_Dashboard);

            if (dsStudentList.Tables[0].Columns.Contains("NoData"))
            {
                GridStudentList.DataSource = null;
                GridStudentList.DataBind();
                WebMsg.Show("No Data Found.");
                BtnPDF.Visible = false;
                return;
            }

            if (dsStudentList.Tables[0].Rows.Count > 0 && dsStudentList.Tables.Count > 0)
            {
                GridStudentList.DataSource = dsStudentList.Tables[0];
                GridStudentList.DataBind();
                Session["StudentResult"] = dsStudentList.Tables[0];
                Session["ChapName"]      = ddlChapter.SelectedItem.ToString();
                Session["TopicName"]     = ddlTopic.SelectedItem.ToString();
                Session["ExamName"]      = "";
                Session["ToatlQues"]     = "";
                Session["ToatlMarks"]    = "";
                BtnPDF.Visible           = true;
            }
            else
            {
                GridStudentList.DataSource = null;
                GridStudentList.DataBind();
                WebMsg.Show("No Data Found.");
                BtnPDF.Visible = false;
            }
        }
    }
Example #8
0
 protected void BttnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         DataSet ds = new DataSet();
         OEmployee          = new Employee();
         BAL_Forgetpassword = new Teacher_Dashboard_BLogic();
         OEmployee.emailid  = uctxtEmail.Text;
         ArrayList arrParameter = new ArrayList();
         string    subjectEmail = "Login Information";
         arrParameter.Add(uctxtEmail.Text);
         ds = BAL_Forgetpassword.BAL_Emailid_Select(OEmployee);
         ViewState["PasswordData"] = ds;
         if (ds.Tables.Count > 0 & ds != null)
         {
             if (ds.Tables[0].Rows.Count > 0)
             {
                 if (EmailUtility.SendEmail(arrParameter, subjectEmail, GenerateMailBodyForgetPassword()))
                 {
                     ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Password has been sent to your email successfully.');window.location ='Login.aspx';", true);
                     ClearControls();
                 }
                 else
                 {
                     WebMsg.Show("Email Failed");
                     ClearControls();
                 }
             }
             else if (ds.Tables[1].Rows.Count > 0)
             {
                 if (EmailUtility.SendEmail(arrParameter, subjectEmail, GenerateEmailBody()))
                 {
                     ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Password has been sent to your email successfully.');window.location ='Login.aspx';", true);
                     ClearControls();
                 }
                 else
                 {
                     WebMsg.Show("Email Failed");
                     ClearControls();
                 }
             }
             else
             {
                 WebMsg.Show("Invalid Email");
                 ClearControls();
             }
         }
         else
         {
             WebMsg.Show("Invalid Email");
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Example #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string package   = HttpUtility.UrlDecode(Request.QueryString[0]);
            string subject   = HttpUtility.UrlDecode(Request.QueryString[1]);
            string ValidFrom = HttpUtility.UrlDecode(Request.QueryString[2]);
            string Price     = HttpUtility.UrlDecode(Request.QueryString[3]);
            string NoOfMonth = HttpUtility.UrlDecode(Request.QueryString[4]);
            string ValidTill = HttpUtility.UrlDecode(Request.QueryString[5]);
            TransactionID = HttpUtility.UrlDecode(Request.QueryString[6]);
            string RegistrationDate = HttpUtility.UrlDecode(Request.QueryString[7]);
            RegistrationDate = Convert.ToDateTime(RegistrationDate).ToString("dd MMM, yyyy");

            lblstudentname.Text = "Name: " + AppSessions.UserName;
            lblpackagename.Text = package;
            lblsubject.Text     = subject;
            lblfromdate.Text    = Convert.ToDateTime(ValidFrom).ToString("dd MMM, yyyy");
            price.Text          = Convert.ToDecimal(Price).ToString("00.00");
            lblvalidtill.Text   = Convert.ToDateTime(ValidTill).ToString("dd MMM, yyyy");
            //lblmonth.Text = NoOfMonth;
            DateTime date1 = Convert.ToDateTime(ValidFrom);
            DateTime date2 = Convert.ToDateTime(ValidTill);
            lblmonth.Text = Convert.ToString(((date2.Year - date1.Year) * 12) + date2.Month - date1.Month);
            lbltotal.Text = price.Text;

            DataSet dsSettings = new DataSet();
            Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
            dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("PaymentDiscout");
            string PaymentDiscout = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();

            dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("PaymentTax");
            string PaymentTax = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();



            lbldiscount.Text = Convert.ToDecimal(PaymentDiscout).ToString("00.00");
            lbltax.Text      = Convert.ToDecimal(PaymentTax).ToString("00.00");;
            //lblgrandtotal.Text = (Convert.ToDecimal(price.Text) - Convert.ToDecimal(lbldiscount.Text) + Convert.ToDecimal(lbltax.Text)).ToString();
            lblgrandtotal.Text = (Convert.ToDecimal(price.Text) - Convert.ToDecimal(lbldiscount.Text) + Convert.ToDecimal(lbltax.Text)).ToString();

            ConvertToWord(lblgrandtotal.Text);
            string   source           = AppSessions.BMS.ToString();
            string[] stringSeparators = new string[] { ">>" };
            string[] result;
            result              = source.Split(stringSeparators, StringSplitOptions.None);
            lblboard.Text       = "Board: " + result[0];
            lblmideum.Text      = "Medium: " + result[1];
            lblstandard.Text    = "Standard: " + result[2];
            lblinvoicedate.Text = "Invoice Date: " + RegistrationDate.ToString();
            GetInvoiceNumber();
        }
        catch (Exception ex)
        {
        }
    }
    public void fill_ALL_Covered_Chaptes_Topics()
    {
        rblChapters.SelectedValue = "2";

        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);

        DataSet dsSelect = new DataSet();

        dsSelect = obj_BAL_Teacher_Dashboard.BAL_Select_Covered_Syllabus(obj_Teacher_Dashboard);

        if (dsSelect.Tables.Count == ((int)EnumFile.AssignValue.One))
        {
            if (dsSelect.Tables[0].Rows[0]["NoRecord"].ToString().Equals("0"))
            {
                WebMsg.Show("No Chapter available.");

                DropDownList[] disddl = { ddlChapter, ddlTopic };
                DisableDropDwon(disddl);
            }
        }

        else if (dsSelect.Tables.Count > ((int)EnumFile.AssignValue.Zero) && dsSelect.Tables[0].Rows.Count > ((int)EnumFile.AssignValue.Zero))
        {
            ddlChapter.DataSource     = dsSelect.Tables[0];
            ddlChapter.DataTextField  = "Chapter";
            ddlChapter.DataValueField = "ChapterID";
            ddlChapter.DataBind();
            ddlChapter.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), new ListItem("-- Select --"));

            DropDownList[] disddl = { ddlChapter, ddlTopic };
            EnableDropDwon(disddl);


            ViewState["TopicTable"] = (DataTable)dsSelect.Tables[1];

            ddlTopic.DataSource     = dsSelect.Tables[1];
            ddlTopic.DataTextField  = "Topic";
            ddlTopic.DataValueField = "TopicID";
            ddlTopic.DataBind();
            ddlTopic.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), new ListItem("-- Select --"));
            ddlTopic.SelectedIndex = Convert.ToInt32(EnumFile.AssignValue.Zero);
        }
        else
        {
            DropDownList[] disddl = { ddlChapter, ddlTopic };
            DisableDropDwon(disddl);
        }
    }
Example #11
0
    protected void SendTransactionDetails(string BuildEmailBody)
    {
        DataSet dsSettings = new DataSet();
        Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();

        dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("TransactionMailID");
        string TransactionMailIDList = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();

        ArrayList alistEmailAddress = new ArrayList(TransactionMailIDList.Split(','));
        string    response          = SendMail(alistEmailAddress, "Transaction Detail ", BuildEmailBody);
    }
Example #12
0
    private void BindGridData(int index)
    {
        DataSet dsResult = new DataSet();
        Teacher_Dashboard_BLogic Teacher_BAL = new Teacher_Dashboard_BLogic();
        string TestType = string.Empty;

        lblBMSValue.Text      = AppSessions.BMS.ToString();
        lblDivisionValue.Text = AppSessions.Division.ToString();
        lblSubjectValue.Text  = AppSessions.Subject.ToString();

        int SchoolID   = AppSessions.SchoolID;
        int ChapterID  = Convert.ToInt32(Session["ChapterID"].ToString());
        int TopicID    = Convert.ToInt32(Session["TopicID1"].ToString());
        int EmployeeID = AppSessions.EmpolyeeID;
        int DivisionID = AppSessions.DivisionID;
        int BMSID      = AppSessions.BMSID;
        int SubjectID  = AppSessions.SubjectID;

        if (index == 0)
        {
            TestType = "Pretest";
        }
        else if (index == 1)
        {
            TestType = "Posttest";
        }

        dsResult = Teacher_BAL.SelectTeacherTestResult(SchoolID, BMSID, EmployeeID, DivisionID, ChapterID, TopicID, SubjectID, TestType);
        if (dsResult.Tables.Count > 0)
        {
            if (dsResult.Tables[0].Rows.Count > 0)
            {
                tblTestResult.Visible   = true;
                trError.Visible         = false;
                grTestResult.DataSource = dsResult;
                grTestResult.DataBind();
            }
            else
            {
                tblTestResult.Visible   = false;
                trError.Visible         = true;
                grTestResult.DataSource = null;
                grTestResult.DataBind();
            }
        }
        else
        {
            grTestResult.DataSource = null;
            grTestResult.DataBind();
            trError.Visible       = true;
            tblTestResult.Visible = false;
        }
    }
    public void fill_Covered_Syllabus()
    {
        tvSyllabus.Nodes.Clear();

        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);

        DataSet dsSelect = new DataSet();

        dsSelect = obj_BAL_Teacher_Dashboard.BAL_Select_Covered_Syllabus(obj_Teacher_Dashboard);

        if (dsSelect.Tables.Count > ((int)EnumFile.AssignValue.Zero))
        {
            DataTable dtChapter = new DataTable();
            DataTable dtTopic   = new DataTable();

            dtChapter = dsSelect.Tables[0];
            dtTopic   = dsSelect.Tables[1];

            if (dtChapter.Rows.Count > ((int)EnumFile.AssignValue.Zero) && dtTopic.Rows.Count > ((int)EnumFile.AssignValue.Zero))
            {
                foreach (DataRow c in dtChapter.Rows)
                {
                    TreeNode ParentNode = new TreeNode();
                    ParentNode.Text  = c["Chapter"].ToString();
                    ParentNode.Value = c["ChapterID"].ToString();
                    tvSyllabus.Nodes.Add(ParentNode);
                    foreach (DataRow d in dtTopic.Select("ChapterID  = " + Convert.ToInt32(c["ChapterID"].ToString())))
                    {
                        TreeNode ChildNode = new TreeNode();
                        ChildNode.Text  = d["Topic"].ToString();
                        ChildNode.Value = d["TopicID"].ToString();
                        ParentNode.ChildNodes.Add(ChildNode);
                    }
                }
            }
            else
            {
                tvSyllabus.Nodes.Clear();
            }
        }
        else
        {
            tvSyllabus.Nodes.Clear();
        }
    }
    public void fill_Covered_Chapters_Topics()
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);

        DataSet dsSelect = new DataSet();

        dsSelect = obj_BAL_Teacher_Dashboard.BAL_Select_Covered_Chapters_Topics(obj_Teacher_Dashboard);

        if (dsSelect.Tables.Count == ((int)EnumFile.AssignValue.One))
        {
            if (dsSelect.Tables[0].Rows[0]["NoRecord"].ToString().Equals("0"))
            {
                lblLastChapterName.Text = "-";
                lblLastTopicName.Text   = "-";
            }
        }
        else if (dsSelect.Tables.Count > ((int)EnumFile.AssignValue.Zero))
        {
            if (dsSelect.Tables[0].Rows.Count > ((int)EnumFile.AssignValue.Zero))
            {
                lblLastChapterName.Text = dsSelect.Tables[0].Rows[0]["Chapter"].ToString();
            }
            else
            {
                lblLastChapterName.Text = "-";
            }
            if (dsSelect.Tables[1].Rows.Count > ((int)EnumFile.AssignValue.Zero))
            {
                lblLastTopicName.Text = dsSelect.Tables[1].Rows[0]["Topic"].ToString();
            }
            else
            {
                lblLastTopicName.Text = "-";
            }
        }
        else
        {
            lblLastChapterName.Text = "-";
            lblLastTopicName.Text   = "-";
        }
    }
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);
        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.ChapterID  = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID    = Convert.ToInt64(ddlTopic.SelectedValue);
        obj_Teacher_Dashboard.ExamID     = Convert.ToInt64(ddlExam.SelectedValue);

        int bmssctid = obj_BAL_Teacher_Dashboard.BAL_Select_BMS_SCTID(obj_Teacher_Dashboard);

        ViewState["BMSSCT"] = bmssctid;

        DataSet dsStudentList = new DataSet();

        dsStudentList = obj_BAL_Teacher_Dashboard.Get_StudentList(obj_Teacher_Dashboard);

        //TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ResultEntryPage", "BtnSubmit", "click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ResultEntryPage),"", Convert.ToInt32(Session["BMSSCTID"]));
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ResultEntryPage", "BtnSubmit", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.StudentListPopulatedForExam), "BMSSCT ID = " + bmssctid + " Exam Name : " + ddlExam.SelectedItem.ToString() + " Exam Marks : " + TxtTotalMarks.Text, bmssctid);

        if (dsStudentList.Tables[0].Rows.Count > 0)
        {
            GridStudentList.Visible    = true;
            btnSave.Visible            = true;
            BtnPDF.Visible             = true;
            Session["ChapName"]        = ddlChapter.SelectedItem.ToString();
            Session["TopicName"]       = ddlTopic.SelectedItem.ToString();
            Session["ExamName"]        = ddlExam.SelectedItem.ToString();
            Session["ToatlQues"]       = TxtTotalQuestions.Text;
            Session["ToatlMarks"]      = TxtTotalMarks.Text;
            Session["StudentResult"]   = dsStudentList.Tables[0];
            GridStudentList.DataSource = dsStudentList.Tables[0];
            GridStudentList.DataBind();
        }
        else
        {
            GridStudentList.DataSource = null;
            GridStudentList.DataBind();
            GridStudentList.Visible = false;
            btnSave.Visible         = false;
            BtnPDF.Visible          = false;
            WebMsg.Show("No student available.");
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID     = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID = Convert.ToInt16(Session["SubjectID"]);

        obj_Teacher_Dashboard.ChapterID = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID   = Convert.ToInt64(ddlTopic.SelectedValue);

        int bmssctid = obj_BAL_Teacher_Dashboard.BAL_Select_BMS_SCTID(obj_Teacher_Dashboard);

        //TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "TeacherDashboard", "btnSubmit", "Click", Convert.ToDateTime(System.DateTime.Now), Session.SessionID, "click on submit button", "Submit Successfully.", bmssctid);
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "TeacherDeshboard", "btnSubmit", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ActivityStarted), "BMSSCT ID : " + bmssctid, bmssctid);

        if (bmssctid > (int)EnumFile.AssignValue.Zero)
        {
            Session["ChapterTopic"] = ddlChapter.SelectedItem.ToString() + " >> " + ddlTopic.SelectedItem.ToString();
            Session["Chapter"]      = ddlChapter.SelectedItem.ToString();
            Session["BMSSCTID"]     = bmssctid;
            String Path1 = Server.MapPath("../EduResource/" + bmssctid);

            this.Title = "Epathshala - " + bmssctid;
            if (Directory.Exists(Path1) == false)
            {
                Path1 = Server.MapPath("../EduResource/NoContent");
            }

            if (Directory.Exists(Path1))
            {
                Response.Redirect("EducationalResource.aspx?Type=Teacher", false);
            }

            else
            {
                WebMsg.Show(bmssctid.ToString() + ": No Educational resource available.");
            }
        }
        else
        {
            WebMsg.Show(bmssctid.ToString() + ": No Educational resource available.");
        }
    }
Example #17
0
    //protected int cusCustom_ServerValidate(object sender, ServerValidateEventArgs e)
    //{
    //    Captcha1.ValidateCaptcha(TxtBxCap.Text.Trim());
    //    if (Captcha1.UserValidated)
    //    {
    //        e.IsValid = true;
    //        return 1;
    //    }
    //    else
    //    {
    //        e.IsValid = false;
    //    }
    //    return 0;
    //}

    private void SetProjectValueInSession()
    {
        DataSet dsSettings;
        Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard;


        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        dsSettings = new DataSet();

        dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("EpathshalaForAIS");

        if (dsSettings.Tables[0].Rows.Count > 0)
        {
            if (Convert.ToBoolean(dsSettings.Tables[0].Rows[0]["value"].ToString()))
            {
                AppSessions.IsAISProject = true;
                //imgcompanylogo.ImageUrl = "~/App_Themes/AISSlideshow/images/ais-logo.jpg";
                //imgcompanylogo.Style["Width"] = "200px";
            }
            else
            {
                AppSessions.IsAISProject = false;
            }
        }
        else
        {
            AppSessions.IsAISProject = false;
        }


        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        dsSettings = new DataSet();

        dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("ShowICICILogo");

        if (dsSettings.Tables[0].Rows.Count > 0)
        {
            if (Convert.ToBoolean(dsSettings.Tables[0].Rows[0]["value"].ToString()))
            {
                //imgcompanylogo.ImageUrl = "~/App_Themes/AISSlideshow/images/icicic-logo.png";
            }
        }
    }
    public void Fill_Chart_Data()
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);

        DataSet dsSelect = new DataSet();

        dsSelect = obj_BAL_Teacher_Dashboard.BAL_Select_Chart_Data(obj_Teacher_Dashboard);

        if (dsSelect.Tables[0].Rows.Count > ((int)EnumFile.AssignValue.Zero))
        {
            LblCoveredChapter.Visible   = true;
            LblUncoveredChapter.Visible = true;

            Int32 CoveredChapters   = Convert.ToInt32(dsSelect.Tables[0].Rows[0]["Covered"].ToString());
            Int32 UncoveredChapters = 100 - CoveredChapters;

            LblCoveredChapter.Width   = CoveredChapters * 2;
            LblUncoveredChapter.Width = UncoveredChapters * 2;


            lblCovered.Text   = Convert.ToString(CoveredChapters) + "%";
            lblUncovered.Text = Convert.ToString(UncoveredChapters) + "%";

            lblCovered1.Text   = Convert.ToString(CoveredChapters) + "%";
            lblUncovered1.Text = Convert.ToString(UncoveredChapters) + "%";
        }
        else
        {
            LblCoveredChapter.Visible   = false;
            LblUncoveredChapter.Visible = false;

            LblCoveredChapter.Text   = "";
            LblUncoveredChapter.Text = "";
        }
    }
Example #19
0
    protected string GenerateEmailBody()
    {
        string Body = string.Empty;

        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        DataSet ds             = new DataSet();
        int     ReschedulingID = 0;

        try
        {
            ds = obj_BAL_Teacher_Dashboard.SelectLastReschedulingID(AppSessions.EmpolyeeID);
            if (ds != null & ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ReschedulingID = Convert.ToInt32(ds.Tables[0].Rows[0]["ReschedulingID"].ToString());
                }
            }

            Body = "<b>Hello Admin,<b/><br/><br/>";

            Body += "<table border='1' width='100%'>";
            Body += "<tr><td colspan='4' align='center'><b>Rescheduling Request<b/></td></tr>";
            Body += "<tr><td><b>School:<b/></td><td>" + AppSessions.SchoolName + "</td><td><b>Date:<b/></td><td>" + System.DateTime.Now.ToString("dd-MMM-yyyy") + "</td></tr>";
            Body += "<tr><td><b>BMS:<b/></td><td colspan='3'>" + AppSessions.BMS + "</td></tr>";
            Body += "<tr><td><b>SCT:<b/></td><td colspan='3'>" + AppSessions.Subject + ">>" + Session["ChapterTopic"] + "</td></tr>";
            Body += "<tr><td><b>Div:<b/></td><td colspan='3'>" + AppSessions.Division + "</td></tr>";
            Body += "<tr><td><b>Teacher:<b/></td><td colspan='3'>" + AppSessions.UserName + "</td></tr>";
            Body += "</table><br/>";


            Body += "<a href='" + Session["LoginURL"].ToString() + "?ID=" + ReschedulingID + "'>Please click here to approve reschedule request.<a/><br/><br/>";
            //Body += "<a href='http://localhost:6991/Epathshala/Default.aspx?ID=" + ReschedulingID + "'>Please click here to approve reschedule request.<a/><br/><br/>";
            Body += "<b>Regards,<b/><br/>";
            Body += "<b>" + EmailUtility.USERNAME + "<b/>";
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        return(Body);
    }
Example #20
0
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        ArrayList alistContacts = new ArrayList();
        string    Body          = string.Empty;

        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);
        obj_Teacher_Dashboard.ChapterID  = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID    = Convert.ToInt64(ddlTopic.SelectedValue);

        int result = obj_BAL_Teacher_Dashboard.BAL_Insert_Rescheduling_BMSSCT(obj_Teacher_Dashboard);

        int bmssctid = obj_BAL_Teacher_Dashboard.BAL_Select_BMS_SCTID(obj_Teacher_Dashboard);

        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ReschedulingChapterTopicPage", "BtnSubmit", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ReschedulingRequestSubmited), "Request for Rescheduling BMSSCT ID : " + bmssctid, bmssctid);

        if (result == ((int)EnumFile.AssignValue.One))
        {
            alistContacts = GetEmailAddress();
            Body          = GenerateEmailBody();
            EmailUtility.SendEmail(alistContacts, "Rescheduling request notification", Body);
            WebMsg.Show("Rescheduling request sent successfully.");
            Applied_Chapter_Topics();
        }
        else if (result == ((int)EnumFile.AssignValue.Zero))
        {
            WebMsg.Show("This Chapter, Topic are already requested for Rescheduling.");
        }

        DropDownList[] disddl3 = { ddlChapter, ddlTopic };
        DisableDropDwon(disddl3);

        DropDownList[] disddl = { ddlChapter };
        EnableDropDwon(disddl);
    }
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);
        obj_Teacher_Dashboard.ChapterID  = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID    = Convert.ToInt64(ddlTopic.SelectedValue);
        obj_Teacher_Dashboard.ExamName   = TxtExamName.Text;
        obj_Teacher_Dashboard.TotalQues  = Convert.ToInt32(TxtTotalQuestions.Text);
        obj_Teacher_Dashboard.TotalMarks = Convert.ToInt32(TxtTotalMarks.Text);

        int bmssctid = obj_BAL_Teacher_Dashboard.Get_BMSSCTID(obj_Teacher_Dashboard);

        if (bmssctid == ((int)EnumFile.AssignValue.Zero))
        {
            WebMsg.Show("BMSSCT does not exists.");
        }
        else
        {
            TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ExamEntryPage", "BtnSubmit", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ExamCreatedSuccessfully), "BMSSCT ID = " + bmssctid + " Exam Name : " + TxtExamName.Text + " Exam Marks : " + TxtTotalMarks.Text, bmssctid);

            obj_Teacher_Dashboard.BMSSCTID = Convert.ToInt64(bmssctid);
            int result = obj_BAL_Teacher_Dashboard.BAL_Insert_Exam(obj_Teacher_Dashboard);
            if (result == ((int)EnumFile.AssignValue.One))
            {
                WebMsg.Show("Exam entry has been entered successfully.");
            }
            else if (result == ((int)EnumFile.AssignValue.Zero))
            {
                WebMsg.Show("This exam entry already exists.");
            }
        }
        ClearControls();
    }
    public void IsClassTeacher()
    {
        int IsclassTeacher = Convert.ToInt32(EnumFile.ClassTeacher.IsNotClassTeacher);

        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);

        IsclassTeacher = obj_BAL_Teacher_Dashboard.BAL_IsCLassTeacher_Select(obj_Teacher_Dashboard);

        if (IsclassTeacher == Convert.ToInt32(EnumFile.ClassTeacher.IsClassTeacher))
        {
            btnAttendance.Text = "Take Attendance";
        }
        else
        {
            btnAttendance.Text = "View Attendance";
        }
    }
Example #23
0
    private int GetDefaultSchoolID()
    {
        int schoolid = 0;

        DataSet dsSettings;
        Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard;

        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        dsSettings = new DataSet();

        dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("DefaultSchoolID");

        if (dsSettings.Tables[0].Rows.Count > 0)
        {
            schoolid = Convert.ToInt32(Convert.ToString(dsSettings.Tables[0].Rows[0]["value"]));
        }
        else
        {
            schoolid = 0;
        }

        return(schoolid);
    }
    protected void btnsearcksubmit_Click(object sender, EventArgs e)
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        string strBMSSCTID = string.Empty;

        foreach (GridViewRow row in GVChapter.Rows)
        {
            CheckBox chk = (CheckBox)row.FindControl("chkSelect");
            if (chk.Checked)
            {
                HiddenField hdn = (HiddenField)row.FindControl("hdnBMSSCTID");
                strBMSSCTID += hdn.Value + ",";
            }
        }
        if (strBMSSCTID.Length > 1)
        {
            strBMSSCTID = strBMSSCTID.Substring(0, strBMSSCTID.Length - 1);
            SetFirstBMSSCTIDInSession(strBMSSCTID);
            if (!string.IsNullOrEmpty(strBMSSCTID))
            {
                Response.Redirect("SubjectWiseTestStepTwo.aspx?rdu=" + HttpUtility.UrlEncode("../Teacher/TeacherAssessment.aspx?Level=0&TestType=Posttest&BMSSCTID=" + strBMSSCTID + "&noq=" + txtNumQue.Text.Trim() + "") + "");
            }
        }
    }
Example #25
0
    protected void BuyPackage()
    {
        try
        {
            ServicePointManager.Expect100Continue = true;
            ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); };

            DataSet dsSettings = new DataSet();
            Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
            dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("ATOMLoginID");
            string AtomLoginID = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();

            dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("ATOMPassword");
            string AtomPassword = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();

            dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("ATOMProductID");
            string AtomProductID = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();

            dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("ATOMTransactionType");
            string AtomTransactionType = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();

            dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("ATOMTransactionServiceAmount");
            string ATOMTransactionServiceAmount = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();


            dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("ATOMCustomerAccountNumber");
            string ATOMCustomerAccountNumber = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();

            dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("ATOMPaymentIP");
            string ATOMPaymentIP = dsSettings.Tables[0].Rows[0]["value"].ToString().Trim();


            Uri    navigateUri = new Uri(System.Web.HttpContext.Current.Request.Url, "PaymentResponseATOM.aspx");
            string ReturnUrl   = navigateUri.ToString();

            TransactionID            = GetTransactionID();
            Session["TransactionID"] = TransactionID.ToString();

            string    username         = AppSessions.UserName.ToString();
            string    userencodestring = Base64Encode(username.Trim());
            DataTable DTStudentDetails = new DataTable();
            DTStudentDetails = GetStudentDetails();
            string CustomerName    = DTStudentDetails.Rows[0]["FirstName"].ToString() + " " + DTStudentDetails.Rows[0]["MiddleName"].ToString() + " " + DTStudentDetails.Rows[0]["LastName"].ToString();
            string CustomerEmailID = DTStudentDetails.Rows[0]["EmailID"].ToString();
            if (CustomerEmailID == string.Empty)
            {
                CustomerEmailID = "0";
            }
            string CustomerMobileNo = DTStudentDetails.Rows[0]["MobileNo"].ToString();
            if (CustomerMobileNo == string.Empty)
            {
                CustomerMobileNo = "0";
            }
            string BillingAddress = DTStudentDetails.Rows[0]["Address"].ToString();
            if (BillingAddress == string.Empty)
            {
                BillingAddress = "0";
            }

            //  This URL will send request on server and it will return below details:
            //  URL on which next request will be send.
            //  Transaction type NBFundTransfer or CCFundTransfer.
            //  Temporary transaction ID that we have to send on next request.
            // Stange here it will return 1.
            PackagePrice = Convert.ToDecimal(Session["PackagePrice"].ToString().Trim());

            string TransactionData = "https://payment.atomtech.in/paynetz/epi/fts?login="******"&pass="******"&ttype=" + AtomTransactionType + "&prodid=" + AtomProductID + "&amt=" + PackagePrice + "&txncurr=INR&txnscamt=" + ATOMTransactionServiceAmount + "&clientcode=" + userencodestring + "&txnid=" + TransactionID + "&date=" + DateTime.Now.ToString("dd/MM/yyyy HH:MM:ss") + "&custacc=" + ATOMCustomerAccountNumber + "&mdd=" + rblfieldvalue.SelectedValue + "&ru=" + ReturnUrl + "&udf1=" + CustomerName + "&udf2=" + CustomerEmailID + "&udf3=" + CustomerMobileNo + "&udf4=" + BillingAddress + "";

            ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback((s, ce, ch, ssl) => true);
            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol  = SecurityProtocolType.Tls;
            //  ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications);
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(TransactionData);
            // Set credentials to use for this request.
            request.Credentials = CredentialCache.DefaultCredentials;
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            // Get the stream associated with the response.
            Stream receiveStream = response.GetResponseStream();
            // Pipes the stream to a higher level stream reader with the required encoding format.
            StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);

            XmlDocument xmlDoc = new XmlDocument();
            //xmlDoc.Load(TransactionData);
            xmlDoc.Load(readStream);
            string url               = xmlDoc.ChildNodes[1].ChildNodes[0].ChildNodes[0].ChildNodes[0].InnerText; // URL on wchich next request will send.
            string ttype             = xmlDoc.ChildNodes[1].ChildNodes[0].ChildNodes[0].ChildNodes[1].InnerText; // Transaction type as of now it will be NBFundTransfer.
            string tempTxnId         = xmlDoc.ChildNodes[1].ChildNodes[0].ChildNodes[0].ChildNodes[2].InnerText; // Temporary transaction ID
            string token             = xmlDoc.ChildNodes[1].ChildNodes[0].ChildNodes[0].ChildNodes[3].InnerText; // Tokan ID
            string txtStage          = xmlDoc.ChildNodes[1].ChildNodes[0].ChildNodes[0].ChildNodes[4].InnerText; // Stange here it will return 1
            string RedirectToPayment = "" + url + "?ttype=" + ttype.Trim() + "&tempTxnId=" + tempTxnId.Trim() + "&token=" + token.Trim() + "&txnStage=" + txtStage.Trim() + "";

            InsertIntoTransactionMaster();
            Response.Redirect(RedirectToPayment, false); // Send request with new URL.
        }
        catch (Exception ex)
        {
            //Response.Write("<script>alert('" + ex.Message + "');</script>");
        }
    }
Example #26
0
    private void BindFeedbackQuestion()
    {
        try
        {
            ActivityFeedbackRaing obj_Activity_Feedback_Rating = new ActivityFeedbackRaing();


            SYS_Role_BLogic obj_SYS_Role_BLogic = new SYS_Role_BLogic();
            int             BMSID = obj_SYS_Role_BLogic.BAL_Select_BMS(Convert.ToInt16(ddlBoard.SelectedValue), Convert.ToInt16(ddlMedium.SelectedValue), Convert.ToInt16(ddlStandard.SelectedValue));


            Teacher_Dashboard        obj_Teacher_Dashboard;
            Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard;

            obj_Teacher_Dashboard     = new Teacher_Dashboard();
            obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();


            obj_Teacher_Dashboard.BMSID     = Convert.ToInt64(BMSID);
            obj_Teacher_Dashboard.SubjectID = Convert.ToInt16(ddlsubject.SelectedValue.ToString());

            obj_Teacher_Dashboard.ChapterID = Convert.ToInt64(ddlchapter.SelectedValue.ToString());
            obj_Teacher_Dashboard.TopicID   = Convert.ToInt64(ddltopic.SelectedValue.ToString());


            bmssctid = obj_BAL_Teacher_Dashboard.BAL_Select_BMS_SCTID(obj_Teacher_Dashboard);

            // ds_ActivityFeedback = obj_Activity_Feedback_Rating.GetActivityFeedback(Convert.ToInt32(ddlSchool.SelectedValue), Convert.ToInt32(bmssctid));


            double[] totalavg;
            int[]    star;

            int rowcount  = ds_ActivityFeedback.Tables[3].Rows.Count + ds_ActivityFeedback.Tables[4].Rows.Count;
            int row_count = 0;

            totalavg = new double[rowcount];
            //star = new int[Convert.ToInt32(dt1.Rows[0]["QuestionCount"].ToString()) + 2];
            star = new int[6];

            if (ds_ActivityFeedback.Tables[3].Rows.Count > 0)
            {
                QuestionCount = Convert.ToInt32(ds_ActivityFeedback.Tables[3].Rows[0]["QuestionCount"].ToString());
                for (int cnt = 0; cnt < ds_ActivityFeedback.Tables[3].Rows.Count; cnt++)
                {
                    TotalRating1 = Convert.ToInt32(ds_ActivityFeedback.Tables[3].Rows[cnt]["Rating"].ToString());
                    if (TotalRating1 != 0)
                    {
                        totalavg[row_count] = (TotalRating1 / Convert.ToDouble(ds_ActivityFeedback.Tables[3].Rows[cnt]["Rating"].ToString()));
                        row_count           = row_count + 1;
                    }
                }
            }

            if (ds_ActivityFeedback.Tables[4].Rows.Count > 0)
            {
                QuestionCount = Convert.ToInt32(ds_ActivityFeedback.Tables[4].Rows[0]["QuestionCount"].ToString());

                for (int cnt = 0; cnt < ds_ActivityFeedback.Tables[4].Rows.Count; cnt++)
                {
                    TotalRating1 = Convert.ToInt32(ds_ActivityFeedback.Tables[4].Rows[cnt]["Rating"].ToString());
                    if (TotalRating1 != 0)
                    {
                        totalavg[row_count] += (TotalRating1 / Convert.ToDouble(ds_ActivityFeedback.Tables[4].Rows[cnt]["QuestionCount"].ToString()));
                        row_count            = row_count + 1;
                    }
                }
            }

            for (int avgcnt = 0; avgcnt < totalavg.Length; avgcnt++)
            {
                int roundavg = Convert.ToInt32(Math.Round(totalavg[avgcnt]));
                if (roundavg == 1)
                {
                    OneStar       += 1.0;
                    star[roundavg] = Convert.ToInt32(Math.Round((OneStar * 100 / row_count)));
                    lbl1star.Text  = star[roundavg].ToString() + "%";
                }
                else if (roundavg == 2)
                {
                    Twostar       += 1;
                    star[roundavg] = Convert.ToInt32(Math.Round((Twostar * 100 / row_count)));
                    lbl2star.Text  = star[roundavg].ToString() + "%";
                }
                else if (roundavg == 3)
                {
                    Threestar     += 1;
                    star[roundavg] = Convert.ToInt32(Math.Round((Threestar * 100 / row_count)));
                    lbl3star.Text  = star[roundavg].ToString() + "%";
                }
                else if (roundavg == 4)
                {
                    Fourstar      += 1;
                    star[roundavg] = Convert.ToInt32(Math.Round((Fourstar * 100 / row_count)));
                    lbl4star.Text  = star[roundavg].ToString() + "%";
                }
                else if (roundavg == 5)
                {
                    Fivestar      += 1;
                    star[roundavg] = Convert.ToInt32(Math.Round((Fivestar * 100 / row_count)));
                    lbl5star.Text  = star[roundavg].ToString() + "%";
                }
            }

            pnlreport.Visible = true;
        }
        catch (Exception ex)
        {
        }
    }
Example #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        if (!IsPostBack)
        {
            DataSet dsSettings = new DataSet();
            Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
            dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("ShowICICILogo");
            bool IsVisible = Convert.ToBoolean(dsSettings.Tables[0].Rows[0]["value"].ToString());
            if (IsVisible)
            {
                dvICICI.Visible = true;
                dvICICIEpath.Style.Add("margin-top", "0px");
            }
            else
            {
                dvICICI.Visible = false;
                dvICICIEpath.Style.Add("margin-top", "35px");
            }

            if (AppSessions.IsAISProject)
            {
                dvAIS.Visible = true;
                header.Style.Add("background-color", "#dddddd");
                header.Style.Add("height", "160px");
                header.Style.Add("margin-bottom", "-5px");
            }
            else
            {
                dvAIS.Visible = false;
            }

            try
            {
                checkforsession();
                DataAccess da     = new DataAccess();
                ArrayList  tmplst = new ArrayList();
                tmplst.Add(new parameter("FieldName", "IsOnline"));
                DataSet dsgetSetting = da.DAL_Select("PROC_GetConfig", tmplst);
                if (dsgetSetting != null && dsgetSetting.Tables.Count > 0)
                {
                    DataTable dt = dsgetSetting.Tables[0];


                    //Start Timer for Automatic exam Start
                    if (AppSessions.StudentID != null && AppSessions.StudentID != 0)
                    {
                        if (dt.Rows[0]["value"].Equals("false"))
                        {
                            string PathCurrn = Request.Path.ToString();
                            if (!PathCurrn.Contains("/Student/StudentAssessmentAutomaticMas.aspx"))
                            {
                                Session["ExamStarted"] = "";
                            }
                            if (Session["ExamStarted"] != null)
                            {
                                if (Session["ExamStarted"] != "Started")
                                {
                                    Timer1.Enabled  = true;
                                    Timer1.Interval = 6000;
                                }
                                else
                                {
                                    Timer1.Enabled  = false;
                                    Timer1.Interval = int.MaxValue;
                                }
                            }
                            else
                            {
                                Timer1.Enabled  = true;
                                Timer1.Interval = 6000;
                            }
                        }
                        else
                        {
                            Timer1.Enabled = false;
                        }
                        //End Start Timer for Automatic exam Start
                    }
                    else
                    {
                        Timer1.Enabled = false;
                    }
                    //End Start Timer for Automatic exam Start
                }



                if (AllowMultiLangual())
                {
                    ddlLanguage12.Visible = true;
                }
                else
                {
                    ddlLanguage12.Visible = false;
                }
                ddlLanguage12.SelectedValue = Session["LANG"].ToString();

                //checkforsession();
                if (Session["UserName"] != null || Session["UserName"] != "")
                {
                    //    //lblWelcome.Text =
                    lblWelcome.Text = Session["UserName"].ToString();

                    if (AppSessions.AppUserType != "Student")
                    {
                        //        //lblschool.Visible = true;
                        //        //lblSchoolName.Text = lblSchoolName.Text + " " + Session["SchoolName"].ToString();
                        //        //lblUserType.Visible = true;
                        //        //lblUserType.Text = lblUserType.Text + " " + AppSessions.Role;
                    }
                }
                //if (Request.QueryString["MenuVisible"] == "False")
                //{
                //    Menu1.Visible = false;
                //    ddlLanguage12.Visible = false;
                //    lbtnSignOut.Visible = false;
                //    lblWelcome.Visible = false;
                //}
                //else
                //{
                //    Menu1.Visible = true;
                //    ddlLanguage12.Visible = true;
                //    lbtnSignOut.Visible = true;
                //    lblWelcome.Visible = true;
                //}
                if (AppSessions.RoleID != null)
                {
                    switch (AppSessions.RoleID)
                    {
                    case (int)EnumFile.Role.E_Admin:
                        Mv_RolewiseMenus.ActiveViewIndex = 0;
                        break;

                    case (int)EnumFile.Role.S_Admin:
                        Mv_RolewiseMenus.ActiveViewIndex = 1;
                        break;

                    case (int)EnumFile.Role.Teacher:
                        Mv_RolewiseMenus.ActiveViewIndex = 2;
                        break;

                    case (int)EnumFile.Role.Student:
                        Mv_RolewiseMenus.ActiveViewIndex = 3;
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                //Response.Redirect("../OtherPages/Login.aspx");
                //Response.Redirect("../OtherPages/Landing.aspx");
                //Response.Redirect("../NewPublic/epathhome.aspx");
                Response.Redirect("../NewPublic/userLogin.aspx");

                throw ex;
            }
        }
        else
        {
            if (AppSessions.RoleID == null && AppSessions.RoleID == 0)
            {
            }

            //ddlLanguage12.SelectedValue = Session["LANG"].ToString();
        }
    }
Example #28
0
    protected void FillResource()
    {
        try
        {
            DataSet dsSettings = new DataSet();
            Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();

            //TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "EducationResourcepage", "Page", "Load", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.EducationResourcePage), "Education Resource Page  Loaded.", Convert.ToInt32(Session["BMSSCTID"]));

            lblSiteMap.Text      = Session["DEMOBMSSDNameEduResource"].ToString();
            LblChapterTopic.Text = Session["DEMOChapterTopic"].ToString();
            objeAes = new SimplerAES();
            Int64  bmssctid = Convert.ToInt64(Session["DEMOBMSSCTID"]);
            String Path1    = Server.MapPath("../EduResource/" + bmssctid);

            lblSiteMap.ToolTip = bmssctid.ToString();
            if (Directory.Exists(Path1) == false)
            {
                Path1 = Server.MapPath("../EduResource/NoContent");
            }

            if (Directory.Exists(Path1))
            {
                string[] dirName = Directory.GetDirectories(Path1);
                int      PathLen = Path1.Length + 1;

                DataTable dt = new DataTable();
                dt.Columns.Add("ResourcePath");
                dt.Columns.Add("Resource");
                dt.Columns.Add("Ext");
                DataRow dr;
                string  strText = string.Empty;

                // Raff

                //bool Pretest;
                //if (getConfigValue("Pretest") == "1")
                //{
                //    Pretest = true;
                //}
                //else
                //{
                //    Pretest = false;
                //}
                //if (Pretest)
                //{
                //    if (AppSessions.StudentID != null && AppSessions.StudentID != 0)
                //    {
                //        dr = dt.NewRow();
                //        dr["Resource"] = "Pretest";
                //        dr["ResourcePath"] = "../Student/StudentAssessment.aspx?Level=0&TestType=Pretest";
                //        dr["Ext"] = ".Test";
                //        dt.Rows.Add(dr);
                //    }
                //    else
                //    {
                //        dr = dt.NewRow();
                //        dr["Resource"] = "Pretest";
                //        dr["ResourcePath"] = "../Teacher/TeacherAssessment.aspx?Level=0&TestType=Pretest";
                //        dr["Ext"] = ".Test";
                //        dt.Rows.Add(dr);
                //    }
                //}

                // Raff

                foreach (string st in dirName)
                {
                    string FullPath = string.Empty;
                    //string FullPath1 = string.Empty;
                    string FileName = string.Empty;
                    string ext      = string.Empty;

                    string[] Files = Directory.GetFiles(Path1 + "\\" + st.Substring(PathLen) + "\\");

                    if (Files.Length > 0)
                    {
                        //FullPath1 = Path1 + "\\" + st.Substring(PathLen) + Files[0];
                        FileName = Path.GetFileName(Files[0]);
                        ext      = Path.GetExtension(Files[0]);
                        ext      = ext.ToLower();

                        if (ext.ToString().Equals(".scc"))
                        {
                            FileName = Path.GetFileName(Files[1]);
                            ext      = Path.GetExtension(Files[1]);
                        }

                        FullPath = st + "\\" + FileName;


                        if (FileName != string.Empty)
                        {
                            dr = dt.NewRow();

                            if (FullPath.Contains("NoContent\\"))
                            {
                                FullPath = "../EduResource/" + "NoContent" + "/" + st.Substring(PathLen) + "/" + FileName;
                            }
                            else
                            {
                                FullPath = "../EduResource/" + bmssctid + "/" + st.Substring(PathLen) + "/" + FileName;
                            }

                            ext = ext.ToLower();
                            if (ext.ToString().Equals(".pdf"))
                            {
                                //strText += "<a href=\"../PDFViewer/web/viewer.html?lank=" + FullPath + " target=\"_blank\">" + st.Substring(PathLen) + "</a><br/><br/>";
                                //strText += "<a href=\"OpenPdf.aspx?FullPath=" + objeAes.Encrypt(FullPath) + "&FileName=" + objeAes.Encrypt(FileName) + "&DirName=" + objeAes.Encrypt(st.Substring(PathLen)) + "\" target=\"_blank\">" + st.Substring(PathLen) + "</a><br/><br/>";
                                dr["Resource"]     = st.Substring(PathLen);
                                dr["ResourcePath"] = FullPath;
                                dr["Ext"]          = ext;
                            }
                            else if (ext.ToString().Equals(".flv"))
                            {
                                // FullPath = "../EduResource/" + bmssctid + "/" + st.Substring(PathLen) + "/" + FileName;
                                //strText += "<a href=\"OpenFlv.aspx?FullPath=" + objeAes.Encrypt(FullPath) + "&ext=" + objeAes.Encrypt(ext) + "\" target=\"_blank\">" + st.Substring(PathLen) + "</a><br/><br/>";
                                dr["Resource"]     = st.Substring(PathLen);
                                dr["ResourcePath"] = FullPath;
                                dr["Ext"]          = ext;
                            }
                            else if (ext.ToString().Equals(".avi"))
                            {
                                //strText += "<a href=\"OpenFlv.aspx?FullPath=" + objeAes.Encrypt(FullPath) + "&ext=" + objeAes.Encrypt(ext) + "\" target=\"_blank\">" + st.Substring(PathLen) + "</a><br/><br/>";
                                dr["Resource"]     = st.Substring(PathLen);
                                dr["ResourcePath"] = FullPath;
                                dr["Ext"]          = ext;
                            }
                            else if (ext.ToString().Equals(".wmv"))
                            {
                                //strText += "<a href=\"OpenFlv.aspx?FullPath=" + objeAes.Encrypt(FullPath) + "&ext=" + objeAes.Encrypt(ext) + "\" target=\"_blank\">" + st.Substring(PathLen) + "</a><br/><br/>";
                                dr["Resource"]     = st.Substring(PathLen);
                                dr["ResourcePath"] = FullPath;
                                dr["Ext"]          = ext;
                            }
                            //else if (ext.ToString().Equals(".mp4"))
                            //{
                            //    //strText += "<a href=\"OpenFlv.aspx?FullPath=" + objeAes.Encrypt(FullPath) + "&ext=" + objeAes.Encrypt(ext) + "\" target=\"_blank\">" + st.Substring(PathLen) + "</a><br/><br/>";
                            //    dr["Resource"] = st.Substring(PathLen);
                            //    dr["ResourcePath"] = FullPath;
                            //    dr["Ext"] = ext;
                            //}
                            else if (ext.ToString().Equals(".swf") || ext.ToString().Equals(".mp4"))
                            {
                                dsSettings = obj_BAL_Teacher_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings("UseEncrytion");
                                bool IsEncryption = Convert.ToBoolean(dsSettings.Tables[0].Rows[0]["value"].ToString());
                                if (IsEncryption)
                                {
                                    DirectoryInfo d = new DirectoryInfo(st);

                                    int i = 1;
                                    foreach (var file in Files)
                                    {
                                        FileName = Path.GetFileName(file);
                                        ext      = Path.GetExtension(file);
                                        ext      = ext.ToLower();

                                        if (ext.ToString().Equals(".scc"))
                                        {
                                            FileName = Path.GetFileName(file);
                                            ext      = Path.GetExtension(file);
                                        }
                                        FullPath = st + "\\" + FileName;

                                        if (FullPath.Contains("NoContent\\"))
                                        {
                                            FullPath = "../EduResource/" + "NoContent" + "/" + st.Substring(PathLen) + "/" + FileName;
                                        }
                                        else
                                        {
                                            FullPath = "../EduResource/" + bmssctid + "/" + st.Substring(PathLen) + "/" + FileName;
                                        }

                                        dr                 = dt.NewRow();
                                        dr["Resource"]     = st.Substring(PathLen) + " Part - " + i;
                                        dr["ResourcePath"] = FullPath;
                                        dr["Ext"]          = ext;
                                        dt.Rows.Add(dr);
                                        i++;
                                    }
                                }
                                else
                                {
                                    dr["Resource"]     = st.Substring(PathLen);
                                    dr["ResourcePath"] = FullPath;
                                    dr["Ext"]          = ext;
                                    dt.Rows.Add(dr);
                                }
                            }
                            else if (ext.ToString().Equals(".htm") || ext.ToString().Equals(".html"))
                            {
                                dr["Resource"]     = st.Substring(PathLen);
                                dr["ResourcePath"] = FullPath;
                                dr["Ext"]          = ext;
                            }
                            else
                            {
                                dr = null;
                            }

                            if (dr != null)
                            {
                                if (!ext.ToString().Equals(".swf") && !ext.ToString().Equals(".mp4"))
                                {
                                    dt.Rows.Add(dr);
                                }
                            }
                        }
                    }
                }
                bool AllLevel;
                if (getConfigValue("AllLevel") == "0")
                {
                    AllLevel = true;
                }
                else
                {
                    AllLevel = false;
                }
                //bool PosttestAllow;
                //if (getConfigValue("Posttest") == "1")
                //{
                //    PosttestAllow = true;
                //}
                //else
                //{
                //    PosttestAllow = false;
                //}
                //if (PosttestAllow)
                //{
                //    if (AllLevel)
                //    {
                //        if (AppSessions.StudentID != null && AppSessions.StudentID != 0)
                //        {
                //            dr = dt.NewRow();
                //            dr["Resource"] = "Posttest";
                //            dr["ResourcePath"] = "../Student/StudentAssessment.aspx?Level=0&TestType=Posttest";
                //            dr["Ext"] = ".Test";
                //            dt.Rows.Add(dr);
                //        }
                //        else
                //        {
                //            dr = dt.NewRow();
                //            dr["Resource"] = "Posttest";
                //            dr["ResourcePath"] = "../Teacher/TeacherAssessment.aspx?Level=0&TestType=Posttest";
                //            dr["Ext"] = ".Test";
                //            dt.Rows.Add(dr);
                //        }
                //    }
                //    else
                //    {
                //        for (int n = 1; n < 4; n++)
                //        {
                //            if (AppSessions.StudentID != null && AppSessions.StudentID != 0)
                //            {
                //                dr = dt.NewRow();
                //                dr["Resource"] = "Posttest Level-" + n;
                //                dr["ResourcePath"] = "../Student/StudentAssessment.aspx?Level=" + n + "&TestType=Posttest";
                //                dr["Ext"] = ".Test";
                //                dt.Rows.Add(dr);
                //            }
                //            else
                //            {
                //                if (n == 1)
                //                {
                //                    dr = dt.NewRow();
                //                    dr["Resource"] = "Posttest Level-" + n;
                //                    dr["ResourcePath"] = "../Teacher/TeacherAssessment.aspx?Level=" + n + "&TestType=Posttest";
                //                    dr["Ext"] = ".Test";
                //                    dt.Rows.Add(dr);
                //                }
                //            }
                //        }
                //    }
                //}

                #region Filter By Sign - Note: $ for Student _ for teacher and Blank for All

                /*Step-1: Separate rows for student, teacher and common and remove sign*/
                /*Step-2: Identify login role*/
                /*Step-3: remove all other role's row*/

                List <DataRow> CommonFolder  = new List <DataRow>();
                List <DataRow> TeacherFolder = new List <DataRow>();
                List <DataRow> StudentFolder = new List <DataRow>();

                foreach (DataRow oDr in dt.Rows)
                {
                    string foldername     = Convert.ToString(oDr["Resource"]);
                    char   cLastCharacter = foldername[foldername.Length - 1];

                    switch (cLastCharacter)
                    {
                    case '$':
                        oDr["Resource"] = foldername.Substring(0, foldername.Length - 1);
                        StudentFolder.Add(oDr);
                        break;

                    case '_':
                        oDr["Resource"] = foldername.Substring(0, foldername.Length - 1);
                        TeacherFolder.Add(oDr);
                        break;

                    default:
                        CommonFolder.Add(oDr);
                        break;
                    }
                }
                if (AppSessions.Role == "Teacher")
                {
                    foreach (DataRow drstudent in StudentFolder)
                    {
                        dt.Rows.Remove(drstudent);
                    }
                }
                else if (AppSessions.Role == "Student")
                {
                    foreach (DataRow drteacher in TeacherFolder)
                    {
                        dt.Rows.Remove(drteacher);
                    }
                }

                #endregion

                lrLinks.Text        = HttpUtility.HtmlDecode(strText);
                ViewState["GridDt"] = dt;

                gvrecords.DataSource = (DataTable)ViewState["GridDt"];
                gvrecords.DataBind();
                //  AddNewFileSetting();
            }
        }
        catch (Exception ex)
        {
        }
    }
    protected void ddlTopic_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlTopic.SelectedIndex > 0)
        {
            DropDownList[] disddl = { ddlExam };
            DisableDropDwon(disddl);

            obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
            obj_Teacher_Dashboard     = new Teacher_Dashboard();

            obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
            obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
            obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
            obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
            obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);
            obj_Teacher_Dashboard.ChapterID  = Convert.ToInt64(ddlChapter.SelectedValue);
            obj_Teacher_Dashboard.TopicID    = Convert.ToInt64(ddlTopic.SelectedValue);

            Int64 bmssctid = Convert.ToInt64(obj_BAL_Teacher_Dashboard.Get_BMSSCTID(obj_Teacher_Dashboard));
            if (bmssctid == ((int)EnumFile.AssignValue.Zero))
            {
                WebMsg.Show("BMSSCT does not exists.");
            }
            else
            {
                obj_Teacher_Dashboard.BMSSCTID = Convert.ToInt64(bmssctid);
                DataSet ds = new DataSet();
                ds = obj_BAL_Teacher_Dashboard.Get_Exams(obj_Teacher_Dashboard);
                DataTable dt = ds.Tables[0];
                ViewState["ExamTable"] = dt;

                ddlExam.Items.Clear();

                if (dt.Rows.Count > 0)
                {
                    ddlExam.DataSource     = dt;
                    ddlExam.DataTextField  = "ExamName";
                    ddlExam.DataValueField = "ExamID";
                    ddlExam.DataBind();
                }
                ddlExam.Items.Insert(0, new System.Web.UI.WebControls.ListItem("-- Select --"));

                DropDownList[] disddl1 = { ddlExam };
                EnableDropDwon(disddl1);
            }
        }
        else
        {
            DropDownList[] disddl1 = { ddlExam };
            DisableDropDwon(disddl1);

            TxtTotalQuestions.Text = "0";
            TxtTotalMarks.Text     = "0";

            GridStudentList.DataSource = null;
            GridStudentList.DataBind();

            GridStudentList.Visible = false;
            btnSave.Visible         = false;
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        obj_BAL_Teacher_Dashboard    = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard        = new Teacher_Dashboard();
        obj_Teacher_Dashboard.ExamID = Convert.ToInt64(ViewState["ExamID"]);
        obj_BAL_Teacher_Dashboard.BAL_SYS_Delete_Student_Result(obj_Teacher_Dashboard);

        DataTable TbStudent = new DataTable("StudentExam");

        TbStudent.Columns.Add("ExamID", typeof(Int64));
        TbStudent.Columns.Add("StudentID", typeof(Int64));
        TbStudent.Columns.Add("RightAnswers", typeof(System.String));
        TbStudent.Columns.Add("WorngAnswers", typeof(Int32));
        TbStudent.Columns.Add("Total", typeof(Int32));
        TbStudent.Columns.Add("CreatedBy", typeof(Int64));

        for (int i = 0; i < GridStudentList.Rows.Count; i++)
        {
            DataRow dr = TbStudent.NewRow();
            dr["ExamID"]    = Convert.ToInt64(ViewState["ExamID"]);
            dr["StudentID"] = Convert.ToInt64(GridStudentList.DataKeys[i].Values["StudentID"].ToString());
            TextBox tb1 = (TextBox)GridStudentList.Rows[i].Cells[2].FindControl("TxtRightMarks");
            if (tb1.Text.ToString().Equals("A"))
            {
                dr["RightAnswers"] = "A";
                dr["WorngAnswers"] = Convert.ToInt32("0");
            }
            else if (tb1.Text.ToString().Equals("Z"))
            {
                dr["RightAnswers"] = "Z";
                dr["WorngAnswers"] = Convert.ToInt32("0");
            }
            else
            {
                dr["RightAnswers"] = Convert.ToInt32(tb1.Text);
                dr["WorngAnswers"] = Convert.ToInt32(Convert.ToInt32(ViewState["TotalMarks"]) - Convert.ToInt32(tb1.Text));
            }

            dr["Total"]     = Convert.ToInt32(ViewState["TotalMarks"]);
            dr["CreatedBy"] = Convert.ToInt64(Session["EmpolyeeID"]);

            TbStudent.Rows.Add(dr);
        }

        if (TbStudent.Rows.Count > ((int)EnumFile.AssignValue.Zero))
        {
            try
            {
                TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ResultEntryPage", "btnSave", "click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ExamResultSaved), "BMSSCT ID : " + Convert.ToInt32(ViewState["BMSSCTID"]) + " Exam Name : " + ddlExam.SelectedItem.ToString(), Convert.ToInt32(ViewState["BMSSCTID"]));

                string con = ConfigurationManager.AppSettings["EpathshalaStudentCon"];
                using (SqlBulkCopy copy = new SqlBulkCopy(con))
                {
                    //copy.ColumnMappings.Add(0, 0);
                    copy.ColumnMappings.Add(0, 1); //ExamID
                    copy.ColumnMappings.Add(1, 2); //StudentID
                    copy.ColumnMappings.Add(2, 3); //RightAnswers
                    copy.ColumnMappings.Add(3, 4); //WorngAnswers
                    copy.ColumnMappings.Add(4, 5); //Total
                    copy.ColumnMappings.Add(5, 8); //CreatedBy
                    copy.DestinationTableName = "Student_Exam_Result";
                    copy.WriteToServer(TbStudent);
                }
                WebMsg.Show("Result inserted successfully.");
            }
            catch (Exception ex)
            {
                WebMsg.Show("Error in inserting the result.");
            }
        }
        else
        {
            WebMsg.Show("There is no data to be set.");
        }
        ClearControls();
    }