Beispiel #1
0
        //Reset Manual Shifting of Semester 2
        protected void btnResetSemester2_Click(object sender, EventArgs e)
        {
            LBLerror.Text     = "";
            Label1.Text       = "";
            lblErrorMian.Text = "";
            DataTable dtTools      = null;
            DataTable dtMath       = null;
            DataTable dtResearch   = null;
            DataTable dtPrograming = null;

            if (Session["TOOL"] != null)
            {
                dtTools = (DataTable)Session["TOOL"];
            }
            if (Session["Mathmetic"] != null)
            {
                dtMath = (DataTable)Session["Mathmetic"];
            }
            if (Session["Programing"] != null)
            {
                dtPrograming = (DataTable)Session["Programing"];
            }
            if (Session["ResearchExp"] != null)
            {
                dtResearch = (DataTable)Session["ResearchExp"];
            }

            int creditHr = 0;

            foreach (GridViewRow row in grdSugSemester1.Rows)
            {
                creditHr = creditHr + int.Parse(row.Cells[3].Text.ToString().Trim());
            }
            int rangfrom = 60;
            int rang     = 125 - creditHr;

            if (creditHr >= 65)
            {
                rangfrom = 50;
            }
            if (rang >= 70)
            {
                rang = 70;
            }

            BusinessLayer.CalcualteResult obj = new BusinessLayer.CalcualteResult();
            string CallFrom = "NotModify";

            if (Session["CallFromResult"] != null)
            {
                CallFrom = Session["CallFromResult"].ToString();
            }



            if (CallFrom == "Modify")
            {
                int       User_ID           = (int)Session["UserID"];
                DataTable dtModuleSemester2 = obj.GetPreRecordSM2(User_ID);
                grdSugSemester2.DataSource = dtModuleSemester2;
                grdSugSemester2.DataBind();
                obj.CalculateResults(dtTools, dtMath, dtResearch, dtPrograming);

                DataSet    dsSemester2 = obj.SortSmester2Data();
                DataTable  dtSemester2 = obj.GetSM2RecordInfo();
                DataColumn dc          = new DataColumn("none Selected");
                dtSemester2.Columns.Add(dc);
                Add_falseNegetive(dsSemester2.Tables[0], dtSemester2);
                Add_falseNegetive(dsSemester2.Tables[1], dtSemester2);
                grdSemester2Detail.DataSource = dtSemester2;
                grdSemester2Detail.DataBind();

                DataTable dttemp2 = obj.PriviousNonSugestionModuleSm2(dtModuleSemester2);
                grdNonSugSemester2.DataSource = dttemp2;
                grdNonSugSemester2.DataBind();
            }
            else
            {
                obj.setTotalCridetHr(rangfrom, rang);
                obj.CalculateResults(dtTools, dtMath, dtResearch, dtPrograming);
                DataSet dtsm2 = obj.SortSmester2Data();

                grdSugSemester2.DataSource = dtsm2.Tables[0];
                grdSugSemester2.DataBind();
                grdNonSugSemester2.DataSource = dtsm2.Tables[1];
                grdNonSugSemester2.DataBind();

                DataTable  dttemp = obj.GetSM2RecordInfo();
                DataColumn dc     = new DataColumn("none Selected");
                dttemp.Columns.Add(dc);

                Add_falseNegetive(dtsm2.Tables[0], dttemp);
                Add_falseNegetive(dtsm2.Tables[1], dttemp);

                grdSemester2Detail.DataSource = dttemp;
                grdSemester2Detail.DataBind();
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dtTools      = null;
                DataTable dtMath       = null;
                DataTable dtResearch   = null;
                DataTable dtPrograming = null;
                if (Session["TOOL"] != null)
                {
                    dtTools = (DataTable)Session["TOOL"];
                }
                if (Session["Mathmetic"] != null)
                {
                    dtMath = (DataTable)Session["Mathmetic"];
                }
                if (Session["Programing"] != null)
                {
                    dtPrograming = (DataTable)Session["Programing"];
                }
                if (Session["ResearchExp"] != null)
                {
                    dtResearch = (DataTable)Session["ResearchExp"];
                }
                BusinessLayer.CalcualteResult obj = new BusinessLayer.CalcualteResult();
                string CallFrom = "NotModify";
                if (Session["CallFromResult"] != null)
                {
                    CallFrom = Session["CallFromResult"].ToString();
                }



                if (CallFrom == "Modify")
                {
                    int       User_ID           = (int)Session["UserID"];
                    DataTable dtModuleSemester2 = obj.GetPreRecordSM2(User_ID);
                    grdSugSemester2.DataSource = dtModuleSemester2;
                    grdSugSemester2.DataBind();
                    DataTable dtModuleSemester1 = obj.GetPreRecordSM1(User_ID);
                    grdSugSemester1.DataSource = dtModuleSemester1;
                    grdSugSemester1.DataBind();



                    obj.CalculateResults(dtTools, dtMath, dtResearch, dtPrograming);
                    DataSet   dsSemester1 = obj.SortSmester1Data();
                    DataSet   dsSemester2 = obj.SortSmester2Data();
                    DataTable dtSemster1  = obj.GetSM1RecordInfo();


                    DataColumn dc = new DataColumn("none Selected");
                    dtSemster1.Columns.Add(dc);
                    Add_falseNegetive(dsSemester1.Tables[0], dtSemster1);
                    Add_falseNegetive(dsSemester1.Tables[1], dtSemster1);
                    grdSemester1Detail.DataSource = dtSemster1;
                    grdSemester1Detail.DataBind();

                    DataTable dtSemester2 = obj.GetSM2RecordInfo();

                    Add_falseNegetive(dsSemester2.Tables[0], dtSemester2);
                    Add_falseNegetive(dsSemester2.Tables[1], dtSemester2);
                    grdSemester2Detail.DataSource = dtSemester2;
                    grdSemester2Detail.DataBind();


                    DataTable dttemp = obj.PriviousNonSugestionModuleSm1(dtModuleSemester1);

                    grdNonSugSemester1.DataSource = dttemp;
                    grdNonSugSemester1.DataBind();

                    DataTable dttemp2 = obj.PriviousNonSugestionModuleSm2(dtModuleSemester2);

                    grdNonSugSemester2.DataSource = dttemp2;
                    grdNonSugSemester2.DataBind();
                }
                else
                {
                    obj.CalculateResults(dtTools, dtMath, dtResearch, dtPrograming);

                    //DsSemester1 contain 2 table for Semester 1..table[0] have recommended modules  and table[1] have non recommended modules

                    DataSet dsSemester1 = obj.SortSmester1Data();
                    grdSugSemester1.DataSource = dsSemester1.Tables[0];
                    grdSugSemester1.DataBind();
                    grdNonSugSemester1.DataSource = dsSemester1.Tables[1];
                    grdNonSugSemester1.DataBind();

                    //Set the total range of credit hr of semester 1 and semester 2
                    obj.setTotalCridetHr(120, 125);

                    //DsSemester2 contain 2 table for Semester 2..table[0] have recommended modules  and table[1] have non recommended modules
                    DataSet dsSemester2 = obj.SortSmester2Data();

                    grdSugSemester2.DataSource = dsSemester2.Tables[0];
                    grdSugSemester2.DataBind();
                    grdNonSugSemester2.DataSource = dsSemester2.Tables[1];
                    grdNonSugSemester2.DataBind();



                    DataTable dtSemster1 = obj.GetSM1RecordInfo();

                    DataColumn dc = new DataColumn("none Selected");
                    dtSemster1.Columns.Add(dc);
                    Add_falseNegetive(dsSemester1.Tables[0], dtSemster1);
                    Add_falseNegetive(dsSemester1.Tables[1], dtSemster1);


                    grdSemester1Detail.DataSource = dtSemster1;
                    grdSemester1Detail.DataBind();
                    DataTable dtSemester2 = obj.GetSM2RecordInfo();

                    Add_falseNegetive(dsSemester2.Tables[0], dtSemester2);
                    Add_falseNegetive(dsSemester2.Tables[1], dtSemester2);

                    grdSemester2Detail.DataSource = dtSemester2;
                    grdSemester2Detail.DataBind();
                }
            }
        }