예제 #1
0
        private void simpleButton4_Click(object sender, EventArgs e)
        {
            double         rl  = 0;
            int            bts = 0;
            FrmAttachtable frm = new FrmAttachtable();

            frm.Type        = "0";
            frm.ParentID    = DeviceMx.UID;
            frm.StartYear   = DeviceMx.S29;
            frm.EndYear     = DeviceMx.S30;
            frm.RelateTable = "PSP_PowerSubstation_Info";
            if (frm.ShowDialog() == DialogResult.OK)
            {
                DataTable dt = frm.datatable;
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (dt.Rows[i]["S2"].ToString() == "新建" || dt.Rows[i]["S2"].ToString() == "扩容" || dt.Rows[i]["S2"].ToString() == "投产")
                        {
                            if (!string.IsNullOrEmpty(DeviceMx.S29) && !string.IsNullOrEmpty(DeviceMx.S30))
                            {
                                if (Convert.ToInt32(dt.Rows[i]["startYear"]) >= Convert.ToInt32(DeviceMx.S29) && Convert.ToInt32(dt.Rows[i]["startYear"]) <= Convert.ToInt32(DeviceMx.S30))
                                {
                                    rl += Convert.ToDouble(dt.Rows[i]["ZHI"]);
                                    bts++;
                                }
                            }
                            else
                            {
                                rl += Convert.ToDouble(dt.Rows[i]["ZHI"]);
                                bts++;
                            }
                        }
                    }
                }
                if (rl != 0)
                {
                    spinEdit2.Value = (decimal)rl;
                }
            }
        }
예제 #2
0
        private void simpleButton4_Click(object sender, EventArgs e)
        {
            double rl = 0;
            int bts = 0;
            FrmAttachtable frm = new FrmAttachtable();
            frm.Type = "1";
            frm.ParentID = bdz.UID;
            frm.StartYear = bdz.L28;
            frm.EndYear = bdz.L29;
            frm.RelateTable = "PSP_Substation_Info";
            if (frm.ShowDialog()==DialogResult.OK)
            {
                DataTable dt = frm.datatable;
                if (dt.Rows.Count>0)
                {
                    for (int i = 0; i < dt.Rows.Count;i++ )
                    {
                        if (dt.Rows[i]["S2"].ToString() == "�½�" || dt.Rows[i]["S2"].ToString() == "����" || dt.Rows[i]["S2"].ToString() == "Ͷ��")
                        {
                            if (!string.IsNullOrEmpty(bdz.L28) && !string.IsNullOrEmpty(bdz.L29))
                            {
                                if (Convert.ToInt32(dt.Rows[i]["startYear"]) >= Convert.ToInt32(bdz.L28) && Convert.ToInt32(dt.Rows[i]["startYear"]) <= Convert.ToInt32(bdz.L29))
                                {
                                    rl += Convert.ToDouble(dt.Rows[i]["ZHI"]);
                                    bts++;
                                }
                            }
                            else
                            {
                                rl += Convert.ToDouble(dt.Rows[i]["ZHI"]);
                                bts++;
                            }

                        }
                    }

                }
               spinEdit2.Value=(decimal)rl;
              spinEdit4.Value =(decimal)bts;
            }
        }