Exemple #1
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        SYS_BMS            = new SYS_BMS();
        this.BAL_SYS_BMS   = new SYS_BMS_BLogic();
        SYS_BMS.bmsid      = Convert.ToInt32(ViewState["bmsid"].ToString());
        SYS_BMS.boardid    = Convert.ToInt32(ddlBoardEdit.SelectedValue);
        SYS_BMS.mediumid   = Convert.ToInt32(ddlMediumEdit.SelectedValue);
        SYS_BMS.standardid = Convert.ToInt32(ddlStandardEdit.SelectedValue);
        ////SYS_BMS.bms = txtBMSEdit.Text;
        if (rlstUpdateActive.SelectedValue == "0")
        {
            SYS_BMS.issemester = false;
        }
        else if (rlstUpdateActive.SelectedValue == "1")
        {
            SYS_BMS.issemester = true;
        }
        ////SYS_BMS.createdon = txtCreatedOnEdit.Text;
        SYS_BMS.createdby = Convert.ToInt32(Session["EmpolyeeID"]);
        Status            = BAL_SYS_BMS.BAL_SYS_BMS_Update(SYS_BMS, "Update");
        if (Status == 1)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Record successfully updated.')</script>", false);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Record not updated.')</script>", false);
        }

        RefreshPageControls();
    }
 private void GetDDLBMSDetails()
 {
     try
     {
         DropDownFill DdlFilling = new DropDownFill();
         SYS_BMSBLogic = new SYS_BMS_BLogic();
         DataSet dsselectBMS = new DataSet();
         dsselectBMS = SYS_BMSBLogic.BAL_SYS_BMS_SelectAll();
         if (dsselectBMS.Tables.Count > ((int)EnumFile.AssignValue.Zero))
         {
             if (dsselectBMS.Tables[0].Rows.Count > 0)
             {
                 ddlBoardMediumStandard.Items.Clear();
                 ddlBoardMediumStandard.Items.Insert(0, "-- Select --");
                 ddlBoardMediumStandard.Items[0].Value = "0";
                 ddlBoardMediumStandard.DataSource     = dsselectBMS.Tables[0];
                 ddlBoardMediumStandard.DataTextField  = "BMS";
                 ddlBoardMediumStandard.DataValueField = "BMSID";
                 ddlBoardMediumStandard.DataBind();
             }
             else
             {
                 ddlBoardMediumStandard.Items.Clear();
                 ddlBoardMediumStandard.DataBind();
                 ddlBoardMediumStandard.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
                 ddlBoardMediumStandard.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
    /// <summary>
    ///Set BMS Table in Viewstate
    /// </summary>
    private void SetBMSTableInViewstate()
    {
        SYS_BMSBLogic = new SYS_BMS_BLogic();
        DataSet dsselectBMS = new DataSet();

        dsselectBMS           = SYS_BMSBLogic.BAL_SYS_BMS_SelectAllBySchoolID(AppSessions.SchoolID);
        ViewState["BMSTable"] = dsselectBMS.Tables[0];
    }
    /// <summary>
    ///Set Division Table in Viewstate
    /// </summary>
    private void SetDivisionTableInViewState()
    {
        SYS_BMSBLogic = new SYS_BMS_BLogic();
        DataSet dsDivision = new DataSet();

        dsDivision = SYS_BMSBLogic.BAL_SYS_BMS_FillDivisionBySchoolBMSID(AppSessions.SchoolID);
        ViewState["DivisionTable"] = dsDivision.Tables[0];
    }
Exemple #5
0
    /// <summary>
    /// Bind Admission Grade dropdown with BMS assigned to school
    /// </summary>
    private void BindAdmissionGrageDropDown()
    {
        DropDownFill   DdlFilling    = new DropDownFill();
        SYS_BMS_BLogic SYS_BMSBLogic = new SYS_BMS_BLogic();
        DataSet        dsselectBMS   = new DataSet();

        dsselectBMS = SYS_BMSBLogic.BAL_SYS_BMS_SelectAllBySchoolID(AppSessions.SchoolID);
        if (dsselectBMS.Tables.Count > ((int)EnumFile.AssignValue.Zero))
        {
            DdlFilling.BindDropDownByTable(DdlAdmissionGrade, dsselectBMS.Tables[0], "BMS", "BMSID");
        }
        else
        {
            DdlFilling.ClearDropDownListRef(DdlAdmissionGrade);
        }
    }
    /// <summary>
    /// Set Division Value in ZZ column of excel sheet.
    /// </summary>
    private static void SetDivValue(Worksheet xlsWorksheet)
    {
        SYS_BMS_BLogic BSysBMS    = new SYS_BMS_BLogic();
        DataSet        dsDivision = new DataSet();

        dsDivision = BSysBMS.BAL_SYS_BMS_FillDivisionBySchoolBMSID(AppSessions.SchoolID);
        if (dsDivision.Tables[0].Rows.Count > 0)
        {
            int i = 1;
            foreach (DataRow oDr in dsDivision.Tables[0].Rows)
            {
                xlsWorksheet.Range["ZZ" + i + ""].Value = Convert.ToString(oDr["Division"]);
                i++;
            }
        }
        SeDivisionDropDown(xlsWorksheet, dsDivision.Tables[0].Rows.Count);
    }
    /// <summary>
    /// Set BMS Value in XX column of excel sheet.
    /// </summary>
    private void SetBMSValue(Worksheet xlsWorksheet)
    {
        SYS_BMS_BLogic BSysBMS = new SYS_BMS_BLogic();
        DataSet        dsBMS   = new DataSet();

        dsBMS = BSysBMS.BAL_SYS_BMS_SelectAllBySchoolID(AppSessions.SchoolID);
        if (dsBMS.Tables[0].Rows.Count > 0)
        {
            int i = 1;
            foreach (DataRow oDr in dsBMS.Tables[0].Rows)
            {
                xlsWorksheet.Range["XX" + i + ""].Value = Convert.ToString(oDr["BMS"]);
                i++;
            }
        }
        SetBMSDropDown(xlsWorksheet, dsBMS.Tables[0].Rows.Count);
    }
    public void FillDivisionDropDown(DropDownList ddlDivision, int i)
    {
        SchoolBLogic = new School_BLogic();
        DataTable dt = new DataTable();


        SYS_BMS_BLogic SYS_BMSBLogic = new SYS_BMS_BLogic();
        DataSet        dsselectBMS   = new DataSet();

        if (i == 1)
        {
            dsselectBMS = SYS_BMSBLogic.BAL_SYS_Division_SelectAllBySchoolID(Convert.ToInt64(ddlschool.SelectedValue), Convert.ToInt64(ddlBMS.SelectedValue));
            if (dsselectBMS.Tables[0].Rows.Count > 0)
            {
                ddldiv.Enabled = true;
            }
            else
            {
                ddldiv.Enabled = false;
            }
        }
        else
        {
            dsselectBMS = SYS_BMSBLogic.BAL_SYS_Division_SelectAllBySchoolID(Convert.ToInt64(ddlschool.SelectedValue), Convert.ToInt64(ddlnextyearBMS.SelectedValue));
            if (dsselectBMS.Tables[0].Rows.Count > 0)
            {
                ddldivision.Enabled = true;
            }
            else
            {
                ddldivision.Enabled = false;
            }
        }

        dt = dsselectBMS.Tables[0];
        if (dt != null)
        {
            if (dt.Rows.Count > 0)
            {
                DdlFilling = new DropDownFill();
                DdlFilling.BindDropDownByTable(ddlDivision, dt, "Division", "DivisionID");
                ddlDivision.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
                ddlDivision.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
            }
        }
    }
Exemple #9
0
    protected void IbtnDelete_Click(object sender, ImageClickEventArgs e)
    {
        int    CountChecked = 0;
        string BMSIDStr     = string.Empty;

        foreach (GridViewRow gr in grvSYS_BMSdetail.Rows)
        {
            CheckBox chk = new CheckBox();
            chk = (CheckBox)gr.FindControl("chkSelect");
            if (chk.Checked == true)
            {
                if (CountChecked == 0)
                {
                    BMSIDStr = grvSYS_BMSdetail.DataKeys[gr.RowIndex]["BMSID"].ToString();
                }
                else
                {
                    BMSIDStr = BMSIDStr + "," + grvSYS_BMSdetail.DataKeys[gr.RowIndex]["BMSID"].ToString();
                }

                CountChecked = CountChecked + 1;
            }
        }

        if (CountChecked == 0)
        {
            WebMsg.Show("Please select one record to delete.");
        }
        else
        {
            SYS_BMS          = new SYS_BMS();
            this.BAL_SYS_BMS = new SYS_BMS_BLogic();
            SYS_BMS.bmsidStr = BMSIDStr;
            this.BAL_SYS_BMS.BAL_SYS_BMS_Delete(SYS_BMS, "Delete");
            //if (Status == 1)
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Record successfully updated.')</script>", false);
            //}
            //else
            //{
            //    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Record not updated.')</script>", false);
            //}
            RefreshPageControls();
        }
    }
    private void SetBMSAndDivisionID(Int64 bmssctid, string bms)
    {
        SYS_BMS_BLogic objBMSSCT = new SYS_BMS_BLogic();
        DataSet        BmssctDs  = new DataSet();

        if (!string.IsNullOrEmpty(Convert.ToString(bmssctid)))
        {
            BmssctDs = objBMSSCT.BAL_SYS_BMSSCT_ByGroupBMSSCTID(Convert.ToString(bmssctid));
            if (BmssctDs.Tables.Count > 0)
            {
                if (BmssctDs.Tables[0].Rows.Count > 0)
                {
                    AppSessions.BMSID = Convert.ToInt32(BmssctDs.Tables[0].Rows[0]["BMSID"]);
                    AppSessions.BMS   = bms;
                }
            }
        }
    }
Exemple #11
0
    /// <summary>
    /// This method used for bind BMS Dropdown based on SchoolID
    /// </summary>
    protected void GetDDLBMSDetails()
    {
        DropDownFill DdlFilling = new DropDownFill();

        this.SYS_BMSBLogic = new SYS_BMS_BLogic();
        DataSet dsselectBMS = new DataSet();

        dsselectBMS = this.SYS_BMSBLogic.BAL_SYS_BMS_SelectAllBySchoolID(Convert.ToInt64(this.Session["SchoolID"]));
        if (dsselectBMS.Tables.Count > ((int)EnumFile.AssignValue.Zero))
        {
            DdlFilling.BindDropDownByTable(this.ddlBoardMediumStandard, dsselectBMS.Tables[0], "BMS", "BMSID");
            ddlBoardMediumStandard.Items.Insert((int)EnumFile.AssignValue.Zero, "ALL");
            ddlBoardMediumStandard.Items[0].Value = ((int)EnumFile.AssignValue.Zero).ToString();
        }
        else
        {
            DdlFilling.ClearDropDownListRef(this.ddlBoardMediumStandard);
        }
    }
    protected static string[] GetBMS()
    {
        List <string>  bmsList = new List <string>();
        SYS_BMS_BLogic BSysBMS = new SYS_BMS_BLogic();
        DataSet        dsBMS   = new DataSet();

        try
        {
            dsBMS = BSysBMS.BAL_SYS_BMS_SelectAll();

            foreach (DataRow dr in dsBMS.Tables[0].Rows)
            {
                bmsList.Add(dr["BMS"].ToString());
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        return(bmsList.ToArray());
    }
Exemple #13
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        try
        {
            this.SYS_BMS       = new SYS_BMS();
            this.BAL_SYS_BMS   = new SYS_BMS_BLogic();
            SYS_BMS.boardid    = Convert.ToInt32(ddlBoard.SelectedValue);
            SYS_BMS.mediumid   = Convert.ToInt32(ddlMedium.SelectedValue);
            SYS_BMS.standardid = Convert.ToInt32(ddlStandard.SelectedValue);

            if (rlstAddSemester.SelectedValue == "0")
            {
                SYS_BMS.issemester = false;
            }
            else if (rlstAddSemester.SelectedValue == "1")
            {
                SYS_BMS.issemester = true;
            }
            SYS_BMS.createdby = Convert.ToInt32(Session["EmpolyeeID"]);
            Status            = BAL_SYS_BMS.BAL_SYS_BMS_Insert(SYS_BMS, "Insert");
            if (Status == 1)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Record successfully inserted.')</script>", false);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Record not inserted.')</script>", false);
            }
            RefreshPageControls();
            pnlSearch.CssClass = "Visible";
        }
        catch (Exception ex)
        {
            throw ex;
        }
        ////finally
        ////{
        ////}
    }
    private void FillBMSDropdown(DropDownList ddlBMS)
    {
        SchoolBLogic = new School_BLogic();
        DataTable dt = new DataTable();


        SYS_BMS_BLogic SYS_BMSBLogic = new SYS_BMS_BLogic();
        DataSet        dsselectBMS   = new DataSet();

        dsselectBMS = SYS_BMSBLogic.BAL_SYS_BMS_SelectAllBySchoolID(Convert.ToInt64(ddlschool.SelectedValue));
        dt          = dsselectBMS.Tables[0];
        if (dt != null)
        {
            if (dt.Rows.Count > 0)
            {
                DdlFilling = new DropDownFill();
                DdlFilling.BindDropDownByTable(ddlBMS, dt, "BMS", "BMSID");
                //ddlBMS.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
                //ddlBMS.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //mp1.Show();
            if (Request.QueryString["BMSSCTID"].ToString() != "")
            {
                SYS_BMS_BLogic objBMSSCT = new SYS_BMS_BLogic();
                DataSet        BmssctDs  = new DataSet();
                if (!string.IsNullOrEmpty(Request.QueryString["GroupBMSSCT"].ToString()))
                {
                    BmssctDs = objBMSSCT.BAL_SYS_BMSSCT_ByGroupBMSSCTID(Request.QueryString["GroupBMSSCT"]);
                    if (BmssctDs.Tables.Count > 0)
                    {
                        StringBuilder ToolTiplblChapterValue = new StringBuilder();
                        StringBuilder ToolTiplblTopicValue   = new StringBuilder();

                        foreach (DataRow odr in BmssctDs.Tables[0].Rows)
                        {
                            string   BMSSCTNAME = odr["BMS_SCT"].ToString();
                            string[] lines      = Regex.Split(BMSSCTNAME, ">>");
                            ToolTiplblChapterValue.Append(lines[lines.Length - 1]);
                            ToolTiplblChapterValue.Append(Environment.NewLine);

                            ToolTiplblTopicValue.Append(lines[lines.Length - 2]);
                            ToolTiplblTopicValue.Append(Environment.NewLine);
                        }
                        lblChapterValue.Text = "Multiple Chapter";
                        lblTopicValue.Text   = "Multiple Topics";

                        lblChapterValue.ToolTip = ToolTiplblChapterValue.ToString();
                        lblTopicValue.ToolTip   = ToolTiplblTopicValue.ToString();
                    }
                }
                else
                {
                    BmssctDs = objBMSSCT.BAL_SYS_BMSSCT_ByBMSSCTID(Convert.ToInt32(Request.QueryString["BMSSCTID"].ToString()));
                    if (BmssctDs.Tables.Count > 0)
                    {
                        if (BmssctDs.Tables[0].Rows.Count > 0)
                        {
                            string   BMSSCTNAME = BmssctDs.Tables[0].Rows[0]["BMS_SCT"].ToString();
                            string[] lines      = Regex.Split(BMSSCTNAME, ">>");
                            lblChapterValue.Text = lines[lines.Length - 1];
                            lblTopicValue.Text   = lines[lines.Length - 2];
                            string ForTitle = "";
                            for (int Ti = 0; Ti < lines.Length - 2; Ti++)
                            {
                                if (Ti < lines.Length - 3)
                                {
                                    ForTitle = ForTitle + lines[Ti] + " >> ";
                                }
                                else
                                {
                                    ForTitle = ForTitle + lines[Ti];
                                }
                            }
                            lblExamStartOf.Text = "Your " + Request.QueryString["TestType"].ToString() + "  for " + ForTitle;
                        }
                        else
                        {
                            lblExamStartOf.Text = "Your " + Request.QueryString["TestType"].ToString() + "  for " + "";
                        }
                    }
                    else
                    {
                        lblExamStartOf.Text = "Your " + Request.QueryString["TestType"].ToString() + "  for" + "";
                    }
                }
                ViewState["TestTypeToTable"] = Request.QueryString["TestType"].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();


                DataSet dsExamAuto = null;

                Hashtable Question = (Hashtable)Application["Exam_TeacherSheResult"];
                if (Question == null)
                {
                    Question = new Hashtable();
                }
                else
                {
                    dsExamAuto = (DataSet)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 (dsExamAuto != null)
                {
                    if (dsExamAuto.Tables.Count > 0)
                    {
                        if (dsExamAuto.Tables.Count > 1)
                        {
                            DataRow drStudentInfo = dsExamAuto.Tables[1].NewRow();
                            drStudentInfo["StudentID"]   = AppSessions.StudentID;
                            drStudentInfo["StudentName"] = AppSessions.UserName;
                            drStudentInfo["RightAnswer"] = 0;
                            drStudentInfo["WrongAnswer"] = 0;
                            drStudentInfo["EmailID"]     = AppSessions.EmailID;
                            dsExamAuto.Tables[1].Rows.Add(drStudentInfo);
                            dsExamAuto.Tables[1].AcceptChanges();

                            Question[Session["TrackLogID"].ToString()] = dsExamAuto;
                            Application.Lock(); //lock to prevent duplicate objects
                            Application["Exam_TeacherSheResult"] = Question;
                            Application.UnLock();
                        }
                        if (dsExamAuto.Tables[0].Rows.Count > 0)
                        {
                            DataTable dtExaAuto = dsExamAuto.Tables[0];
                            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;
                            Session["ExamStarted"] = "";
                            Session["TrackLogID"]  = "";
                            WebMsg.Show("No Question found!");
                            Response.Redirect("../Dashboard/StudentDashboard.aspx");
                        }
                    }
                    else
                    {
                        BtnButton.Visible      = false;
                        Session["ExamStarted"] = "";
                        Session["TrackLogID"]  = "";
                        WebMsg.Show("No Question found!");
                        Response.Redirect("../Dashboard/StudentDashboard.aspx");
                    }
                }
                else
                {
                    Session["ExamStarted"] = "";
                    Session["TrackLogID"]  = "";
                    Response.Redirect("../Dashboard/StudentDashboard.aspx");
                }
            }
        }
    }
Exemple #16
0
    private void bindgrvSYS_BMSdetail()
    {
        SYS_BMS          = new SYS_BMS();
        this.BAL_SYS_BMS = new SYS_BMS_BLogic();

        DataSet dsSelect = new DataSet();

        dsSelect = this.BAL_SYS_BMS.BAL_SYS_BMS_Select(SYS_BMS, "SelectAll");
        if (dsSelect.Tables.Count > 0)
        {
            string searchCondition = string.Empty;

            if (txtBoardSearch.Text != string.Empty)
            {
                searchCondition = "Board like '%" + txtBoardSearch.Text + "%'";
            }

            if (txtMediumSearch.Text != string.Empty)
            {
                if (searchCondition != string.Empty)
                {
                    searchCondition = searchCondition + " and ";
                }

                searchCondition = "Medium like '%" + txtMediumSearch.Text + "%'";
            }

            if (txtStandardSearch.Text != string.Empty)
            {
                if (searchCondition != string.Empty)
                {
                    searchCondition = searchCondition + " and ";
                }

                searchCondition = "Standard like '%" + txtStandardSearch.Text + "%'";
            }

            if (rlstActive.SelectedValue == "0")
            {
                if (searchCondition != string.Empty)
                {
                    searchCondition = searchCondition + " and ";
                }

                searchCondition = searchCondition + "IsSemester ='No'";
            }
            else if (rlstActive.SelectedValue == "1")
            {
                if (searchCondition != string.Empty)
                {
                    searchCondition = searchCondition + " and ";
                }

                searchCondition = searchCondition + "IsSemester ='Yes'";
            }

            DataView dv = new DataView(dsSelect.Tables[0]);
            dv.RowFilter = searchCondition;

            DataSet dsSelectSub = new DataSet();
            dsSelectSub.Tables.Add(dv.ToTable());

            GridViewOperations GrvOperation = new GridViewOperations();
            GrvOperation.BindGridWithSorting(grvSYS_BMSdetail, dsSelectSub, this.SortField, this.SortDirection);
        }
        else
        {
            grvSYS_BMSdetail.DataSource = null;
            grvSYS_BMSdetail.DataBind();
        }
    }