//public bool IsDup { get; set; }



    public Calculation_T6(int intResultSectionID, int TransactionID)
    {
        this.ResultSectionID = intResultSectionID;
        this.TransactionID   = TransactionID;



        Model_ReportSectionItem rss = new Model_ReportSectionItem();

        this.ReportSectionItem = rss.GetListItemBySectionID(this.ResultSectionID);



        Model_ReportItemResult ret = new Model_ReportItemResult();

        this.ReportResultT4 = ret.GetItemReportByTransactionID(this.TransactionID, 4);
        this.ReportResultT2 = ret.GetItemReportByTransactionID(this.TransactionID, 2);

        Model_Jobfunction cj = new Model_Jobfunction();

        this.JobFunctionList = cj.GetAll();

        Model_JobFunctionListMain cjm = new Model_JobFunctionListMain();

        this.JobFunctionListMain = cjm.GetAllActive();

        Model_JobFunctionListMap cjmap = new Model_JobFunctionListMap();

        this.JobFunctionListMap = cjmap.GetAllList();

        Model_JFR1 r1 = new Model_JFR1();

        this.Rule1 = r1.GetAll();
        Model_JFR2 r2 = new Model_JFR2();

        this.Rule2 = r2.GetAll();
        Model_JFR3 r3 = new Model_JFR3();

        this.Rule3 = r3.GetAll();
        Model_JFR4 r4 = new Model_JFR4();

        this.Rule4 = r4.GetAll();
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            Model_JFR1 r1 = new Model_JFR1();

            List <Model_JFR1> rule1 = r1.GetAll();


            Model_JFR1 r1row1 = rule1.Where(o => o.RuleID == 1).FirstOrDefault();

            txtRuleTitle1.Text = r1row1.Title;
            txtRuleScore1.Text = r1row1.Score.ToString();
            txtr1_1.Text       = r1row1.CJRRuleScore1.ToString();
            txtr1_2.Text       = r1row1.CJRRuleScore2.ToString();
            txtr1_3.Text       = r1row1.CJRRuleScore3.ToString();
            txtr1_4.Text       = r1row1.CJRRuleScore4.ToString();
            txtr1_5.Text       = r1row1.CJRRuleScore5.ToString();

            Model_JFR1 r1row2 = rule1.Where(o => o.RuleID == 2).FirstOrDefault();

            txtRuleTitle2.Text = r1row2.Title;
            txtRuleScore2.Text = r1row2.Score.ToString();
            txtr2_1.Text       = r1row2.CJRRuleScore1.ToString();
            txtr2_2.Text       = r1row2.CJRRuleScore2.ToString();
            txtr2_3.Text       = r1row2.CJRRuleScore3.ToString();
            txtr2_4.Text       = r1row2.CJRRuleScore4.ToString();
            txtr2_5.Text       = r1row2.CJRRuleScore5.ToString();

            Model_JFR1 r1row3 = rule1.Where(o => o.RuleID == 3).FirstOrDefault();

            txtRuleTitle3.Text = r1row3.Title;
            txtRuleScore3.Text = r1row3.Score.ToString();
            txtr3_1.Text       = r1row3.CJRRuleScore1.ToString();
            txtr3_2.Text       = r1row3.CJRRuleScore2.ToString();
            txtr3_3.Text       = r1row3.CJRRuleScore3.ToString();
            txtr3_4.Text       = r1row3.CJRRuleScore4.ToString();
            txtr3_5.Text       = r1row3.CJRRuleScore5.ToString();

            Model_JFR1 r1row4 = rule1.Where(o => o.RuleID == 4).FirstOrDefault();

            txtRuleTitle4.Text = r1row4.Title;
            txtRuleScore4.Text = r1row4.Score.ToString();
            txtr4_1.Text       = r1row4.CJRRuleScore1.ToString();
            txtr4_2.Text       = r1row4.CJRRuleScore2.ToString();
            txtr4_3.Text       = r1row4.CJRRuleScore3.ToString();
            txtr4_4.Text       = r1row4.CJRRuleScore4.ToString();
            txtr4_5.Text       = r1row4.CJRRuleScore5.ToString();

            Model_JFR1 r1row5 = rule1.Where(o => o.RuleID == 5).FirstOrDefault();

            txtRuleTitle5.Text = r1row5.Title;
            txtRuleScore5.Text = r1row5.Score.ToString();
            txtr5_1.Text       = r1row5.CJRRuleScore1.ToString();
            txtr5_2.Text       = r1row5.CJRRuleScore2.ToString();
            txtr5_3.Text       = r1row5.CJRRuleScore3.ToString();
            txtr5_4.Text       = r1row5.CJRRuleScore4.ToString();
            txtr5_5.Text       = r1row5.CJRRuleScore5.ToString();


            Model_JFR2 r2 = new Model_JFR2();

            List <Model_JFR2> rule2 = r2.GetAll();


            Model_JFR2 r2row1 = rule2.Where(o => o.RuleID == 1).FirstOrDefault();

            txtRuleTitle21.Text = r2row1.Title;
            txtRuleScore21.Text = r2row1.Score.ToString();
            txtr21_1.Text       = r2row1.CJRRuleScore1.ToString();
            txtr21_2.Text       = r2row1.CJRRuleScore2.ToString();
            txtr21_3.Text       = r2row1.CJRRuleScore3.ToString();
            txtr21_4.Text       = r2row1.CJRRuleScore4.ToString();


            Model_JFR2 r2row2 = rule2.Where(o => o.RuleID == 2).FirstOrDefault();

            txtRuleTitle22.Text = r2row2.Title;
            txtRuleScore22.Text = r2row2.Score.ToString();
            txtr22_1.Text       = r2row2.CJRRuleScore1.ToString();
            txtr22_2.Text       = r2row2.CJRRuleScore2.ToString();
            txtr22_3.Text       = r2row2.CJRRuleScore3.ToString();
            txtr22_4.Text       = r2row2.CJRRuleScore4.ToString();


            Model_JFR2 r2row3 = rule2.Where(o => o.RuleID == 3).FirstOrDefault();

            txtRuleTitle23.Text = r2row3.Title;
            txtRuleScore23.Text = r2row3.Score.ToString();
            txtr23_1.Text       = r2row3.CJRRuleScore1.ToString();
            txtr23_2.Text       = r2row3.CJRRuleScore2.ToString();
            txtr23_3.Text       = r2row3.CJRRuleScore3.ToString();
            txtr23_4.Text       = r2row3.CJRRuleScore4.ToString();


            Model_JFR2 r2row4 = rule2.Where(o => o.RuleID == 4).FirstOrDefault();

            txtRuleTitle24.Text = r2row4.Title;
            txtRuleScore24.Text = r2row4.Score.ToString();
            txtr24_1.Text       = r2row4.CJRRuleScore1.ToString();
            txtr24_2.Text       = r2row4.CJRRuleScore2.ToString();
            txtr24_3.Text       = r2row4.CJRRuleScore3.ToString();
            txtr24_4.Text       = r2row4.CJRRuleScore4.ToString();



            Model_JFR3        r3    = new Model_JFR3();
            List <Model_JFR3> rule3 = r3.GetAll();

            List <Model_JFR3> rule3G1 = rule3.Where(o => o.Cat == 1).ToList();
            List <Model_JFR3> rule3G2 = rule3.Where(o => o.Cat == 2).ToList();

            Model_JFR3 r3row1 = rule3G1.Where(o => o.RuleID == 1).FirstOrDefault();
            Model_JFR3 r3row2 = rule3G1.Where(o => o.RuleID == 2).FirstOrDefault();
            Model_JFR3 r3row3 = rule3G1.Where(o => o.RuleID == 3).FirstOrDefault();

            TextBox3_1.Text = r3row1.Condition1;
            TextBox3_2.Text = r3row1.Condition2;
            TextBox3_3.Text = r3row1.Score.ToString();

            TextBox3_11.Text = r3row2.Condition1;
            TextBox3_12.Text = r3row2.Condition2;
            TextBox3_13.Text = r3row2.Score.ToString();

            TextBox3_111.Text = r3row3.Condition1;
            TextBox3_112.Text = r3row3.Condition2;
            TextBox3_113.Text = r3row3.Score.ToString();

            Model_JFR3 r4row1 = rule3G2.Where(o => o.RuleID == 5).FirstOrDefault();
            Model_JFR3 r4row2 = rule3G2.Where(o => o.RuleID == 6).FirstOrDefault();
            Model_JFR3 r4row3 = rule3G2.Where(o => o.RuleID == 7).FirstOrDefault();


            TextBox4_1.Text = r4row1.Condition1;
            TextBox4_2.Text = r4row1.Condition2;
            TextBox4_3.Text = r4row1.Score.ToString();

            TextBox4_11.Text = r4row2.Condition1;
            TextBox4_12.Text = r4row2.Condition2;
            TextBox4_13.Text = r4row2.Score.ToString();

            TextBox4_111.Text = r4row3.Condition1;
            TextBox4_112.Text = r4row3.Condition2;
            TextBox4_113.Text = r4row3.Score.ToString();


            Model_JFR4        r4    = new Model_JFR4();
            List <Model_JFR4> rule4 = r4.GetAll();

            List <Model_JFR4> rule4G1 = rule4.Where(o => o.Cat == 1).ToList();
            List <Model_JFR4> rule4G2 = rule4.Where(o => o.Cat == 2).ToList();
            List <Model_JFR4> rule4G3 = rule4.Where(o => o.Cat == 3).ToList();
            List <Model_JFR4> rule4G4 = rule4.Where(o => o.Cat == 4).ToList();

            Model_JFR4 r5row1 = rule4G1.Where(o => o.RuleID == 1).FirstOrDefault();
            Model_JFR4 r5row2 = rule4G1.Where(o => o.RuleID == 2).FirstOrDefault();



            TextBox5_1.Text = r5row1.Condition1;
            TextBox5_2.Text = r5row1.Score.ToString();

            TextBox5_11.Text = r5row2.Condition1;
            TextBox5_12.Text = r5row2.Score.ToString();

            Model_JFR4 r6row1 = rule4G2.Where(o => o.RuleID == 4).FirstOrDefault();
            Model_JFR4 r6row2 = rule4G2.Where(o => o.RuleID == 5).FirstOrDefault();
            Model_JFR4 r6row3 = rule4G2.Where(o => o.RuleID == 6).FirstOrDefault();



            TextBox6_1.Text = r6row1.Condition1;
            TextBox6_2.Text = r6row1.Score.ToString();

            TextBox6_11.Text = r6row2.Condition1;
            TextBox6_12.Text = r6row2.Score.ToString();

            TextBox6_111.Text = r6row3.Condition1;
            TextBox6_112.Text = r6row3.Score.ToString();



            Model_JFR4 r7row1 = rule4G3.Where(o => o.RuleID == 7).FirstOrDefault();
            Model_JFR4 r7row2 = rule4G3.Where(o => o.RuleID == 8).FirstOrDefault();
            Model_JFR4 r7row3 = rule4G3.Where(o => o.RuleID == 9).FirstOrDefault();

            TextBox7_1.Text = r7row1.Condition1;
            TextBox7_2.Text = r7row1.Score.ToString();

            TextBox7_11.Text = r7row2.Condition1;
            TextBox7_12.Text = r7row2.Score.ToString();

            TextBox7_111.Text = r7row3.Condition1;
            TextBox7_112.Text = r7row3.Score.ToString();


            Model_JFR4 r8row1 = rule4G4.Where(o => o.RuleID == 10).FirstOrDefault();
            Model_JFR4 r8row2 = rule4G4.Where(o => o.RuleID == 11).FirstOrDefault();
            Model_JFR4 r8row3 = rule4G4.Where(o => o.RuleID == 12).FirstOrDefault();

            TextBox8_1.Text = r8row1.Condition1;
            TextBox8_2.Text = r8row1.Score.ToString();

            TextBox8_11.Text = r8row2.Condition1;
            TextBox8_12.Text = r8row2.Score.ToString();

            TextBox8_111.Text = r8row3.Condition1;
            TextBox8_112.Text = r8row3.Score.ToString();
        }

        if (!string.IsNullOrEmpty(Request.QueryString["tab"]))
        {
            string tab = Request.QueryString["tab"];

            switch (tab)
            {
            case "2":
                tab1.Attributes.Add("aria-expanded", "false");
                tab2.Attributes.Add("aria-expanded", "true");
                tab3.Attributes.Add("aria-expanded", "false");
                tab4.Attributes.Add("aria-expanded", "false");

                li_tab1.Attributes.Remove("class");
                li_tab2.Attributes.Add("class", "active");
                li_tab3.Attributes.Remove("class");
                li_tab4.Attributes.Remove("class");

                tab_content1.Visible = false;
                tab_content2.Visible = true;
                tab_content3.Visible = false;
                tab_content4.Visible = false;

                break;

            case "3":
                tab1.Attributes.Add("aria-expanded", "false");
                tab2.Attributes.Add("aria-expanded", "false");
                tab3.Attributes.Add("aria-expanded", "true");
                tab4.Attributes.Add("aria-expanded", "false");

                li_tab1.Attributes.Remove("class");
                li_tab3.Attributes.Add("class", "active");
                li_tab2.Attributes.Remove("class");
                li_tab4.Attributes.Remove("class");

                tab_content1.Visible = false;
                tab_content2.Visible = false;
                tab_content3.Visible = true;
                tab_content4.Visible = false;

                break;

            case "4":
                tab1.Attributes.Add("aria-expanded", "false");
                tab2.Attributes.Add("aria-expanded", "false");
                tab3.Attributes.Add("aria-expanded", "false");
                tab4.Attributes.Add("aria-expanded", "true");

                li_tab1.Attributes.Remove("class");
                li_tab4.Attributes.Add("class", "active");
                li_tab3.Attributes.Remove("class");
                li_tab2.Attributes.Remove("class");

                tab_content1.Visible = false;
                tab_content2.Visible = false;
                tab_content3.Visible = false;
                tab_content4.Visible = true;

                break;
            }
        }
        else
        {
            tab_content1.Visible = true;
            tab_content2.Visible = false;
            tab_content3.Visible = false;
            tab_content4.Visible = false;

            tab1.Attributes.Add("aria-expanded", "true");
            tab2.Attributes.Add("aria-expanded", "false");
            tab3.Attributes.Add("aria-expanded", "false");
            tab4.Attributes.Add("aria-expanded", "false");

            li_tab1.Attributes.Add("class", "active");
            li_tab2.Attributes.Remove("class");

            li_tab3.Attributes.Remove("class");
            li_tab4.Attributes.Remove("class");
        }
    }