protected void BtnChapterAdd_Click(object sender, EventArgs e)
    {
        obj_SYS_Chapter              = new SYS_Chapter();
        obj_BAL_SYS_Chapter          = new SYS_Chapter_BLogic();
        obj_SYS_Chapter.bmsid        = Convert.ToInt64(ViewState["BMSID"]);
        obj_SYS_Chapter.subjectid    = Convert.ToInt16(ddlSubject.SelectedValue);
        obj_SYS_Chapter.chapterindex = Convert.ToInt16(TxtChapterIndex.Text);
        obj_SYS_Chapter.chapter      = TxtChapterName.Text;
        obj_SYS_Chapter.employeeid   = Convert.ToInt64(Session["EmpolyeeID"]);
        int Result = obj_BAL_SYS_Chapter.BAL_SYS_Chapter_Insert(obj_SYS_Chapter);

        if (Result == ((int)EnumFile.Result.FileAdded))
        {
            WebMsg.Show("Chapter Added Successfully.");
        }
        else
        {
            WebMsg.Show("Chapter Details already exists.");
        }
        object    s  = new object();
        EventArgs ea = new EventArgs();

        ddlSubject_SelectedIndexChanged(s, ea);
    }
Exemple #2
0
    protected void btnAppRejSubmit_Click(object sender, EventArgs e)
    {
        int    CountChecked       = Convert.ToInt32(EnumFile.AssignValue.Zero);
        string tmp_SchoolBMSIDStr = string.Empty;

        foreach (GridViewRow gr in gvSchoolRegistrationBMSdetail.Rows)
        {
            CheckBox chk = new CheckBox();
            chk = (CheckBox)gr.FindControl("chkSelect");
            if (chk.Checked == true)
            {
                int StatusID;
                StatusID = Convert.ToInt32(gvSchoolRegistrationBMSdetail.DataKeys[gr.RowIndex]["StatusID"]);
                if (StatusID == Convert.ToInt32(EnumFile.Status.Appiled) || StatusID == Convert.ToInt32(EnumFile.Status.Approve) || StatusID == Convert.ToInt32(EnumFile.Status.Reject))
                {
                    if (CountChecked == Convert.ToInt32(EnumFile.AssignValue.Zero))
                    {
                        tmp_SchoolBMSIDStr = gvSchoolRegistrationBMSdetail.DataKeys[gr.RowIndex]["SchoolID"].ToString();
                    }
                    else
                    {
                        tmp_SchoolBMSIDStr = tmp_SchoolBMSIDStr + " , " + gvSchoolRegistrationBMSdetail.DataKeys[gr.RowIndex]["SchoolID"].ToString();
                    }
                    CountChecked = CountChecked + 1;
                }
                else
                {
                    CountChecked = Convert.ToInt32(EnumFile.AssignValue.Zero);
                    break;
                }
            }
        }
        if (CountChecked > Convert.ToInt32(EnumFile.AssignValue.Zero))
        {
            try
            {
                obj_SchoolRegistrationBMS     = new SchoolBMS();
                obj_BAL_SchoolRegistrationBMS = new SchoolBMS_BLogic();
                int tmpstatusid = Convert.ToInt32(EnumFile.AssignValue.Zero);
                if (rbApprove.Checked == true)
                {
                    tmpstatusid = Convert.ToInt32(EnumFile.Status.Approve);
                }
                if (rbReject.Checked == true)
                {
                    tmpstatusid = Convert.ToInt32(EnumFile.Status.Reject);
                }

                obj_SchoolRegistrationBMS.schregbmsidStr = tmp_SchoolBMSIDStr;
                obj_SchoolRegistrationBMS.StatusID       = tmpstatusid;
                obj_BAL_SchoolRegistrationBMS.BAL_SchoolBMS_UpdateStatus(obj_SchoolRegistrationBMS, "UpdateClassStatus");
                bindgrvSchoolRegistrationBMSdetail(Convert.ToInt32(ViewState["SchRegID"].ToString()));
            }
            catch (Exception ex)
            {
                WebMsg.Show(ex.Message);
            }
        }
        else
        {
            WebMsg.Show("Please select atleast one record.");
        }
    }
    /// <summary>
    /// Method wil be used to verify product license information.
    /// </summary>
    /// <param name="ProID">Product ID</param>
    /// <param name="ProKey">Product Key</param>
    /// <param name="ProCode">Product Code</param>
    /// <returns>Retuen boolean</returns>
    public static bool GetLicenseInfo(string ProID = null, string ProKey = null, string ProCode = null)
    {
        bool    Flag          = false;
        string  ProductID     = string.Empty;
        string  strCode       = string.Empty;
        string  key           = string.Empty;
        string  OldCode       = string.Empty;
        Prepaid objPrepaid    = new Prepaid();
        DataSet dsProductInfo = new DataSet();

        try
        {
            dsProductInfo = GetProductInfoFromXML();
            if (dsProductInfo.Tables.Count > 0 & dsProductInfo != null)
            {
                if (dsProductInfo.Tables[0].Rows.Count > 0)
                {
                    OldCode = dsProductInfo.Tables[0].Rows[0]["OldCode"].ToString();
                }
            }

            if (ProID == null & ProKey == null & ProCode == null)
            {
                ProductID = GetProductID();
                if (dsProductInfo.Tables.Count > 0 & dsProductInfo != null)
                {
                    if (dsProductInfo.Tables[0].Rows.Count > 0)
                    {
                        strCode = dsProductInfo.Tables[0].Rows[0]["Code"].ToString();
                        key     = dsProductInfo.Tables[0].Rows[0]["ProductKey"].ToString();
                    }
                }
            }
            else
            {
                ProductID = ProID;
                key       = ProKey;
                strCode   = ProCode;
            }



            if (strCode == string.Empty & key == string.Empty)
            {
                Flag = false;
            }
            else
            {
                if (strCode == objPrepaid.GetSystemInfo(ProductID, OldCode))
                {
                    enmErrorCode ErrorCode = new VarnindraClient.enmErrorCode();
                    ErrorCode = objPrepaid.CheckRegistration(strCode, key.Replace(" - ", ""), ProductID, DateTime.Now, "0", "0");

                    switch (ErrorCode.ToString())
                    {
                    case "Invalid_Product_ID":
                        Flag = false;
                        break;

                    case "InvalidKey":
                        Flag = false;
                        break;

                    case "Invalid_Count1":
                        Flag = false;
                        break;

                    case "Invalid_Count2":
                        Flag = false;
                        break;

                    case "Invalid_Start_Date":
                        Flag = false;
                        break;

                    case "No_Error":
                        Flag = true;
                        break;
                    }
                }
                else
                {
                    Flag = false;
                }
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }

        return(Flag);
    }
Exemple #4
0
    protected void BindSubjectList()
    {
        try
        {
            if (Session["ShowPaymentPages"] != null)
            {
                //Session["DemoBMS"] = AppSessions.BMSID;
            }
            else
            {
                //GetStudentDetailBMS();
            }
            Student_DashBoard_BLogic obj_BAL_Student_Dashboard = new Student_DashBoard_BLogic();
            StudentDash obj_Student_Dashboard = new StudentDash();
            ArrayList   Alist = new ArrayList();

            //if (ViewState["ArrayList"] != null)
            //{
            //    Alist = (ArrayList)ViewState["ArrayList"];
            //    string PackageFDID = string.Empty;
            //    for (int i = 0; i < Alist.Count; i++)
            //    {
            //        if (PackageFDID != string.Empty)
            //        {
            //            PackageFDID = PackageFDID + "," + Alist[i].ToString();
            //        }
            //        else
            //        {
            //            PackageFDID = PackageFDID + Alist[i].ToString();
            //        }
            //    }

            //    obj_Student_Dashboard.BMSID = AppSessions.BMSID;
            //    obj_Student_Dashboard.PackageFDID = PackageFDID;
            //    obj_Student_Dashboard.Mode = "Selected";
            //    DataSet ds = new DataSet();
            //    //ds = obj_BAL_Student_Dashboard.BAL_Student_Subject_Select(obj_Student_Dashboard);
            //    ds = obj_BAL_Student_Dashboard.BAL_Student_Purchased_Package("", Convert.ToInt32(AppSessions.BMSID), Convert.ToInt32(AppSessions.StudentID));

            //    DataTable dt = new DataTable();
            //    dt.Columns.Add("SubjectID", typeof(Int32));
            //    dt.Columns.Add("Subject", typeof(string));



            //    if (ds.Tables[0].Rows.Count > 0 && ds != null)
            //    {
            //        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            //        {

            //            if (ds.Tables[0].Rows[i]["PackageType"].ToString().ToLower() == "combo")
            //            {
            //                string[] subjects = ds.Tables[0].Rows[i]["subject"].ToString().Split(',');
            //                string[] subjectsid = ds.Tables[0].Rows[i]["subjectid"].ToString().Split(',');
            //                for (int subcnt = 0; subcnt < subjects.Length; subcnt++)
            //                {
            //                    DataRow dr = dt.NewRow();
            //                    dr["SubjectID"] = subjectsid[subcnt].ToString().Trim();
            //                    dr["Subject"] = subjects[subcnt].ToString().Trim();
            //                    dt.Rows.Add(dr);
            //                }
            //            }
            //            else
            //            {
            //                DataRow dr = dt.NewRow();
            //                dr["SubjectID"] = ds.Tables[0].Rows[i]["Subjectid"].ToString().Trim();
            //                dr["Subject"] = ds.Tables[0].Rows[i]["Subject"].ToString().Trim();
            //                dt.Rows.Add(dr);
            //            }

            //        }
            //        DataTable dt1 = dt.DefaultView.ToTable(true, "SubjectID", "Subject");
            //        DataView dv = dt1.DefaultView;
            //        dv.Sort = "Subject";
            //        dt = dv.ToTable();
            //        // dt = dt.DefaultView.ToTable(true);
            //        rbSubjectList.DataSource = dt;
            //        rbSubjectList.DataValueField = "SubjectID";
            //        rbSubjectList.DataTextField = "Subject";
            //        rbSubjectList.DataBind();
            //        rbSubjectList.SelectedIndex = 0;
            //    }
            //}

            //if (Session["DemoBMS"] != null)
            if (Session["BMSID"] != null)
            {
                obj_Student_Dashboard.BMSID = Convert.ToInt64(Session["BMSID"]);
                obj_Student_Dashboard.Mode  = "All";
                DataSet ds = new DataSet();
                ds = obj_BAL_Student_Dashboard.BAL_Student_Subject_Select(obj_Student_Dashboard);
                if (ds.Tables[0].Rows.Count > 0 && ds != null)
                {
                    rbSubjectList.DataSource     = ds.Tables[0];
                    rbSubjectList.DataValueField = "SubjectID";
                    rbSubjectList.DataTextField  = "Subject";
                    rbSubjectList.DataBind();
                    rbSubjectList.SelectedIndex = 0;
                    Session["SubjectID"]        = rbSubjectList.SelectedValue;
                }
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
    }
    protected void BindSubjectList()
    {
        try
        {
            //if (Session["ShowPaymentPages"] != null)
            //{
            ViewState["StudentBMS"] = AppSessions.BMSID;
            //}
            //else
            //{
            //    GetStudentDetailBMS();
            //}
            obj_BAL_Student_Dashboard = new Student_DashBoard_BLogic();
            obj_Student_Dashboard     = new StudentDash();
            ArrayList Alist = new ArrayList();


            if (ViewState["ArrayList"] != null)
            {
                Alist = (ArrayList)ViewState["ArrayList"];
                string PackageFDID = string.Empty;
                for (int i = 0; i < Alist.Count; i++)
                {
                    if (PackageFDID != string.Empty)
                    {
                        PackageFDID = PackageFDID + "," + Alist[i].ToString();
                    }
                    else
                    {
                        PackageFDID = PackageFDID + Alist[i].ToString();
                    }
                }

                obj_Student_Dashboard.BMSID       = AppSessions.BMSID;
                obj_Student_Dashboard.PackageFDID = PackageFDID;
                obj_Student_Dashboard.Mode        = "Selected";
                DataSet ds = new DataSet();
                ds = obj_BAL_Student_Dashboard.BAL_Student_Subject_Select(obj_Student_Dashboard);

                if (ds.Tables[0].Rows.Count > 0 && ds != null)
                {
                    ddlsubject.DataSource     = ds.Tables[0];
                    ddlsubject.DataValueField = "SubjectID";
                    ddlsubject.DataTextField  = "Subject";
                    ddlsubject.DataBind();
                    ddlsubject.SelectedIndex = 0;
                }

                ddlsubject.Items.Insert(0, "Select");
            }

            if (ViewState["StudentBMS"] != null)
            {
                obj_Student_Dashboard.BMSID = Convert.ToInt64(ViewState["StudentBMS"]);
                obj_Student_Dashboard.Mode  = "All";
                DataSet ds = new DataSet();
                ds = obj_BAL_Student_Dashboard.BAL_Student_Subject_Select(obj_Student_Dashboard);
                if (ds.Tables[0].Rows.Count > 0 && ds != null)
                {
                    ddlsubject.DataSource     = ds.Tables[0];
                    ddlsubject.DataValueField = "SubjectID";
                    ddlsubject.DataTextField  = "Subject";
                    ddlsubject.DataBind();
                }
                ddlsubject.Items.Insert(0, "Select");
                ddlsubject.SelectedIndex = 0;
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
    }
Exemple #6
0
    /// <summary>
    /// This method fills grid report using given datatable
    /// </summary>
    /// <param name="dtSearch"></param>

    public void Search(DataTable dtSearch)
    {
        try
        {
            searchstatus = 1;

            Getallinitialdata();
            GetAllSettings();

            Session["dtsearch"]   = dtSearch;
            gridreport.DataSource = null;
            gridreport.DataSource = dtSearch;
            gridreport.DataBind();
            SetTotal();
            ALLSetting(dtSearch);

            //if (sortingcolumn != null && sortingcolumn != "")
            //{
            //    DataView dv = new DataView(dtSearch);

            //    string SortDir = string.Empty;
            //    if (dir == SortDirection.Ascending)
            //    {
            //        dir = SortDirection.Descending;
            //        SortDir = "Desc";
            //    }
            //    else
            //    {
            //        dir = SortDirection.Ascending;
            //        SortDir = "Asc";
            //    }

            //    dv.Sort = sortingcolumn + " " + SortDir;
            //    gridreport.DataSource = dv;

            //    gridreport.DataBind();



            //}



            //for (int j = 0; j < gridreport.Rows.Count; j++)
            //{

            //    for (int i = 0; i < gridreport.Rows[0].Cells.Count; i++)
            //    {
            //        //string HeaderText = c.HeaderText.ToLower();
            //        string HeaderText = (((System.Web.UI.WebControls.DataControlFieldCell)(gridreport.Rows[j].Cells[i])).ContainingField).HeaderText.ToLower();

            //        try
            //        {
            //            switch (dtSearch.Columns[HeaderText].DataType.ToString().ToLower())
            //            {
            //                case "system.string":
            //                    break;
            //                case "system.decimal":
            //                    gridreport.Rows[j].Cells[i].HorizontalAlign = HorizontalAlign.Right;
            //                    break;
            //                case "system.int16":
            //                    gridreport.Rows[j].Cells[i].HorizontalAlign = HorizontalAlign.Right;
            //                    break;
            //                case "system.int32":
            //                    gridreport.Rows[j].Cells[i].HorizontalAlign = HorizontalAlign.Right;
            //                    break;

            //                case "system.int64":
            //                    gridreport.Rows[j].Cells[i].HorizontalAlign = HorizontalAlign.Right;
            //                    break;
            //                case "system.byte":
            //                case "system.boolean":
            //                    break;
            //                case "system.datetime":
            //                    break;
            //                case "System.Diagnostics.Debugger":
            //                    break;
            //                //default:
            //                //    System.Diagnostics.Debugger.Break();
            //                //    break;
            //            }

            //            if (ColumnWidth != null)
            //            {
            //                foreach (string s in ColumnWidth)
            //                {
            //                    string[] words = s.Split('=');
            //                    if (HeaderText.ToLower() == words[0].ToString().ToLower())
            //                    {
            //                        gridreport.Rows[j].Cells[i].Width = Convert.ToInt32(words[1]);
            //                        break;
            //                    }
            //                }
            //            }
            //            if (alignment != null)
            //            {
            //                foreach (string s in alignment)
            //                {
            //                    string[] words = s.Split('=');
            //                    if (HeaderText.ToLower() == words[0].ToString().ToLower())
            //                    {
            //                        string stralignment = words[1];

            //                        if (stralignment.Trim().ToLower() == "right")
            //                        {
            //                            gridreport.Rows[j].Cells[i].HorizontalAlign = HorizontalAlign.Right;
            //                        }
            //                        else if (stralignment.Trim().ToLower() == "left")
            //                        {
            //                            gridreport.Rows[j].Cells[i].HorizontalAlign = HorizontalAlign.Left;
            //                        }
            //                        else if (stralignment.Trim().ToLower() == "center")
            //                        {
            //                            gridreport.Rows[j].Cells[i].HorizontalAlign = HorizontalAlign.Center;
            //                        }
            //                        else if (stralignment.Trim().ToLower() == "justify")
            //                        {
            //                            gridreport.Rows[j].Cells[i].HorizontalAlign = HorizontalAlign.Justify;
            //                        }
            //                    }
            //                }
            //            }

            //            if (HiddenFields != null)
            //            {

            //                foreach (string s in HiddenFields)
            //                {
            //                    if (HeaderText.ToLower() == s.ToLower())
            //                    {
            //                        gridreport.Rows[j].Cells[i].Visible = false;
            //                        (((System.Web.UI.WebControls.DataControlFieldCell)(gridreport.Rows[j].Cells[i])).ContainingField).Visible = false;
            //                        break;
            //                    }
            //                }
            //            }
            //        }

            //        catch (Exception ex)
            //        {
            //        }
            //    }
            //}
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message.ToString());
        }
    }
    //protected void OnTextChanged(object sender, EventArgs e)
    //{
    //    //ClientScript.RegisterClientScriptBlock(GetType(), "alert", "alert('" + (sender as TextBox).Text + "');", true);
    //    TextBox tb = sender as TextBox;
    //    if (Convert.ToInt32(tb.Text) > Convert.ToInt32(ViewState["TotalMarks"]))
    //    {
    //        WebMsg.Show("Right marks must be lessthen Total marks.");
    //        tb.Text = "";
    //        tb.Focus();
    //    }
    //}

    #endregion

    #endregion

    #region User Define Function

    public void fill_ALL_Covered_Chaptes_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_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, ddlExam };
                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 System.Web.UI.WebControls.ListItem("-- Select --"));

            DropDownList[] disddl = { ddlChapter, ddlTopic, ddlExam };
            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 System.Web.UI.WebControls.ListItem("-- Select --"));
            ddlTopic.SelectedIndex = Convert.ToInt32(EnumFile.AssignValue.Zero);
        }
        else if (dsSelect.Tables[0].Rows.Count == 0)
        {
            ddlChapter.DataSource     = dsSelect.Tables[0];
            ddlChapter.DataTextField  = "Chapter";
            ddlChapter.DataValueField = "ChapterID";
            ddlChapter.DataBind();

            ddlChapter.Items.Insert(0, new System.Web.UI.WebControls.ListItem("-- Select --"));
        }
        else
        {
            DropDownList[] disddl = { ddlChapter, ddlTopic, ddlExam };
            DisableDropDwon(disddl);
        }
    }
    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();
    }
