Esempio n. 1
0
        private void barButtonItem13_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FrmFX    ff = new FrmFX();
            Ps_Power ps = this.ctrlPs_Substation_As1.FocusedObject;

            if (ps == null)
            {
                return;
            }

            double bfzl = 0;

            try { bfzl = Convert.ToDouble(ps.Col5); }
            catch { }

            double xfzl = 0;

            try { xfzl = Convert.ToDouble(ps.Col8); }
            catch { }

            if (bfzl >= 1)
            {
                ff.S1 = "音諾怎";
            }
            else
            {
                ff.S1 = "諾怎";
            }
            ff.S3 = ps.Col7 + "定坪";

            if (xfzl >= 1)
            {
                ff.S2 = "音諾怎";
            }
            else
            {
                ff.S2 = "諾怎";
            }


            object obj1 = ps.GetType().GetProperty("n" + (year + 1)).GetValue(ps, null);
            object obj2 = ps.GetType().GetProperty("n" + (year + 2)).GetValue(ps, null);
            object obj3 = ps.GetType().GetProperty("n" + (year + 3)).GetValue(ps, null);
            object obj4 = ps.GetType().GetProperty("n" + (year + 4)).GetValue(ps, null);
            object obj5 = ps.GetType().GetProperty("n" + (year + 5)).GetValue(ps, null);

            double ob1 = 0;
            double ob2 = 0;
            double ob3 = 0;
            double ob4 = 0;
            double ob5 = 0;

            if (obj1 != null)
            {
                ob1 = Convert.ToDouble(obj1);
            }
            if (obj2 != null)
            {
                ob2 = Convert.ToDouble(obj2);
            }
            if (obj3 != null)
            {
                ob3 = Convert.ToDouble(obj3);
            }
            if (obj4 != null)
            {
                ob4 = Convert.ToDouble(obj4);
            }
            if (obj5 != null)
            {
                ob5 = Convert.ToDouble(obj5);
            }
            ff.S4 = "5定坪";
            if (ob5 < 0)
            {
                ff.S4 = "5定坪";
            }
            if (ob4 < 0)
            {
                ff.S4 = "4定坪";
            }
            if (ob3 < 0)
            {
                ff.S4 = "3定坪";
            }
            if (ob2 < 0)
            {
                ff.S4 = "2定坪";
            }
            if (ob1 < 0)
            {
                ff.S4 = "1定坪";
            }

            ff.ShowDialog();
        }
Esempio n. 2
0
        private void barButtonItem13_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            FrmFX ff = new FrmFX();
            Ps_Power ps = this.ctrlPs_Substation_As1.FocusedObject;
            if (ps == null)
                return;

            double bfzl = 0;
            try { bfzl = Convert.ToDouble(ps.Col5); }
            catch { }

            double xfzl = 0;
            try { xfzl = Convert.ToDouble(ps.Col8); }
            catch { }

            if (bfzl >= 1)
                ff.S1 = "������";
            else
                ff.S1 = "����";
            ff.S3 = ps.Col7 + "����";

            if (xfzl >= 1)
                ff.S2 = "������";
            else
                ff.S2 = "����";

            object obj1 = ps.GetType().GetProperty("n" + (year + 1)).GetValue(ps, null);
            object obj2 = ps.GetType().GetProperty("n" + (year + 2)).GetValue(ps, null);
            object obj3 = ps.GetType().GetProperty("n" + (year + 3)).GetValue(ps, null);
            object obj4 = ps.GetType().GetProperty("n" + (year + 4)).GetValue(ps, null);
            object obj5 = ps.GetType().GetProperty("n" + (year + 5)).GetValue(ps, null);

            double ob1 = 0;
            double ob2 = 0;
            double ob3 = 0;
            double ob4 = 0;
            double ob5 = 0;

            if (obj1 != null)
            {
                ob1 = Convert.ToDouble(obj1);
            }
            if (obj2 != null)
            {
                ob2 = Convert.ToDouble(obj2);
            }
            if (obj3 != null)
            {
                ob3 = Convert.ToDouble(obj3);
            }
            if (obj4 != null)
            {
                ob4 = Convert.ToDouble(obj4);
            }
            if (obj5 != null)
            {
                ob5 = Convert.ToDouble(obj5);
            }
            ff.S4 = "5����";
            if(ob5<0)
                ff.S4 = "5����";
            if (ob4 < 0)
                ff.S4 = "4����";
            if (ob3 < 0)
                ff.S4 = "3����";
            if (ob2 < 0)
                ff.S4 = "2����";
            if (ob1 < 0)
                ff.S4 = "1����";

            ff.ShowDialog();
        }