Exemple #9
0
    public void Displayselecteddata(Hashtable hashtable, object objsender)
    {
        if (ReportControl1.Visible == true)
        {
            ReportControl1.Visible = false;
            ReportControl2.Visible = true;
            FirstRpt.Visible       = true;
            secondRpt.Visible      = true;
            btnback.Visible        = true;

            slblSchoolValue.Text  = ddlSchool.SelectedItem.Text;
            slblTeacherValue.Text = hashtable["Teacher"].ToString();
            //slblDurationValue.Text = hashtable["\r\nTotal Activity Duration"].ToString();
            slblDurationValue.Text = hashtable["Total Activity Duration"].ToString();
            slblDateValue.Text     = hashtable["ActivityDate"].ToString();

            obj_TracklogRPT = new TrackLogRPT_BLogic();

            DataSet dsResult = obj_TracklogRPT.BAL_Select_TeacherWiseBMSSCTWiseBYEmpIDTrackLog(Convert.ToInt32(hashtable["EmployeeID"].ToString()), Convert.ToDateTime(hashtable["ActivityDate"].ToString()));

            if (dsResult.Tables.Count > 0)
            {
                CommanCallUserControl(dsResult.Tables[0], "../ReportXMLFiles/TeacherTrackRPTEmpWise.xml", 2);
            }
            else
            {
                WebMsg.Show("No data found.");
            }
        }
        else if (ReportControl2.Visible == true)
        {
            ReportControl2.Visible = false;
            div1.Visible           = true;
            secondRpt.Visible      = false;
            thirdRpt.Visible       = true;
            tlblSchoolValue.Text   = slblSchoolValue.Text;
            tlblTeacherValue.Text  = slblTeacherValue.Text;
            tlblDurationValue.Text = hashtable["Total Activity Duration"].ToString();
            tlblDateValue.Text     = slblDateValue.Text;

            string   BMSString = hashtable["BMS_SCT"].ToString();
            string[] lines     = Regex.Split(BMSString, "&gt;&gt;");
            tlblboardValue.Text    = lines[0];
            tlblmediumValue.Text   = lines[1];
            tlblStandardValue.Text = lines[2];
            tlblSubjectValue.Text  = lines[3];
            tlblChapterValue.Text  = lines[4];
            tlblTopicValue.Text    = lines[5];


            obj_TracklogRPT = new TrackLogRPT_BLogic();

            DataSet dsResult = obj_TracklogRPT.BAL_Select_TeacherWiseBMSSCTWiseBYEmpIDBMSSCTIDTrackLog(Convert.ToInt32(hashtable["BMSSCTID"].ToString()), Convert.ToInt32(hashtable["DivisionID"].ToString()), Convert.ToInt32(hashtable["EmployeeID"].ToString()), Convert.ToDateTime(hashtable["ActivityDate"].ToString()));

            if (dsResult.Tables.Count > 0)
            {
                CommanCallUserControl(dsResult.Tables[0], "../ReportXMLFiles/TeacherTrackRPTEmpWiseBMSSCT.xml", 3);
            }
            else
            {
                WebMsg.Show("No data found.");
            }
        }
    }
Exemple #10
0
    private void CommanCallUserControl(DataTable dt, string reporttype, int control)
    {
        GetConnectionStringSTRING obj = new GetConnectionStringSTRING();

        connectionstring = obj.BAL_EpathshalaString();



        try
        {
            if (control == 1)
            {
                ReportControl1.ConnectionString = connectionstring;


                //reporttype = Server.MapPath("Files/MonthlySummary.xml");
                ReportControl1.XMLReportFile = Server.MapPath(reporttype);

                ReportControl1.Search(dt);
            }
            else if (control == 2)
            {
                ReportControl2.ConnectionString = connectionstring;


                //reporttype = Server.MapPath("Files/MonthlySummary.xml");
                ReportControl2.XMLReportFile = Server.MapPath(reporttype);

                ReportControl2.Search(dt);
            }
            else if (control == 3)
            {
                //ReportControl3.ConnectionString = connectionstring;


                ////reporttype = Server.MapPath("../ReportXMLFiles/TeacherTrackRPTEmpWiseBMSSCT.xml");
                //ReportControl3.XMLReportFile = Server.MapPath(reporttype);

                //ReportControl3.Search(dt);

                StringBuilder ReportString = new StringBuilder();
                //Header

                //XML to Dataset
                DataSet xmllanguage = new DataSet();
                xmllanguage.ReadXml(Server.MapPath("../ReportXMLFiles/TeacherTrackRPTEmpWiseBMSSCT.xml"));
                //End XML to Dataset

                //HiddenFields list get
                List <string> HiddenFields;
                HiddenFields = GetHiddenFields();
                //End HiddenFields list get

                DataTable dtTableHeder = dt.DefaultView.ToTable(true, "SessionID");
                for (int i = 0; i < dtTableHeder.Rows.Count; i++)
                {
                    CreadeRowColumMainTable(ReportString);


                    //ReportString.Append(xmllanguage.Tables[Session["LANG"].ToString().ToLower()].Rows[0]["Session"].ToString()+" : "+dtTableHeder.Rows[i]["SessionID"].ToString());
                    ReportString.Append(xmllanguage.Tables[Session["Varnindra"].ToString().ToLower()].Rows[0]["Session"].ToString() + " : " + dtTableHeder.Rows[i]["SessionID"].ToString());
                    CloseTDTR(ReportString);

                    OpenTDTR(ReportString);
                    DataView dv1 = dt.DefaultView;
                    dv1.RowFilter = " SessionID = '" + dtTableHeder.Rows[i]["SessionID"].ToString() + "'";
                    DataTable dtNew = dv1.ToTable();



                    ReportString.Append("<table class=\"GridViewCss\" cellspacing=\"2\" cellpadding=\"2\" border=\"1\" style=\"border-width:1px;border-style:None;width:100%;\" rules=\"all\">");

                    ReportString.Append("<tr class=\"GridViewHeadercss\">");



                    for (int j = 0; j < dtNew.Columns.Count; j++)
                    {
                        if (HiddenFields != null)
                        {
                            foreach (string s in HiddenFields)
                            {
                                if (dtNew.Columns[j].ToString().ToLower() != s.ToLower())
                                {
                                    string Columen = dtNew.Columns[j].ToString().Trim().Replace(" ", "");
                                    string str     = xmllanguage.Tables[Session["Varnindra"].ToString().ToLower()].Rows[0][Columen].ToString();
                                    ReportString.Append("<th scope=\"col\">" + str + "</th>");

                                    break;
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                    }
                    ReportString.Append("</tr>");
                    for (int ij = 0; ij < dtNew.Rows.Count; ij++)
                    {
                        ReportString.Append("<tr class=\"GridViewItem\">");
                        for (int ro = 0; ro < dtNew.Columns.Count; ro++)
                        {
                            if (HiddenFields != null)
                            {
                                foreach (string s in HiddenFields)
                                {
                                    if (dtNew.Columns[ro].ToString().ToLower() != s.ToLower())
                                    {
                                        ReportString.Append("<td>" + dtNew.Rows[ij][ro].ToString() + "</td>"); break;
                                    }
                                    else
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                        ReportString.Append("</tr>");
                    }
                    ReportString.Append("</table>");

                    CloseRowColumnMainTable(ReportString);
                }

                div1.InnerHtml = ReportString.ToString();
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show("" + ex.Message.ToString());
        }
    }
    protected void btnGo_Click(object sender, EventArgs e)
    {
        try
        {
            StoreCookie();
            int status = CheckLogin();
            //if (ddlUserType.SelectedValue == "0")
            if (status == 2)
            {
                WebMsg.Show("invalid username or password");
                return;
            }
            else if (status == 0)
            {
                // 0 Indicates Student

                StudentDash    = new StudentDash();
                BLogic_Student = new Student_DashBoard_BLogic();

                DataSet   dtLogin   = new DataSet();
                DataTable LoginInfo = new DataTable();
                DataTable UserInfo  = new DataTable();

                obj_SYS_Role          = new SYS_Role();
                obj_BAL_SYS_Role      = new SYS_Role_BLogic();
                obj_SYS_Role.Username = txtUserName.Text;
                obj_SYS_Role.Password = txtUserPassword.Text;
                //obj_SYS_Role.roleid = Convert.ToInt16(DdlRole.SelectedValue);

                dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Student_Login(obj_SYS_Role);
                LoginInfo = dtLogin.Tables[0];
                if (LoginInfo.Rows.Count > 0 && LoginInfo != null)
                {
                    AppSessions.AppUserType = "Student";

                    AppSessions.StudentID = Convert.ToInt32(LoginInfo.Rows[0]["StudentID"].ToString());
                    AppSessions.UserName  = LoginInfo.Rows[0]["FirstName"].ToString();

                    AppSessions.BMSID = Convert.ToInt32(LoginInfo.Rows[0]["BMSID"].ToString());
                    AppSessions.BMS   = LoginInfo.Rows[0]["BMS"].ToString();

                    AppSessions.BoardID = Convert.ToInt32(LoginInfo.Rows[0]["BoardID"].ToString());
                    AppSessions.Board   = LoginInfo.Rows[0]["Board"].ToString();

                    AppSessions.MediumID = Convert.ToInt32(LoginInfo.Rows[0]["MediumID"].ToString());
                    AppSessions.Medium   = LoginInfo.Rows[0]["Medium"].ToString();

                    AppSessions.StandardID = Convert.ToInt32(LoginInfo.Rows[0]["StandardID"].ToString());
                    AppSessions.Standard   = LoginInfo.Rows[0]["Standard"].ToString();

                    AppSessions.DivisionID = Convert.ToInt32(LoginInfo.Rows[0]["DivisionID"].ToString());
                    //AppSessions.Division = LoginInfo.Rows[0]["Division"].ToString();

                    AppSessions.SchoolID = Convert.ToInt32(LoginInfo.Rows[0]["SchoolID"].ToString());
                    //AppSessions.SchoolName = LoginInfo.Rows[0]["SchoolName"].ToString();

                    AppSessions.Role   = LoginInfo.Rows[0]["Role"].ToString();
                    AppSessions.RoleID = Convert.ToInt32(LoginInfo.Rows[0]["RoleID"].ToString());

                    yourLoginMethodStudent(LoginInfo);

                    bool    AllowPayment  = false;
                    DataSet dsPaymentInfo = new DataSet();
                    dsPaymentInfo = BLogic_Student.BAL_Select_PaymentPagesInfo("Payment");
                    if (dsPaymentInfo != null & dsPaymentInfo.Tables.Count > 0)
                    {
                        if (dsPaymentInfo.Tables[0].Rows.Count > 0)
                        {
                            string a = dsPaymentInfo.Tables[0].Rows[0]["value"].ToString();
                            if (a == "0")
                            {
                                AllowPayment = false;
                            }
                            else
                            {
                                AllowPayment = true;
                            }
                        }
                    }


                    DataSet ds = new DataSet();
                    StudentDash.StudentID = AppSessions.StudentID;
                    // ds = BLogic_Student.BAL_Validate_Student(StudentDash);
                    ds = BLogic_Student.BAL_Validate_Student_Package(StudentDash);


                    if (AllowPayment == true)
                    {
                        if (ds != null && dtLogin.Tables.Count > 0)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                Session["CheckValidity"] = "Yes";
                                ProceedToRedirect();
                            }
                            else
                            {
                                Response.Redirect("~/DashBoard/SelectPackage.aspx");
                            }
                        }
                        else
                        {
                            Response.Redirect("~/DashBoard/SelectPackage.aspx");
                        }
                    }
                    else
                    {
                        Session["CheckValidity"]    = "Yes";
                        Session["ShowPaymentPages"] = "No";
                        ProceedToRedirect();
                    }
                }
            }
            else if (status == 1)
            {
                // 1 Indicates Teacher
                DataSet   dtLogin   = new DataSet();
                DataTable LoginInfo = new DataTable();
                DataTable UserInfo  = new DataTable();

                obj_SYS_Role          = new SYS_Role();
                obj_BAL_SYS_Role      = new SYS_Role_BLogic();
                obj_SYS_Role.Username = txtUserName.Text;
                obj_SYS_Role.Password = txtUserPassword.Text;
                //obj_SYS_Role.roleid = Convert.ToInt16(DdlRole.SelectedValue);

                dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Active_Login(obj_SYS_Role);
                LoginInfo = dtLogin.Tables[0];

                if (LoginInfo.Rows.Count > 0 && LoginInfo != null && LoginInfo.Rows[0]["Status"].ToString().Equals("1"))
                {
                    if (dtLogin.Tables[1].Rows[0]["RoleID"].ToString() != "3")
                    {
                        bool AllowMultipleSession = false;
                        UserInfo = dtLogin.Tables[1];
                        if (UserInfo.Rows.Count > 0 && UserInfo != null)
                        {
                            AppSessions.AppUserType = "School";
                            AppSessions.EmpolyeeID  = int.Parse(UserInfo.Rows[0]["EmployeeID"].ToString());
                            AppSessions.RoleID      = int.Parse(UserInfo.Rows[0]["RoleID"].ToString());
                            AppSessions.SchoolID    = int.Parse(UserInfo.Rows[0]["SchoolID"].ToString());
                            AppSessions.UserName    = UserInfo.Rows[0]["FirstName"].ToString();
                            AppSessions.SchoolName  = UserInfo.Rows[0]["Name"].ToString();
                            AppSessions.Role        = UserInfo.Rows[0]["Role"].ToString();

                            AllowMultipleSession = Convert.ToBoolean(UserInfo.Rows[0]["AllowMultipleSession"].ToString());
                            TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "LoginPage", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginSuccess), "LoginId: " + txtUserName.Text, 0);
                        }

                        if (AllowMultipleSession == false)
                        {
                            Hashtable sessions = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                            if (sessions == null)
                            {
                                sessions = new Hashtable();
                            }

                            ////////getting the pointer to the Session of the current logged in user
                            HttpSessionState existingUserSession = (HttpSessionState)sessions[Session["EmpolyeeID"].ToString()];
                            if (existingUserSession != null)
                            {
                                ////existingUserSession[Session["EmpolyeeID"].ToString()] = null;
                                //logout current logged in user
                                lblError1.Visible = true;
                            }
                            else
                            {
                                yourLoginMethod(UserInfo);
                                ProceedToRedirectPage(UserInfo);
                            }
                        }
                        else
                        {
                            yourLoginMethod(UserInfo);

                            ProceedToRedirectPage(UserInfo);
                        }
                    }
                    else
                    {
                        // For Teacher Redirection

                        bool AllowMultipleSession = false;
                        UserInfo = dtLogin.Tables[1];
                        if (UserInfo.Rows.Count > 0 && UserInfo != null)
                        {
                            Session["UserInfoTable"] = UserInfo;

                            ViewState["AppUserType"] = "School";
                            ViewState["EmpolyeeID"]  = int.Parse(UserInfo.Rows[0]["EmployeeID"].ToString());
                            ViewState["RoleID"]      = int.Parse(UserInfo.Rows[0]["RoleID"].ToString());
                            ViewState["SchoolID"]    = int.Parse(UserInfo.Rows[0]["SchoolID"].ToString());
                            ViewState["UserName"]    = UserInfo.Rows[0]["FirstName"].ToString();
                            ViewState["SchoolName"]  = UserInfo.Rows[0]["Name"].ToString();
                            ViewState["Role"]        = UserInfo.Rows[0]["Role"].ToString();

                            AllowMultipleSession = Convert.ToBoolean(UserInfo.Rows[0]["AllowMultipleSession"].ToString());
                            TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "LoginPage", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginSuccess), "LoginId: " + txtUserName.Text, 0);
                        }

                        if (AllowMultipleSession == false)
                        {
                            Hashtable sessions = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                            if (sessions == null)
                            {
                                sessions = new Hashtable();
                            }
                            ////////getting the pointer to the Session of the current logged in user
                            // HttpSessionState existingUserSession = (HttpSessionState)sessions[Session["EmpolyeeID"].ToString()];
                            HttpSessionState existingUserSession = (HttpSessionState)sessions[ViewState["EmpolyeeID"].ToString()];
                            if (existingUserSession != null)
                            {
                                ////existingUserSession[Session["EmpolyeeID"].ToString()] = null;
                                //logout current logged in user
                                lblError1.Visible = true;
                            }
                            else
                            {
                                yourLoginMethod(UserInfo);
                                ProceedToRedirectPage(UserInfo);
                            }
                        }
                        else
                        {
                            yourLoginMethod(UserInfo);

                            ProceedToRedirectPage(UserInfo);
                        }
                    }
                }
                else
                {
                    TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "LoginPage", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginFailed), "LoginId: " + txtUserName.Text + " , Password: "******"Authentication Failed,unable to login");
                }
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
    }
 protected void btnsearcksubmit_Click(object sender, EventArgs e)
 {
     //Response.Redirect("SearchResult.aspx?key=" + txtkeyword.Text + "");
     WebMsg.Show("You have to register first to use this facility ");
 }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Session["DEMOBMSID"] != null)
        {
            Teacher_Dashboard_BLogic obj_BAL_Teacher_Dashboard;
            Teacher_Dashboard        obj_Teacher_Dashboard;

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

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

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

            DataSet dsDemoData = new DataSet();

            dsDemoData = obj_BAL_Teacher_Dashboard.BAL_Select_BMS_SCTID_Demo(obj_Teacher_Dashboard);

            int    bmssctid       = Convert.ToInt32(dsDemoData.Tables[0].Rows[0]["BMSSCTID"].ToString());
            string IsAllowForDemo = dsDemoData.Tables[0].Rows[0]["IsAllowForDemo"].ToString();


            if (bmssctid > (int)EnumFile.AssignValue.Zero)
            {
                if (IsAllowForDemo.ToString().Trim().ToLower() == "true")
                {
                    Session["DEMOChapterTopic"] = ddlChapter.SelectedItem.ToString() + " >> " + ddlTopic.SelectedItem.ToString();
                    Session["DEMOBMSSCTID"]     = bmssctid;
                    Session["DemoChapter"]      = ddlChapter.SelectedItem.ToString();
                    Session["DemoTopic"]        = ddlTopic.SelectedItem.ToString();
                    Session["DemoChapterID"]    = ddlChapter.SelectedValue.ToString();
                    Session["DemoTopicID"]      = ddlTopic.SelectedValue.ToString();

                    String Path1 = Server.MapPath("../EduResource/" + bmssctid);
                    if (Directory.Exists(Path1))
                    {
                        //Response.Redirect("../DemoPages/viewDemoContent.aspx?type=topic&BMSSCTID="+ bmssctid.ToString().Trim() +"");

                        Response.Redirect("../DemoPages/EducationResourceDemo.aspx");
                    }
                    else
                    {
                        WebMsg.Show("No Educational resource available.");
                    }
                }
                else
                {
                    //WebMsg.Show("You have to register first for this content");
                    showme.Attributes["style"] = "visibility:visible;";
                    ModalPopupExtender1.Show();
                }
            }
            else
            {
                showme.Attributes["style"] = "visibility:visible;";
                ModalPopupExtender1.Show();


                //WebMsg.Show("You have to register first for this content");
            }
        }
        else
        {
            Response.Redirect("../DemoPages/Home.aspx");
        }
    }
Exemple #14
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        int    count         = (int)EnumFile.AssignValue.Zero;
        string divisionidstr = string.Empty;

        foreach (ListItem chk in clstDivision.Items)
        {
            if (chk.Selected == true)
            {
                if (count == ((int)EnumFile.AssignValue.Zero))
                {
                    divisionidstr = chk.Value;
                }
                else
                {
                    divisionidstr = divisionidstr + " , " + chk.Value;
                }

                count = count + 1;
            }
        }

        if (count == ((int)EnumFile.AssignValue.Zero))
        {
            WebMsg.Show("Please select atleast one Division");
        }
        else
        {
            try
            {
                DataSet dsselectErrors = new DataSet();
                this.PAnnouncement.bmsid = Convert.ToInt32(ddlBoardMediumStandard.SelectedValue.ToString());
                if (divisionidstr == string.Empty)
                {
                    divisionidstr = ((int)EnumFile.AssignValue.Zero).ToString();
                }

                this.PAnnouncement.divisionstr = divisionidstr;
                string   IFormat   = "dd-MMM-yyyy";
                DateTime StartDate = Convert.ToDateTime(DateTime.Parse(txtStartDate.Text).ToString(IFormat));
                DateTime EndDate   = Convert.ToDateTime(DateTime.Parse(txtEndDate.Text).ToString(IFormat));

                if (StartDate > EndDate)
                {
                    WebMsg.Show("End Date Larger than StartDate");
                }
                else
                {
                    this.PAnnouncement.divisionid = Convert.ToInt32(clstDivision.SelectedValue);
                    this.PAnnouncement.startdate  = StartDate;
                    this.PAnnouncement.enddate    = EndDate;
                    //this.PAnnouncement.announcement = edtAnnouncement.Content.ToString();
                    ////  PAnnouncement.announcement = edtAnnouncement.Content.Substring(0, edtAnnouncement.Content.Length - 6);
                    this.PAnnouncement.announcement   = txtSearchAnnouncement.Text;
                    this.PAnnouncement.createdby      = Convert.ToInt32(this.Session["EmpolyeeID"]);
                    this.PAnnouncement.modifiedby     = Convert.ToInt32(this.Session["EmpolyeeID"]);
                    this.PAnnouncement.announcementid = Convert.ToInt32(this.ViewState["AnnouncementID"].ToString());
                    dsselectErrors = this.BAL_Announcement.BAL_Announcement_Update(this.PAnnouncement, "Update");

                    if (dsselectErrors.Tables.Count > ((int)EnumFile.AssignValue.Zero))
                    {
                        if (dsselectErrors.Tables[0].Rows.Count > ((int)EnumFile.AssignValue.Zero))
                        {
                            if (Convert.ToInt32(dsselectErrors.Tables[0].Rows[0][0].ToString()) == ((int)EnumFile.AssignValue.Zero))
                            {
                                WebMsg.Show("Following Combination already exist.");
                            }
                        }
                        else
                        {
                            this.RefreshControls();
                            WebMsg.Show("Record Updated.");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                WebMsg.Show(ex.Message);
            }
        }
    }
Exemple #15
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        int    count         = Convert.ToInt32(EnumFile.AssignValue.Zero);
        string divisionidstr = string.Empty;

        foreach (ListItem chk in clstDivision.Items)
        {
            if (chk.Selected == true)
            {
                if (count == Convert.ToInt32(EnumFile.AssignValue.Zero))
                {
                    divisionidstr = chk.Value;
                }
                else
                {
                    divisionidstr = divisionidstr + " , " + chk.Value;
                }

                count = count + 1;
            }
        }
        ////divisionidstr = "' " + divisionidstr + " '";
        if (count == Convert.ToInt32(EnumFile.AssignValue.Zero))
        {
            WebMsg.Show("Please select atleast one Division");
        }
        else
        {
            try
            {
                DataSet dsselectErrors = new DataSet();
                this.PAnnouncement.bmsid = Convert.ToInt32(ddlBoardMediumStandard.SelectedValue.ToString());
                if (divisionidstr == string.Empty)
                {
                    divisionidstr = ((int)EnumFile.AssignValue.Zero).ToString();
                }

                this.PAnnouncement.divisionstr = divisionidstr;
                string IFormat = "dd-MMM-yyyy";

                DateTime StartDate = Convert.ToDateTime(DateTime.Parse(txtStartDate.Text).ToString(IFormat));
                DateTime EndDate   = Convert.ToDateTime(DateTime.Parse(txtEndDate.Text).ToString(IFormat));

                if (StartDate > EndDate)
                {
                    WebMsg.Show("End Date Larger than StartDate");
                }
                else
                {
                    this.PAnnouncement.divisionid = Convert.ToInt32(clstDivision.SelectedValue);
                    this.PAnnouncement.startdate  = StartDate;
                    this.PAnnouncement.enddate    = EndDate;

                    //Label lbl = new Label();
                    //lbl.Text = Server.HtmlDecode(edtAnnouncement.Content.ToString());
                    //this.PAnnouncement.announcement = lbl.Text;

                    //Literal ltrl = new Literal();
                    //ltrl.Text = HttpUtility.HtmlDecode(edtAnnouncement.Content.ToString());

                    //Literal ltr1 = new Literal();
                    //ltr1.Text = HttpUtility.HtmlEncode(edtAnnouncement.Content.ToString());

                    //this.PAnnouncement.announcement = ltrl.Text;
                    ////PAnnouncement.announcement = edtAnnouncement.Content.ToString();
                    ////PAnnouncement.announcement = edtAnnouncement.Content.Substring(0, edtAnnouncement.Content.Length - 6);
                    this.PAnnouncement.announcement = txtSearchAnnouncement.Text;
                    this.PAnnouncement.createdby    = Convert.ToInt32(this.Session["EmpolyeeID"]);
                    this.PAnnouncement.modifiedby   = Convert.ToInt32(this.Session["EmpolyeeID"]);

                    dsselectErrors = this.BAL_Announcement.BAL_Announcement_Insert(this.PAnnouncement, "Insert");

                    if (dsselectErrors.Tables.Count > ((int)EnumFile.AssignValue.Zero))
                    {
                        if (dsselectErrors.Tables[0].Rows.Count > ((int)EnumFile.AssignValue.Zero))
                        {
                            if (Convert.ToInt32(dsselectErrors.Tables[0].Rows[0][0].ToString()) != ((int)EnumFile.AssignValue.Zero))
                            {
                                WebMsg.Show("Record already exist.");
                            }
                        }
                        else
                        {
                            ////BindGridAnnouncement();
                            this.RefreshControls();
                            WebMsg.Show("Record inserted.");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                WebMsg.Show(ex.Message);
            }
        }
    }
Exemple #16
0
    protected string DefaultEmailBody(string ISFreeTrial = null)
    {
        StringBuilder oBuilder = new StringBuilder();

        try
        {
            oBuilder.Append("<!DOCTYPE html><html><head>");
            oBuilder.Append("<style type=text/css> th {color: #685858;} table tr:nth-child(odd) { background-color: #DBDBDB; border-bottom: 1px SOLID GRAY; }  p { text-align:justify; line-height:1.4em; }  </style> ");
            oBuilder.Append("</head><body>");

            //oBuilder.Append("<div style='font-family: Calibri,Cambria,verdana; color: #4C3636;'>");
            oBuilder.Append("<div style='font-family:Trebuchet MS,Georgia,Verdana,Tahoma;color:#4C3636;'>");
            oBuilder.Append("<table width=72% style='margin: 10px; border: 5px SOLID SILVER; border-radius: 5px;' border=0>");
            oBuilder.Append("<tr><td><div style='background-color: #2f378e; height: 30px; font-size: 21px; font-weight: bold;padding: 10px;'><span style='color: white; display: block;'>EPATHSHALA</span></div></td></tr>");
            oBuilder.Append("<tr><td style='font-size: 16px;'>");
            oBuilder.Append("<div id=dvcontent style='font-size: 14px; padding: 20px; background-color: #F4F4F4;'>");
            oBuilder.Append("Dear " + txtFirstName.Text + ",  <p> Thank you for registering with ePathshala. We welcome you to the world of experiential learning to make your learning process efficient and effective.</p> ");

            //oBuilder.Append("Dear " + txtFirstName.Text + "<br /><br />Thank you for registering with E-Pathshala. We welcome you to the world of experiential learning so as to make learning interesting for you.<br /><br />We have different packages for " + ddlBMS.SelectedItem.Text + " as below:<br /><br /><center> ");
            //oBuilder.Append("<table border=0 cellpadding=5 cellspacing=0 width=80% style='border: 1px SOLID #9B9B9B;'>");
            //oBuilder.Append("<tr style='background-color: #CECECE;'><th>BMS</th><th>Subject</th><th>Price</th></tr>");
            //// Dynamice for available packages
            //oBuilder.Append("<tr><td>Gujarat Board>> Gujarati Medium >> Standar-08</td><td>English</td><td style='text-align: right;'>200</td></tr>");
            //oBuilder.Append("<tr><td style='width: 60%;'>Gujarat Board>> Gujarati Medium >> Standar-08</td><td style='width: 30%;'>English</td><td style='width: 10%; text-align: right;'>200</td></tr>");
            //oBuilder.Append("</table></center><br />");

            if (ISFreeTrial != null && ISFreeTrial.ToString().ToLower() == "yes")
            {
                DataTable dtTrialPackage = (DataTable)Session["dsTrailPAckage"];
                string    strBMS         = ddlBMS.SelectedItem.Text.Replace(">>", ">");
                string[]  BMS            = strBMS.Split('>');
                string    Board          = ddlBoard.SelectedItem.ToString();
                string    Medium         = ddlMedium.SelectedItem.ToString();;
                string    Standard       = ddlStandard.SelectedItem.ToString();

                //oBuilder.Append(" <p> We are pleased to provide you access to ePathshala package for " + dtTrialPackage.Rows[0]["NoOfMonth"].ToString() + " days for " + Board + " Board " + Medium + " Medium " + Standard + ". ");
                oBuilder.Append(" <p> We are pleased to provide you access to ePathshala package for " + dtTrialPackage.Rows[0]["NoOfMonth"].ToString() + " day(s) as an introductory promotional offer for selected standard.");
                oBuilder.Append("<br />Discover how E-Pathshala helps you like a teacher/friend. </p>");
                oBuilder.Append("<div><center>");
                oBuilder.Append("<table border=0 cellpadding=5 cellspacing=0 style='border-collapse: collapse; border: 1px SOLID #9B9B9B; width=80%'>");
                oBuilder.Append("<tr style='background-color: #CECECE;'><th>Package Name</th><th>Subject</th><th>Start From</th><th>Valid Till</th> </tr>");

                for (int i = 0; i < dtTrialPackage.Rows.Count; i++)
                {
                    oBuilder.Append("<tr><td>" + dtTrialPackage.Rows[i]["PackageName"].ToString() + "</td><td>" + dtTrialPackage.Rows[i]["Subject"].ToString() + "</td><td style='text-align: center;'>" + DateTime.Now.ToString("dd MMM, yyyy") + "</td><td style='text-align: center;'>" + DateTime.Now.AddDays(Convert.ToInt32(dtTrialPackage.Rows[0]["NoOfMonth"].ToString())).ToString("dd MMM, yyyy") + "</td></tr>");
                }
                oBuilder.Append("</table> </center></div><br />");
            }

            //oBuilder.Append("<div><p> We wish you happy learning and also wish to strengthen your knowledge, increase your confidence and achieve better performance.<br />We look forward to a wonderful learning experience with us and relationship with us.  </p> <b>Your Login details are as below:  </b></div><br/>");
            oBuilder.Append("<div><p>We look forward to a wonderful learning experience and relationship with us.  </p> <b>Your Login details are as below:  </b></div><br/>");

            oBuilder.Append("<div><table border=0 cellpadding=5 cellspacing=3 style='border-collapse: collapse;border: 1px SOLID #9B9B9B; margin-left: 90px; width=40%'>");
            oBuilder.Append("<tr><td>Visit:</td><td>http://epathshala.co.in/</td></tr>");
            oBuilder.Append("<tr><td class=style2>Login ID:</td><td class=style1><b>" + txtEmail.Text + "</b></td></tr>");
            oBuilder.Append("<tr><td class=style2>Password:</td><td class=style1><b>" + ViewState["strpassword"].ToString() + "</b></td></tr>");
            oBuilder.Append("<tr><td class=style2 colspan=2>Please do reach us on [email protected] for your queries or suggestion.</td></tr>");
            oBuilder.Append("</table></div><br />");
            oBuilder.Append("<div>Thank You,<br />ePathshala - Support Team.</div></div>");
            oBuilder.Append("</td></tr>");
            oBuilder.Append("<tr><td><div style='background-color: #E4722B; height: 24px; font-size: 18px; font-weight: bold;padding: 5px;'>");
            oBuilder.Append("<div><table border=0 cellpadding=0 cellspacing=0 style='background:none;color:Black;'>");
            oBuilder.Append("<tr  style='background:none;color:Black;'><td><span style='color: white; display: block;'>FOLLOW US!</span></td>");
            oBuilder.Append("<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>");
            oBuilder.Append("<td>&nbsp;<a href=https://www.facebook.com/myepathshala><img src=https://cdn3.iconfinder.com/data/icons/peelicons-vol-1/50/Facebook-48.png height=36 /></a></td>");
            oBuilder.Append("<td>&nbsp;<a href=https://twitter.com/EpathshalaEpath><img src=https://cdn3.iconfinder.com/data/icons/peelicons-vol-1/50/Twitter-48.png height=36 /></a></td>");

            oBuilder.Append("</tr></table></div></div></td></tr>");

            //oBuilder.Append("<span style='color: white; display: block;'>FOLLOW US!</span> <a href=https://www.facebook.com/myepathshala> <img alt=Epathshala width=26px height=23px src=App_Themes/Images/FBIcon.png /> <a>  <a href=https://twitter.com/EpathshalaEpath> <img alt=Epathshala width=26px height=23px src=App_Themes/Images/twitter.png /> <a> </div> </td> </tr>");
            oBuilder.Append("<tr> <td style='padding: 20px;'> Please do not reply this message. Queries? Contact. Customer Support. <br /> Arraycom India Ltd. 13, GIDC, Gandhinagar, 382025. </td></tr>");
            oBuilder.Append(" </table></div>");



            //oBuilder.Append("<p>Thank you for registration in Epathshala <br /><br />");
            //oBuilder.Append("Best Regards,<br />Admin.</p>");
            //oBuilder.Append("</div></div>");
            //oBuilder.Append("</body></html>");
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        return(oBuilder.ToString());
    }
Exemple #17
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int t1 = 0;

        //if (TxtBxCap.Text.Trim() != "")
        //{
        //Captcha1.ValidateCaptcha(TxtBxCap.Text.Trim());
        try
        {
            if (verifyLoginID())
            {
                //if (!CheckPasswordComplexcity())
                //{
                //    WebMsg.Show("Invalid password format, please enter minimum 6 alphanumeric character with @ # $ %. Sign.");
                //    return;
                //}

                /*if (txtPassword.Text.Length < 6)
                 * {
                 *  WebMsg.Show("Minimum 6 character required in password");
                 *  return;
                 * }*/
                Student            = new Student();
                BAL_Student        = new Student_BLogic();
                Student.schoolid   = GetDefaultSchoolID();
                Student.divisionid = 1;
                Student.bmsid      = (int)ViewState["BMSID"];
                //ViewState["BMSID"] = int.Parse(ddlBMS.SelectedValue);
                Student.loginid = txtEmail.Text;
                //Student.password = txtPassword.Text;
                Student.password   = ViewState["strpassword"].ToString();
                Student.firstname  = txtFirstName.Text;
                Student.lastname   = txtLastName.Text;
                Student.schoolname = txtSchoolname.Text;
                //Student.contactno = Convert.ToInt64(txtContactNo.Text);
                Student.mobilenostring = txtContactNo.Text;
                Student.emailid        = txtEmail.Text;

                //DateTime fromdatetime;

                //string d = txtBirthdate.Text;
                //d = d.Replace("-", "/");
                //DateTime dt;
                //try
                //{
                //    dt = DateTime.ParseExact(d, "d/M/yyyy", CultureInfo.InvariantCulture);
                //}
                //catch (Exception)
                //{
                //    dt = DateTime.ParseExact(d, "M/d/yyyy", CultureInfo.InvariantCulture); ;
                //}

                //= DateTime.ParseExact(d, "d/M/yyyy", CultureInfo.InvariantCulture);
                // for both "1/1/2000" or "25/1/2000" formats
                //string newString = dt.ToString("dd/MMM/yyyy");
                //Student.dateofbirth = dt;
                //if (DateTime.TryParse(txtBirthdate.Text, out fromdatetime))
                //{
                //    Student.dateofbirth = fromdatetime;
                //}

                //if (RlstGender.SelectedValue == "1")
                //{
                //    Student.gender = 'M';
                //}
                //else if (RlstGender.SelectedValue == "2")
                //{
                //    Student.gender = 'F';
                //}
                Student.PaymentType = 'I';
                //if (Captcha1.UserValidated)
                //{
                t1 = BAL_Student.BAL_Student_Insert_Online(Student, "OnlineReg");
                InsertIntoStudentPackageDetails(t1);
                //}
                //else
                //{
                //    WebMsg.Show("Please enter the correct Captcha code");

                //}
                if (t1 > 0)
                {
                    //ScriptManager.RegisterStartupScript(this.Page, GetType(), "Message", "You are successfully registered", false);
                    //string MailContent = DefaultEmailBody();
                    //string strResponce = SendMail(txtEmail.Text, "New Registration Details:", MailContent);

                    //WebMsg.Show("Your registration was successfull. We have sent your Login details on your registered Email Address.");
                    // ShowMessage("Your registration was successfull. We have sent your Login details on your registered Email Address.");
                    RedirectToDashboard();
                    //AppSessions.StudentID = t1;
                    //AppSessions.BMSID = (int)ViewState["BMSID"];
                    //Response.Redirect("~/Dashboard/StudentDashboard.aspx", false);



                    //WebMsg.Show(strResponce);
                    //ClearRegisterControls();
                    //Response.Redirect("Login.aspx");
                }
                ClearRegisterControls();
            }
            else
            {
                WebMsg.Show("LoginID already exist..");
            }
        }
        catch (FormatException fe)
        {
            //WebMsg.Show("Invalid birthdate");
            //txtBirthdate.Focus();
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        finally
        { }

        //}
        //else
        //{
        //    WebMsg.Show("Please enter code");

        //}
    }
    public static List <object> GetPerformanceChartdata(int subjectid)
    {
        StringBuilder sb             = new StringBuilder();
        List <object> iData          = new List <object>();
        List <string> labels         = new List <string>();
        List <string> lst_dataItem_1 = new List <string>();

        try
        {
            //int subjectid = Convert.ToInt16(AppSessions.SubjectID);
            //int subjectid = 1;
            int studentid = Convert.ToInt32(AppSessions.StudentID);
            int bmsid     = Convert.ToInt32(AppSessions.BMSID);


            DataTable dtexam = new DataTable();
            dtexam.Columns.Add("Chapter", typeof(string));
            dtexam.Columns.Add("ObtainedPercentage", typeof(string));


            DataSet          dsResult   = new DataSet();
            ReportsForResult Report_Bal = new ReportsForResult();


            string data;

            // dsResult = Report_Bal.BAL_SYS_ResultRPTByStudentSubDetails(studentid, subjectid,bmsid);
            dsResult = Report_Bal.BAL_SYS_Student_Performance_Chart(studentid, subjectid, bmsid);

            //sb.Append("[");

            if (dsResult.Tables[0].Rows.Count > 0 && dsResult != null)
            {
                for (int i = 0; i < dsResult.Tables[0].Rows.Count; i++)
                {
                    //int count = dsResult.Tables[0].Rows.Count;
                    //DataRow dr = dtexam.NewRow();

                    //dr["Chapter"] = dsResult.Tables[0].Rows[0]["Chapter"].ToString();
                    //dr["ObtainedPercentage"] = dsResult.Tables[0].Rows[0]["ObtainedPercentage"].ToString(); ;
                    //dtexam.Rows.Add(dr);
                    //sb.Append("{");
                    //System.Threading.Thread.Sleep(50);
                    //string color = String.Format("#{0:X6}", new Random().Next(0x1000000));
                    //sb.Append(string.Format("text :'{0}', value:{1}, color: '{2}'", dsResult.Tables[0].Rows[0]["Chapter"].ToString(), dsResult.Tables[0].Rows[0]["ObtainedPercentage"].ToString(), color));
                    //sb.Append("},");
                    labels.Add(dsResult.Tables[0].Rows[i]["Chapter"].ToString());
                    // lst_dataItem_1.Add(Convert.ToInt32(dsResult.Tables[0].Rows[i]["ObtainedPercentage"]));
                    if (dsResult.Tables[0].Rows[i]["ObtainedPercentage"].ToString().Length > 0)
                    {
                        lst_dataItem_1.Add(dsResult.Tables[0].Rows[i]["ObtainedPercentage"].ToString());
                    }
                    else
                    {
                        lst_dataItem_1.Add(null);
                    }
                }
                iData.Add(labels);
                iData.Add(lst_dataItem_1);
            }

            else
            {
                DataRow dr = dtexam.NewRow();
                dr["chapter"]            = "";
                dr["ObtainedPercentage"] = "";
                dtexam.Rows.Add(dr);
            }
            //sb = sb.Remove(sb.Length - 1, 1);
            //sb.Append("]");
        }
        catch (Exception ex)
        {
            WebMsg.Show("" + ex.Message.ToString());
        }
        //return sb.ToString();
        return(iData);
    }
    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 gvAnalysis_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Literal ltQuestion  = (Literal)e.Row.FindControl("ltQuestion");
                Literal lblSolution = (Literal)e.Row.FindControl("lblSolution");
                Literal Option1     = (Literal)e.Row.FindControl("Option1");
                Literal Option2     = (Literal)e.Row.FindControl("Option2");
                Literal Option3     = (Literal)e.Row.FindControl("Option3");
                Literal Option4     = (Literal)e.Row.FindControl("Option4");

                ltQuestion.Text  = HttpUtility.HtmlDecode(DataBinder.Eval(e.Row.DataItem, "Question").ToString());
                lblSolution.Text = HttpUtility.HtmlDecode(DataBinder.Eval(e.Row.DataItem, "Solution").ToString());

                Option1.Text = "<div style=\"";
                if (DataBinder.Eval(e.Row.DataItem, "Option1ID").ToString() == DataBinder.Eval(e.Row.DataItem, "AnswerID").ToString())
                {
                    Option1.Text = Option1.Text + "color:Red;";
                }
                if (DataBinder.Eval(e.Row.DataItem, "Option1ID").ToString() == DataBinder.Eval(e.Row.DataItem, "GivenAnswerID").ToString())
                {
                    Option1.Text = Option1.Text + "background-color:#ABBCAB;";
                }
                Option1.Text = Option1.Text + "min-width:20px\">A. " + HttpUtility.HtmlDecode(DataBinder.Eval(e.Row.DataItem, "Option1").ToString()) + "</div>";

                Option2.Text = "<div style=\"";
                if (DataBinder.Eval(e.Row.DataItem, "Option2ID").ToString() == DataBinder.Eval(e.Row.DataItem, "AnswerID").ToString())
                {
                    Option2.Text = Option2.Text + "color:Red;";
                }
                if (DataBinder.Eval(e.Row.DataItem, "Option2ID").ToString() == DataBinder.Eval(e.Row.DataItem, "GivenAnswerID").ToString())
                {
                    Option2.Text = Option2.Text + "background-color:#ABBCAB;";
                }
                Option2.Text = Option2.Text + "min-width:20px\">B. " + HttpUtility.HtmlDecode(DataBinder.Eval(e.Row.DataItem, "Option2").ToString()) + "</div>";


                Option3.Text = "<div style=\"";
                if (DataBinder.Eval(e.Row.DataItem, "Option3ID").ToString() == DataBinder.Eval(e.Row.DataItem, "AnswerID").ToString())
                {
                    Option3.Text = Option3.Text + "color:Red;";
                }
                if (DataBinder.Eval(e.Row.DataItem, "Option3ID").ToString() == DataBinder.Eval(e.Row.DataItem, "GivenAnswerID").ToString())
                {
                    Option3.Text = Option3.Text + "background-color:#ABBCAB;";
                }
                Option3.Text = Option3.Text + "min-width:20px\">C. " + HttpUtility.HtmlDecode(DataBinder.Eval(e.Row.DataItem, "Option3").ToString()) + "</div>";

                Option4.Text = "<div style=\"";
                if (DataBinder.Eval(e.Row.DataItem, "Option4ID").ToString() == DataBinder.Eval(e.Row.DataItem, "AnswerID").ToString())
                {
                    Option4.Text = Option4.Text + "color:Red;";
                }
                if (DataBinder.Eval(e.Row.DataItem, "Option4ID").ToString() == DataBinder.Eval(e.Row.DataItem, "GivenAnswerID").ToString())
                {
                    Option4.Text = Option4.Text + "background-color:#ABBCAB;";
                }
                Option4.Text = Option4.Text + "min-width:20px\">D. " + HttpUtility.HtmlDecode(DataBinder.Eval(e.Row.DataItem, "Option4").ToString()) + "</div>";
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message.ToString());
        }
        finally
        {
        }
    }
Exemple #21
0
    /// <summary>
    /// Get all the clause and header footer visibility setting from XML file and fill the grid report
    /// </summary>


    public string GetAllSettings()
    {
        try
        {
            string allowfooter = GetXMLElementByTagName("allowfooter").ToLower();
            if (allowfooter.Trim().ToLower() == "true")
            {
                lblFooter.Visible = true;
            }
            else
            {
                lblFooter.Visible = false;
            }

            string allowheader = GetXMLElementByTagName("allowheader").ToLower();
            if (allowheader.Trim().ToLower() == "true")
            {
                lblTitle.Visible = true;
            }
            else
            {
                lblTitle.Visible = false;
            }


            string ispaging = GetXMLElementByTagName("AllowPaging").ToLower();
            if (ispaging.Trim().Length > 2 && ispaging.Trim().ToLower() == "true")
            {
                gridreport.AllowPaging = true;
                gridreport.PageSize    = int.Parse(GetXMLElementByTagName("pagesize"));
            }
            else
            {
                gridreport.AllowPaging = false;
            }

            string strGroupBy = GetXMLElementByTagName("GroupBy");
            if (strGroupBy.Trim().Length > 1)
            {
                strGroupBy = " Group By " + strGroupBy;
            }
            string strOrderBy = GetXMLElementByTagName("OrderBy");
            if (strOrderBy.Trim().Length > 3)
            {
                strOrderBy = " Order By " + strOrderBy;
            }

            string strWhere = GetXMLElementByTagName("Where");
            try
            {
                if (strWhere.Trim().Length > 3)
                {
                    strWhere = " where " + GetXMLElementByTagName("Where");
                }
            }


            catch (Exception ex)
            {
            }

            return(strSQL + strWhere + strGroupBy + strOrderBy);
        }
        catch (Exception ex)
        {
            WebMsg.Show("error in get all settings" + ex.Message.ToString());
            return(null);
        }
    }
    protected void submit_Click(object sender, EventArgs e)
    {
        try
        {
            int subjectcount = 0;
            package = new Package_BLogic();
            Package Newpackage = new Package();

            string subjectid   = " ";
            string subjectname = " ";
            foreach (ListItem chk in clstSubject.Items)
            {
                if (chk.Selected == true)
                {
                    subjectid   += chk.Value.ToString() + ",";
                    subjectname += chk.Text.ToString() + ",";
                    subjectcount = subjectcount + 1;
                }
            }

            subjectid   = subjectid.Remove(subjectid.Length - 1);
            subjectname = subjectname.Remove(subjectname.Length - 1);

            Newpackage.PackageName        = txtPackageName.Text;
            Newpackage.PackageDescription = txtdescription.Text;
            Newpackage.BMSID     = Convert.ToInt32(ddlBoardMediumStandard.SelectedValue);
            Newpackage.SubjectID = subjectid;
            Newpackage.Subject   = subjectname;
            //Newpackage.ID = Convert.ToInt32(Session["New_Package_ID"].ToString());
            Newpackage.NoOfMonth = Convert.ToInt32(txtmonth.Text);
            Newpackage.Price     = Convert.ToDecimal(txtprice.Text);
            if (rbyes.Checked)
            {
                Newpackage.IsActive = true;
            }
            else
            {
                Newpackage.IsActive = false;
            }

            DateTime expirydatetime;

            if (DateTime.TryParse(txtdate.Text, out expirydatetime))
            {
                Newpackage.EndDate = expirydatetime;
            }

            if (subjectcount > 1)
            {
                Newpackage.PackageType = "Combo";
            }
            else
            {
                Newpackage.PackageType = "Single";
            }

            New_Package_ID = package.InsertPackageFeesDetail(Newpackage);
            WebMsg.Show("New Package insterted Sucessfully");
            BindGrid();
            ClearFields();
        }
        catch (Exception ex)
        {
            WebMsg.Show("New Package not insterted Sucessfully");
        }
        finally
        {
        }
    }
Exemple #23
0
    /// <summary>
    /// Get the total of required column value
    /// </summary>
    //double finaltotal = 0;


    public void SetTotal()
    {
        try
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(XMLReportFile);
            string      TotalColumn = string.Empty;
            XmlNodeList list        = doc.GetElementsByTagName("Total");
            int         rowcnt      = 0;
            foreach (XmlElement item in list)
            {
                TotalColumn = item.InnerText;
            }
            if (TotalColumn.Length == 0)
            {
                lblFooter.Text = ""; return;
            }
            double total      = 0;
            string columnname = "";
            foreach (GridViewRow dr in gridreport.Rows)
            {
                //int rowcnt = gridreport.Rows
                for (int j = 0; j < dr.Cells.Count; j++)
                {
                    columnname = ((System.Web.UI.WebControls.DataControlFieldCell)(dr.Cells[j])).ContainingField.HeaderText.ToLower();
                    if (columnname == TotalColumn.ToLower())
                    {
                        total += Double.Parse(dr.Cells[j].Text.ToString());
                        ViewState["granttotal"] = total;
                        //rowcnt = rowcnt+1;
                    }
                }
            }

            //foreach (GridViewRow dr in ((System.Data.DataTable)(gridreport.DataSource)).Rows)
            //{
            for (int i = 0; i < ((System.Data.DataTable)(gridreport.DataSource)).Rows.Count; i++)
            {
                for (int j = 0; j < ((System.Data.DataTable)(gridreport.DataSource)).Rows[0].ItemArray.Length; j++)
                {
                    columnname = ((System.Data.DataTable)(gridreport.DataSource)).Columns[j].ToString().ToLower();
                    if (columnname == TotalColumn.ToLower())
                    {
                        finaltotal += Double.Parse(((System.Data.DataTable)(gridreport.DataSource)).Rows[i].ItemArray[j].ToString());
                        ViewState["granttotal"] = total;
                        rowcnt = rowcnt + 1;
                        break;
                    }
                }
            }
            //int rowcnt = gridreport.Rows

            //}



            double avg    = finaltotal / rowcnt;
            string footer = "Total " + TotalColumn.ToLower() + ": " + total.ToString() + "<br/>" + " Average " + TotalColumn.ToLower() + ": " + avg.ToString() + "<br/>" + "Grand Total " + TotalColumn.ToLower() + ": " + finaltotal.ToString();
            lblFooter.Text = footer;
            //lblFooter.Text = "Total " + TotalColumn.ToLower() + ": " + total.ToString();
            ////finaltotal += ViewState["grandtotal"]
            //lblaverage.Text = "Average " + avg.ToString();
            //lbltotal.Text = " Total " + finaltotal.ToString();
        }
        catch (Exception ex)
        {
            WebMsg.Show("Error in set total" + ex.Message.ToString());
        }
    }
Exemple #24
0
    private void BindNextQuestion(DataTable dt)
    {
        if (dt.Rows.Count > 0)
        {
            ltQuestionCount1.Text = Convert.ToString(Convert.ToInt32(ViewState["CurQuestion"]) + 1);
            ltQuestionCount3.Text = Convert.ToString(dt.Rows.Count.ToString());
            lblQues.Text          = "Question " + (Convert.ToInt32(ViewState["CurQuestion"]) + 1) + ": ";
            ltQuestion.Text       = HttpUtility.HtmlDecode(dt.Rows[Convert.ToInt32(ViewState["CurQuestion"])]["Question"].ToString());
            rdb.Items.Clear();
            ListItem ltm;

            bool isRandomOption = false;

            string RndoKey = "0";
            RndoKey = getConfigValue("JumbleOption");

            if (RndoKey == "0")
            {
                RndoKey = "false";
            }
            else
            {
                RndoKey = "true";
            }
            isRandomOption = Convert.ToBoolean(RndoKey);

            if (isRandomOption)
            {
                Random     randNum   = new Random();
                int        randomRow = 0;
                List <int> numbers   = new List <int>();
                int        num       = 0;

                num = randNum.Next(1, 5);
                while (numbers.Count < 4)
                {
                    if (numbers.Contains(num))
                    {
                        num = randNum.Next(1, 5);
                    }
                    else
                    {
                        randomRow = num;
                        numbers.Add(num);
                        ltm = new ListItem(dt.Rows[Convert.ToInt32(ViewState["CurQuestion"])]["Option" + num].ToString(), dt.Rows[Convert.ToInt32(ViewState["CurQuestion"])]["Option" + num + "ID"].ToString());
                        rdb.Items.Add(ltm);
                    }
                }
            }
            else
            {
                ltm = new ListItem(dt.Rows[Convert.ToInt32(ViewState["CurQuestion"])]["Option1"].ToString(), dt.Rows[Convert.ToInt32(ViewState["CurQuestion"])]["Option1ID"].ToString());
                rdb.Items.Add(ltm);
                ltm = new ListItem(dt.Rows[Convert.ToInt32(ViewState["CurQuestion"])]["Option2"].ToString(), dt.Rows[Convert.ToInt32(ViewState["CurQuestion"])]["Option2ID"].ToString());
                rdb.Items.Add(ltm);
                ltm = new ListItem(dt.Rows[Convert.ToInt32(ViewState["CurQuestion"])]["Option3"].ToString(), dt.Rows[Convert.ToInt32(ViewState["CurQuestion"])]["Option3ID"].ToString());
                rdb.Items.Add(ltm);
                ltm = new ListItem(dt.Rows[Convert.ToInt32(ViewState["CurQuestion"])]["Option4"].ToString(), dt.Rows[Convert.ToInt32(ViewState["CurQuestion"])]["Option4ID"].ToString());
                rdb.Items.Add(ltm);
            }
        }
        else
        {
            Examtbl.Visible = false;
            WebMsg.Show("Question not available");
        }
    }
Exemple #25
0
    public void FillChapters_Topic()
    {
        obj_BAL_Student_Dashboard = new Student_DashBoard_BLogic();
        obj_Student_Dashboard     = new StudentDash();

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

        //
        DataSet dsSettings = new DataSet();

        dsSettings = obj_BAL_Student_Dashboard.BAL_Select_CoveredUncoverChapterTopic_Settings();
        IsAllow_Enable_Settings(dsSettings);

        DataSet dsSelect = new DataSet();

        dsSelect = obj_BAL_Student_Dashboard.BAL_Select_Chapters_Topics(obj_Student_Dashboard);
        if (dsSelect.Tables.Count == ((int)EnumFile.AssignValue.One))
        {
            if (dsSelect.Tables[0].Rows[0]["NoRecord"].ToString().Equals("0"))
            {
                WebMsg.Show("No Chatper availbale.");
                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);

            if (dsSelect.Tables[2].Rows.Count > ((int)EnumFile.AssignValue.Zero))
            {
                if (dsSelect.Tables[2].Rows[0]["ChapterID"].ToString().Equals(""))
                {
                    ddlChapter.SelectedIndex = ((int)EnumFile.AssignValue.Zero);
                }
                else
                {
                    ddlChapter.SelectedValue = dsSelect.Tables[2].Rows[0]["ChapterID"].ToString();
                }
            }
            //DropDownList[] disddl1 = { ddlTopic };
            //DisableDropDwon(disddl1);

            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);

            if (dsSelect.Tables[3].Rows.Count > ((int)EnumFile.AssignValue.Zero))
            {
                if (dsSelect.Tables[3].Rows[0]["TopicID"].ToString().Equals(""))
                {
                    ddlTopic.SelectedIndex = ((int)EnumFile.AssignValue.Zero);
                }
                else
                {
                    ViewState["TopicID"]   = dsSelect.Tables[3].Rows[0]["TopicID"].ToString();
                    ddlTopic.SelectedValue = dsSelect.Tables[3].Rows[0]["TopicID"].ToString();
                }
            }
        }
        else
        {
            DropDownList[] disddl = { ddlChapter, ddlTopic };
            DisableDropDwon(disddl);
        }
    }
Exemple #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["BMSSCTID"].ToString() != "")
            {
                //int Level = 0;
                //int NoOfQuestion = 0;
                //if (Request.QueryString["Level"].ToString() != "")
                //{
                //    Level = Convert.ToInt32(Request.QueryString["Level"].ToString());
                //}
                //if (Level == 0)
                //{
                //    NoOfQuestion = Convert.ToInt32(getConfigValue("MaxQuestionForAll"));
                //}
                //else
                //{
                //    NoOfQuestion = Convert.ToInt32(getConfigValue("MaxQuestionForLevelWise"));
                //}
                DataTable dt = new DataTable();

                QuestionMaster objQuestionMaster = new QuestionMaster();
                DataSet        ds = new DataSet();



                DataTable dtExaAuto = null;
                Hashtable Question  = (Hashtable)Application["Exam_TeacherSheResult"];
                if (Question == null)
                {
                    Question = new Hashtable();
                }
                else
                {
                    dtExaAuto = (DataTable)Question[Session["TrackLogID"].ToString()];
                }

                // ds = objQuestionMaster.SELECTAll_QuestionByBMSSCTID(RndmQuestion, Level, NoOfQuestion, Convert.ToInt32(Request.QueryString["BMSSCTID"].ToString()), Request.QueryString["TestType"]);
                // ds = objQuestionMaster.SELECTAll_QuestionByBMSSCTID(RndmQuestion, Level, NoOfQuestion, Convert.ToInt32(Request.QueryString["BMSSCTID"].ToString()), "MCQ");
                if (dtExaAuto != null)
                {
                    if (dtExaAuto.Rows.Count > 0)
                    {
                        //  dt = ds.Tables[0];
                        //   dt.Columns.Add("GivenAnswerID", typeof(Int64));
                        //   dt.Columns.Add("GivenAnswer", typeof(String));
                        //  dt.Columns.Add("ResultTF", typeof(String));
                        //Create RandomQuestion



                        //' Now, add a random number for the RandNum value for each row

                        //Dim rndNum as New Random()
                        //For i = 0 to myDataTable.Rows.Count - 1
                        //    myDataTable.Rows(i)("RandNum") = rndNum.Next(10000)
                        //Next i

                        string RndoKey = "0";
                        RndoKey = getConfigValue("JumbleQuestion");
                        int RndmQuestion = Convert.ToInt32(RndoKey);

                        DataTable dtExaAutoRandom;
                        if (RndmQuestion == 1)
                        {
                            Random     randNum    = new Random();
                            int        randomRow  = 0;
                            List <int> numbers    = new List <int>();
                            int        num        = 0;
                            int        rowToEnter = 0;
                            num = randNum.Next(1, dtExaAuto.Rows.Count + 1);
                            while (numbers.Count < dtExaAuto.Rows.Count)
                            {
                                if (numbers.Contains(num))
                                {
                                    num = randNum.Next(1, dtExaAuto.Rows.Count + 1);
                                }
                                else
                                {
                                    randomRow = num;
                                    numbers.Add(num);
                                    dtExaAuto.Rows[rowToEnter]["RandNum"] = num;
                                    dtExaAuto.AcceptChanges();
                                    rowToEnter = rowToEnter + 1;
                                }
                            }

                            DataView dv = new DataView(dtExaAuto);
                            dv.Sort         = "RandNum ASC";
                            dtExaAutoRandom = dv.ToTable();
                        }
                        else
                        {
                            DataView dv = new DataView(dtExaAuto);
                            dtExaAutoRandom = dv.ToTable();
                        }
                        ViewState["QuestionAnsDT"] = dtExaAutoRandom;
                        ViewState["CurQuestion"]   = 0;
                        BindNextQuestion(dtExaAutoRandom);
                    }
                    else
                    {
                        BtnButton.Visible = false;
                        WebMsg.Show("No Question found!");
                    }
                }
                else
                {
                    Session["ExamStarted"] = "";
                    Session["TrackLogID"]  = "";
                    Response.Redirect("../Dashboard/StudentDashboard.aspx");
                }
            }
        }
    }
    /// <summary>
    /// Method will be used to create grid condition based on the selected criteria.
    /// </summary>
    /// <returns>Return GridCondition</returns>
    protected string CreateGridCondition()
    {
        string Condition   = string.Empty;
        string AndCondtion = " And";
        string ESchool     = "dbo.Employee.SchoolID";
        string ERole       = "dbo.Employee.RoleID";
        string EStandard   = "dbo.SYS_Standard.StandardID";
        string EDivision   = "dbo.SYS_Division.DivisionID";

        string SSchool        = "Stud.SchoolID";
        string SRole          = "Stud.RoleID";
        string SDivision      = "Stud.DivisionID";
        string SysBmsStandard = "SYS_BMS.StandardID";

        try
        {
            if (DdlRole.SelectedValue == Convert.ToString((int)EnumFile.Role.Teacher) || DdlRole.SelectedValue == Convert.ToString((int)EnumFile.Role.S_Admin))
            {
                // Role ID 3 Indicates Teacher.
                if (LtSchoolID.Text != string.Empty)
                {
                    Condition = string.Format("{0}={1}", ESchool, int.Parse(LtSchoolID.Text));
                }

                if (DdlRole.SelectedValue != Convert.ToString((int)EnumFile.AssignValue.Zero))
                {
                    Condition = Condition + string.Format("{0} {1}={2}", AndCondtion, ERole, DdlRole.SelectedValue);
                }

                if (DdlStandard.SelectedValue != Convert.ToString((int)EnumFile.AssignValue.Zero))
                {
                    Condition = Condition + string.Format("{0} {1}={2}", AndCondtion, EStandard, DdlStandard.SelectedValue);
                }

                if (DdlDivision.SelectedValue != Convert.ToString((int)EnumFile.AssignValue.Zero))
                {
                    Condition = Condition + string.Format("{0} {1}={2}", AndCondtion, EDivision, DdlDivision.SelectedValue);
                }
            }
            else if (DdlRole.SelectedValue == Convert.ToString((int)EnumFile.Role.Student))
            {
                // Role Id 4 indicates student.
                if (LtSchoolID.Text != string.Empty)
                {
                    Condition = string.Format("{0}={1}", SSchool, int.Parse(LtSchoolID.Text));
                }

                if (DdlRole.SelectedValue != Convert.ToString((int)EnumFile.AssignValue.Zero))
                {
                    Condition = Condition + string.Format("{0} {1}={2}", AndCondtion, SRole, DdlRole.SelectedValue);
                }

                if (int.Parse(ViewState["UserRoleID"].ToString()) != Convert.ToInt32(EnumFile.Role.Teacher))
                {
                    if (DdlStandard.SelectedValue != Convert.ToString((int)EnumFile.AssignValue.Zero))
                    {
                        ////string B = "Stud.BMSID in (Select BMSID from SYS_BMS  where SYS_BMS.BoardID=" + BoardID + " and SYS_BMS.MediumID=" + MediumID + " and SYS_BMS.StandardID=" + DdlStandard.SelectedValue + ")";
                        ////Condition = Condition + string.Format("{0} {1}", AndCondtion, B);
                        Condition = Condition + string.Format("{0} {1}={2}", AndCondtion, SysBmsStandard, DdlStandard.SelectedValue);
                    }

                    if (DdlDivision.SelectedValue != Convert.ToString((int)EnumFile.AssignValue.Zero))
                    {
                        Condition = Condition + string.Format("{0} {1}={2}", AndCondtion, SDivision, DdlDivision.SelectedValue);
                    }
                }
                else if (int.Parse(ViewState["UserRoleID"].ToString()) == Convert.ToInt32(EnumFile.Role.Teacher))
                {
                    if (DdlStandard.SelectedValue != Convert.ToString((int)EnumFile.AssignValue.Zero))
                    {
                        string B = "Stud.BMSID in (Select DISTINCT BMSID from EmployeeStandardDetail ESD   where ESD.EmployeeID=" + int.Parse(this.ViewState["EmployeeID"].ToString()) + " and Sbms.BMSID=ESD.BMSID and Std.StandardID=" + DdlStandard.SelectedValue + ")";
                        Condition = Condition + string.Format("{0} {1}", AndCondtion, B);
                    }

                    if (DdlDivision.SelectedValue != Convert.ToString((int)EnumFile.AssignValue.Zero))
                    {
                        string B = "Stud.DivisionID in (Select DISTINCT DivisionID from EmployeeStandardDetail  where EmployeeStandardDetail.EmployeeID=" + int.Parse(this.ViewState["EmployeeID"].ToString()) + "and Div.DivisionID=" + DdlDivision.SelectedValue + ")";
                        Condition = Condition + string.Format("{0} {1}", AndCondtion, B);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }

        return(Condition);
    }
Exemple #28
0
    protected void btnDisplay_Click(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.ToString().Equals("View"))
        {
            myframe.Attributes["style"] = "";
            mp1.Show();
            LblDisplay.Text           = Session["DEMOChapterTopic"].ToString();
            Session["DashboardTopic"] = LblDisplay.Text;
            LinkButton  lb  = (LinkButton)e.CommandSource;
            GridViewRow gvr = (GridViewRow)lb.NamingContainer;
            string      src = string.Empty;
            objeAes = new SimplerAES();
            try
            {
                string   value  = gvrecords.DataKeys[gvr.RowIndex].Values["ResourcePath"].ToString();
                string[] lines  = Regex.Split(value, "/");
                string   Actvty = lines[lines.Length - 2].ToString();
                //  bool IsNotAssessment = true;

                ViewState["FileName"] = lines[lines.Length - 1].ToString();

                //  TrackLog_Utils obj = new TrackLog_Utils();
                //  DataSet dsCheckLog = new DataSet();
                //  bool AllowToAssessment = false;
                //if (!IsNotAssessment)
                //{
                //    if (AppSessions.StudentID == 0)
                //    {
                //        dsCheckLog = obj.SELECTExamTrackLogOtherEmployee(AppSessions.BMSID, AppSessions.SchoolID, AppSessions.DivisionID, AppSessions.EmpolyeeID);
                //        if (dsCheckLog.Tables.Count > 0)
                //        {
                //            if (dsCheckLog.Tables[0].Rows.Count > 0)
                //            {
                //                if (dsCheckLog.Tables[0].Rows[0]["Activity"].ToString() == "Assessment" || dsCheckLog.Tables[0].Rows[0]["Activity"].ToString() == "Pretest")
                //                {
                //                    AllowToAssessment = false;
                //                    mp1.Hide();
                //                    WebMsg.Show("Assessment for the class is alredy running");
                //                }
                //                else
                //                {
                //                    AllowToAssessment = true;
                //                }
                //            }
                //            else
                //            {
                //                AllowToAssessment = true;
                //            }
                //        }
                //    }
                //    else { AllowToAssessment = true; }
                //}

                //if (AllowToAssessment || IsNotAssessment)
                //{

                //TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "EducationResourcepage", "lnkDisplay", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, Actvty, "View the " + lines[lines.Length - 1].ToString() + " File.", Convert.ToInt32(Session["BMSSCTID"]));
                Session["src"] = gvrecords.DataKeys[gvr.RowIndex].Values["ResourcePath"].ToString();
                Session["ext"] = gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString();

                if (gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString().Equals(".pdf"))
                {
                    //Session["ContentPath"] = gvrecords.DataKeys[gvr.RowIndex].Values["ResourcePath"].ToString();
                    //Session["ContentType"] = "application/pdf";
                    //HttpContext.Current.Session["ContentType"] = "application/pdf";

                    src = "../PDFViewer/web/viewer.html?lank=" + gvrecords.DataKeys[gvr.RowIndex].Values["ResourcePath"].ToString();
                    myframe.Attributes["src"] = src;
                    Session["myframesrc"]     = src;
                    //src = "OpenFlv.aspx?FullPath=" + gvrecords.DataKeys[gvr.RowIndex].Values["ResourcePath"].ToString() + "&ext=" + gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString();
                    //myframe.Attributes["src"] = src;
                }
                else if (gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString().Equals(".flv"))
                {
                    src = "OpenFLVDemo.aspx?FullPath=" + gvrecords.DataKeys[gvr.RowIndex].Values["ResourcePath"].ToString() + "&ext=" + gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString();
                    myframe.Attributes["src"] = src;
                    Session["myframesrc"]     = src;
                }
                else if (gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString().Equals(".swf"))
                {
                    src = "OpenFLVDemo.aspx?FullPath=" + gvrecords.DataKeys[gvr.RowIndex].Values["ResourcePath"].ToString() + "&ext=" + gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString();
                    myframe.Attributes["src"] = src;
                    Session["myframesrc"]     = src;
                }
                else if (gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString().Equals(".avi"))
                {
                    src = "OpenFLVDemo.aspx?FullPath=" + gvrecords.DataKeys[gvr.RowIndex].Values["ResourcePath"].ToString() + "&ext=" + gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString();
                    myframe.Attributes["src"] = src;
                    Session["myframesrc"]     = src;
                }

                else if (gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString().Equals(".mp4"))
                {
                    src = "OpenFLVDemo.aspx?FullPath=" + gvrecords.DataKeys[gvr.RowIndex].Values["ResourcePath"].ToString() + "&ext=" + gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString();
                    myframe.Attributes["src"] = src;
                    Session["myframesrc"]     = src;

                    //string filename = "test.mp4";
                    //getExtension(filename);
                }
                else if (gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString().Equals(".html") || gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString().Equals(".htm"))
                {
                    src = gvrecords.DataKeys[gvr.RowIndex].Values["ResourcePath"].ToString();
                    myframe.Attributes["src"] = src;
                    Session["myframesrc"]     = src;
                }
                //else if (gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString().Equals(".Test") || gvrecords.DataKeys[gvr.RowIndex].Values["Ext"].ToString().Equals(".Test"))
                //{
                //    DataSet dsCheckLogToTrackLog = new DataSet();
                //    dsCheckLogToTrackLog = obj.SELECTExamTrackLogOtherEmployee(AppSessions.BMSID, AppSessions.SchoolID, AppSessions.DivisionID, AppSessions.EmpolyeeID);
                //    if (dsCheckLogToTrackLog.Tables.Count > 0)
                //    {
                //        if (dsCheckLogToTrackLog.Tables[0].Rows.Count > 0)
                //        {
                //            if (dsCheckLogToTrackLog.Tables[0].Rows[0]["Activity"].ToString() == "Posttest" || dsCheckLogToTrackLog.Tables[0].Rows[0]["Activity"].ToString() == "Pretest")
                //            {
                //                Hashtable Question = (Hashtable)Application["Exam_TeacherSheResult"];
                //                if (Question == null)
                //                {
                //                    Question = new Hashtable();
                //                }
                //                else
                //                {
                //                    if (Session["TrackLogID"] != null)
                //                    {
                //                        try
                //                        {
                //                            Question.Remove(Session["TrackLogID"].ToString());
                //                            Application.Lock();
                //                            Application["Exam_TeacherSheResult"] = Question;
                //                            Application.UnLock();
                //                        }
                //                        catch (Exception ex)
                //                        { }
                //                    }

                //                }

                //                Session["TrackLogID"] = dsCheckLogToTrackLog.Tables[0].Rows[0]["TrackLogID"].ToString();

                //            }
                //        }
                //    }
                //    src = gvrecords.DataKeys[gvr.RowIndex].Values["ResourcePath"].ToString() + "&BMSSCTID=" + Convert.ToInt32(Session["BMSSCTID"]) + "";


                //    myframe.Attributes["src"] = src;
                //    if (AppSessions.StudentID == 0)
                //    { myframe.Style.Add("height", "550px"); }
                //    else
                //    {
                //        myframe.Style.Add("height", "450px");
                //    }
                //}
                //}
                //else
                //{
                //    //WebMsg.Show("Selected class exam alredy running");
                //  }
            }
            catch (FileNotFoundException ex)
            {
                WebMsg.Show("No File Exists" + ex.StackTrace);
            }
            catch (Exception ex)
            {
                WebMsg.Show("No File Exists");
            }
        }
    }
Exemple #29
0
    protected void ibtnEdit_Click(object sender, ImageClickEventArgs e)
    {
        imgUpdate.Visible = false;
        FormView1.Visible = true;
        DataSet dsSelect        = new DataSet();
        string  SearchCondition = string.Empty;
        string  IFormat         = "dd-MMM-yyyy";
        int     CoundChecked    = (int)EnumFile.AssignValue.Zero;
        int     GRrowIndex      = (int)EnumFile.AssignValue.Zero;

        foreach (GridViewRow gr in gvEmployeeDetails.Rows)
        {
            CheckBox chk = new CheckBox();
            chk = (CheckBox)gr.FindControl("chkSelect");
            if (chk.Checked == true)
            {
                CoundChecked = CoundChecked + 1;
                GRrowIndex   = gr.RowIndex;
            }
        }

        if (CoundChecked == (int)EnumFile.AssignValue.Zero || CoundChecked > (int)EnumFile.AssignValue.One)
        {
            WebMsg.Show("Please select one record to Update.");
        }
        else
        {
            this.InvisiblePanels();
            pnlEdit.CssClass = "Visible";
            int employeeid = Convert.ToInt32(gvEmployeeDetails.DataKeys[GRrowIndex]["EmployeeID"].ToString());
            this.ViewState["EmployeeID"] = employeeid;
            SearchCondition = "and Employee.EmployeeID= " + Convert.ToString(employeeid);
            dsSelect        = dsSelect = this.BAL_Employee.BAL_EmployeeDetailsBySchoolID(Convert.ToInt32(this.Session["SchoolID"]), SearchCondition);

            FormView1.DataSource = dsSelect;
            FormView1.DataBind();
            txtUpdateFirstName.Text        = dsSelect.Tables[0].Rows[0]["FirstName"].ToString();
            txtUpdateMiddleName.Text       = dsSelect.Tables[0].Rows[0]["MiddleName"].ToString();
            txtUpdateLastName.Text         = dsSelect.Tables[0].Rows[0]["LastName"].ToString();
            txtUpdateDOB.Text              = Convert.ToDateTime(dsSelect.Tables[0].Rows[0]["DateOfBirth"].ToString()).ToString(IFormat);
            rlstUpdateGender.SelectedValue = dsSelect.Tables[0].Rows[0]["Gender"].ToString();
            txtUpdateBloodGroup.Text       = dsSelect.Tables[0].Rows[0]["BloodGroup"].ToString();
            txtUpdatePermanentAddress.Text = dsSelect.Tables[0].Rows[0]["Address"].ToString();
            txtUpdateContactNo.Text        = dsSelect.Tables[0].Rows[0]["ContactNo"].ToString();
            txtUpdateEmail.Text            = dsSelect.Tables[0].Rows[0]["EmailID"].ToString();
            txtUpdateQualification.Text    = dsSelect.Tables[0].Rows[0]["Qualification"].ToString();
            txtUpdateDesignation.Text      = dsSelect.Tables[0].Rows[0]["Designation"].ToString();
            if (dsSelect.Tables[0].Rows[0]["Image"].ToString() != string.Empty)
            {
                byte[] ImageBytes = (byte[])dsSelect.Tables[0].Rows[0]["Image"];
                ViewState["ImageBytes"] = ImageBytes;
                if (ImageBytes.Length == 0)
                {
                    FormView1.Visible  = false;
                    imgUpdate.Visible  = true;
                    imgUpdate.ImageUrl = "~/SchoolAdmin/EmployeePhoto/NoPhoto.jpg";
                }
            }
            else
            {
                FormView1.Visible  = false;
                imgUpdate.Visible  = true;
                imgUpdate.ImageUrl = "~/SchoolAdmin/EmployeePhoto/NoPhoto.jpg";
            }

            ////fupUpdateFileUploadPhoto.FileContent.Read(buffer, 0, buffer.Length);
            ddlUpdateSecurityQues.SelectedIndex = Convert.ToInt32(dsSelect.Tables[0].Rows[0]["SecurityQuestion"].ToString());
            txtUpdateSecAns.Text = dsSelect.Tables[0].Rows[0]["SecurityAnswer"].ToString();
        }
    }
Exemple #30
0
    //public void ShowMessage(string message)
    //{
    //    this.lblMessage.Text = message;
    //    ModalMessageExtender.Show();
    //}

    protected void RedirectToDashboard()
    {
        try
        {
            // 0 Indicates Student

            StudentDash    = new StudentDash();
            BLogic_Student = new Student_DashBoard_BLogic();

            DataSet   dtLogin   = new DataSet();
            DataTable LoginInfo = new DataTable();
            DataTable UserInfo  = new DataTable();

            obj_SYS_Role          = new SYS_Role();
            obj_BAL_SYS_Role      = new SYS_Role_BLogic();
            obj_SYS_Role.Username = txtEmail.Text;
            obj_SYS_Role.Password = ViewState["strpassword"].ToString();

            //obj_SYS_Role.roleid = Convert.ToInt16(DdlRole.SelectedValue);
            //if (uctxtEmail.Text != "" && uctxtpass.Text != "")
            //{

            dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Student_Login(obj_SYS_Role);
            LoginInfo = dtLogin.Tables[0];
            //}
            if (LoginInfo.Rows.Count > 0 && LoginInfo != null)
            {
                AppSessions.AppUserType = "Student";

                AppSessions.StudentID = Convert.ToInt32(LoginInfo.Rows[0]["StudentID"].ToString());
                AppSessions.UserName  = LoginInfo.Rows[0]["FirstName"].ToString();

                AppSessions.BMSID = Convert.ToInt32(LoginInfo.Rows[0]["BMSID"].ToString());
                AppSessions.BMS   = LoginInfo.Rows[0]["BMS"].ToString();

                AppSessions.BoardID = Convert.ToInt32(LoginInfo.Rows[0]["BoardID"].ToString());
                AppSessions.Board   = LoginInfo.Rows[0]["Board"].ToString();

                AppSessions.MediumID = Convert.ToInt32(LoginInfo.Rows[0]["MediumID"].ToString());
                AppSessions.Medium   = LoginInfo.Rows[0]["Medium"].ToString();

                AppSessions.StandardID = Convert.ToInt32(LoginInfo.Rows[0]["StandardID"].ToString());
                AppSessions.Standard   = LoginInfo.Rows[0]["Standard"].ToString();

                AppSessions.DivisionID = Convert.ToInt32(LoginInfo.Rows[0]["DivisionID"].ToString());
                //AppSessions.Division = LoginInfo.Rows[0]["Division"].ToString();

                AppSessions.SchoolID = Convert.ToInt32(LoginInfo.Rows[0]["SchoolID"].ToString());
                //AppSessions.SchoolName = LoginInfo.Rows[0]["SchoolName"].ToString();

                AppSessions.Role   = LoginInfo.Rows[0]["Role"].ToString();
                AppSessions.RoleID = Convert.ToInt32(LoginInfo.Rows[0]["RoleID"].ToString());

                AppSessions.IsFreePackage = IsFreePackage();


                //AppSessions.EmailID = Convert.ToString(LoginInfo.Rows[0]["EmailID"]);

                //yourLoginMethodStudent(LoginInfo);
                bool AllowMultipleSession = false;
                AllowMultipleSession = Convert.ToBoolean(LoginInfo.Rows[0]["AllowMultipleSession"].ToString());


                //Hashtable sessions1 = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                //HttpSessionState existingUserSession1 = (HttpSessionState)sessions1[Session["StudentID"].ToString()];
                //if (existingUserSession1 != null)
                //{
                //    Response.Redirect("../Dashboard/StudentDashboard.aspx");
                //}

                if (AllowMultipleSession == false)
                {
                    Hashtable sessions = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                    if (sessions == null)
                    {
                        sessions = new Hashtable();
                    }

                    HttpSessionState existingUserSession = (HttpSessionState)sessions[Session["StudentID"].ToString()];
                    if (existingUserSession != null)
                    {
                        ////existingUserSession[Session["EmpolyeeID"].ToString()] = null;
                        //logout current logged in user
                        WebMsg.Show("you are already logged in.");
                        return;
                    }
                }

                ////////getting the pointer to the Session of the current logged in user
                yourLoginMethodStudent(LoginInfo);
                //ProceedToRedirectPage(LoginInfo);

                bool    AllowPayment  = false;
                DataSet dsPaymentInfo = new DataSet();
                dsPaymentInfo = BLogic_Student.BAL_Select_PaymentPagesInfo("Payment");
                if (dsPaymentInfo != null & dsPaymentInfo.Tables.Count > 0)
                {
                    if (dsPaymentInfo.Tables[0].Rows.Count > 0)
                    {
                        string a = dsPaymentInfo.Tables[0].Rows[0]["value"].ToString();
                        if (a == "0")
                        {
                            AllowPayment = false;
                        }
                        else
                        {
                            AllowPayment = true;
                        }
                    }
                }

                DataSet ds = new DataSet();
                StudentDash.StudentID = AppSessions.StudentID;
                //ds = BLogic_Student.BAL_Validate_Student(StudentDash);
                ds = BLogic_Student.BAL_Validate_Student_Package(StudentDash);
                TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), "Login", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginSuccess), "LoginId: " + txtEmail.Text, 0);


                if (AllowPayment == true)
                {
                    //Session["ShowPaymentPages"] = "yes";
                    if (ds != null && dtLogin.Tables.Count > 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            Session["CheckValidity"] = "Yes";
                            ProceedToRedirect();
                        }
                        else
                        {
                            ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('We have sent your Login details on your registered Email Address, kindly check your Email to get your Password.  ');window.open('../DashBoard/StudentDashboard.aspx','_self');", true);
                            //Response.Redirect("~/DashBoard/StudentDashboard.aspx", false);
                            //ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('Congratulation! You got free trial for 30 days. \\n We have sent your Login details on your registered Email Address.  ');window.open('../DashBoard/StudentDashboard.aspx','_self');", true);
                            TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), "Login", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.PackageSelection), "LoginId: " + txtEmail.Text, 0);
                        }
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('We have sent your Login details on your registered Email Address, kindly check your Email to get your Password.  ');window.open('../DashBoard/StudentDashboard.aspx','_self');", true);
                        //Response.Redirect("~/DashBoard/StudentDashboard.aspx", false);
                        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), "Login", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.PackageSelection), "LoginId: " + txtEmail.Text, 0);
                    }
                }
                else
                {
                    Session["CheckValidity"]    = "Yes";
                    Session["ShowPaymentPages"] = "No";
                    ProceedToRedirect();
                }
            }
        }
        catch (Exception)
        {
        }
    }