Пример #1
0
        public IList<PW_tb3a> SumList(IList<PW_tb3a> _list)
        {
            IList<PW_tb3a> l = _list;
            if (_list.Count > 0)
            {
                PW_tb3a sum = new PW_tb3a();
                sum.PQName = "�ϼ�";
                for (int i = 0; i < _list.Count; i++)
                {
                    sum.Num1 = sum.Num1 + _list[i].Num1;
                    sum.Num2 = sum.Num2 + _list[i].Num2;
                    sum.Num3 = sum.Num3 + _list[i].Num3;
                    sum.Num4 = sum.Num4 + _list[i].Num4;
                    sum.Num5 = sum.Num5 + _list[i].Num5;
                    sum.Num6 = sum.Num6 + _list[i].Num6;
                    sum.Num7 = sum.Num7 + _list[i].Num7;
                    sum.Num8 = sum.Num8 + _list[i].Num8;
                    sum.FZL = sum.FZL + _list[i].FZL;
                    sum.KBS = sum.KBS + _list[i].KBS;
                    sum.KG = sum.KG + _list[i].KG;
                    sum.LineLength = sum.LineLength + _list[i].LineLength;
                    sum.MaxFH = sum.MaxFH + _list[i].MaxFH;
                    sum.SafeFH = sum.SafeFH + _list[i].SafeFH;
                    sum.WG1 = sum.WG1 + _list[i].WG1;
                    sum.WG2 = sum.WG2 + _list[i].WG2;

                }
                l.Add(sum);
            }
            return l;
        }
Пример #2
0
 public void loadData(string col1,string col2)
 {
     PW_tb3a p = new PW_tb3a();
     p.col1 = col1;
     p.col2 = col2;
     p.col3 = Itop.Client.MIS.ProgUID;
     IList<PW_tb3a> list = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy324", p);
     this.gridControl.DataSource = list;
 }
Пример #3
0
        public IList<PW_tb3a> GetList(IList<PW_tb3a> list)
        {
            IList<PW_tb3a> list2 = new List<PW_tb3a>();
            for (int i = 0; i < list.Count;i++ )
            {
                decimal num = 0;
                PW_tb3a a = list[i];
                if (a.LLXMC != "")
                {
                    string[] str = a.LLXMC.Split(",".ToCharArray());
                    for (int j = 0; j < str.Length;j++ )
                    {
                        if(str[j]!=""){
                            PW_tb3a pp = new PW_tb3a();
                            pp.LineName = str[j];
                            pp.col2 = Itop.Client.MIS.ProgUID;
                            pp = (PW_tb3a)Services.BaseService.GetObject("SelectPW_tb3aByLineName", pp);
                            if(pp!=null){
                                num = num + (pp.SafeFH - pp.MaxFH);
                            }
                        }
                    }
                }
                if (num > a.MaxFH)
                {
                    a.Num1 = a.MaxFH;
                }
                else
                {
                    a.Num1 = num;
                }

                a.col1 = Convert.ToDecimal(a.Num1 / a.MaxFH*100).ToString("##.##")+"%";
                if (a.Num1 / a.MaxFH * 100 < 100)
                {
                    a.col2 = "��";
                }
                else
                {
                    a.col2 = "��";
                }
                list2.Add(a);
            }
            return list2;
        }
Пример #4
0
 private void FrmLineSel_Load(object sender, EventArgs e)
 {
     PW_tb3a p = new PW_tb3a();
     p.col2= Itop.Client.MIS.ProgUID;
     IList<PW_tb3a> list = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aListName", p);
     ArrayList alist=new ArrayList();
     for (int i = 0; i < list.Count;i++ )
     {
         if (!alist.Contains(list[i].LineName) && list[i].LineName!=selfName)
         {
             alist.Add(list[i].LineName);
         }
     }
     for (int j = 0; j < alist.Count; j++)
     {
         checkedListBox1.Items.Add(alist[j].ToString());
     }
 }
Пример #5
0
        public IList<PW_tb3a> SumList(IList<PW_tb3a> _list)
        {
            IList<PW_tb3a> l = new List<PW_tb3a>();
            if (_list.Count > 0)
            {
                PW_tb3a sum = new PW_tb3a();
                sum.PQName = "�ϼ�";
                for (int i = 0; i < _list.Count; i++)
                {
                    PW_tb3a p = _list[i];
                    p.Num6 = p.Num6 / 10000;
                    p.Num8 = p.Num8 / 10000;
                    // p.MaxFH = p.MaxFH / 10000;
                    //p.SafeFH = p.SafeFH / 10000;

                    sum.Num1 = sum.Num1 + p.Num1;
                    sum.Num2 = sum.Num2 + p.Num2;
                    sum.Num3 = sum.Num3 + p.Num3;
                    sum.Num4 = sum.Num4 + p.Num4;
                    sum.Num5 = sum.Num5 + p.Num5;
                    sum.Num6 = sum.Num6 + p.Num6;
                    sum.Num7 = sum.Num7 + p.Num7;
                    sum.Num8 = sum.Num8 + p.Num8;
                    sum.FZL = sum.FZL + p.FZL;
                    sum.KBS = sum.KBS + p.KBS;
                    sum.KG = sum.KG + p.KG;
                    sum.LineLength = sum.LineLength + p.LineLength;
                    sum.MaxFH = sum.MaxFH + p.MaxFH;
                    sum.SafeFH = sum.SafeFH + p.SafeFH;
                    sum.WG1 = sum.WG1 + p.WG1;
                    sum.WG2 = sum.WG2 + p.WG2;

                    l.Add(p);
                }
                l.Add(sum);
            }
            return l;
        }
Пример #6
0
        //此处为动态添加数据方法
        private void Sheet_AddData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            int    startrow  = 3;
            int    addnum    = 0;
            int    itemcount = 0;
            int    firstrow  = 0;
            string rowsum    = "";
            string rowsum2   = "";

            Itop.Domain.PWTable.PW_tb3a p = new Itop.Domain.PWTable.PW_tb3a();
            p.col2 = Itop.Client.MIS.ProgUID;
            IList <PW_tb3a> list = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aBy2254", p);

            bool sheetEnd = false;

            for (int i = 0; i < list.Count; i++)
            {
                PW_tb3a obj  = list[i];
                PW_tb3a obj2 = new PW_tb3a();
                if (i < list.Count - 1)
                {
                    obj2 = list[i + 1];
                }
                else
                {
                    sheetEnd = true;
                }
                decimal _sum = obj.Num1 + obj.Num2 + obj.Num3 + obj.Num4 + obj.Num5 + obj.Num6 + obj.Num7 + obj.Num8;
                itemcount          = itemcount + 1;
                obj_sheet.RowCount = obj_sheet.RowCount + 1;
                obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                obj_sheet.SetValue(i + addnum + startrow, 1, "线路回数(回)");
                obj_sheet.SetValue(i + addnum + startrow, 2, obj.Num1);
                obj_sheet.SetValue(i + addnum + startrow, 3, obj.Num2);
                obj_sheet.SetValue(i + addnum + startrow, 4, obj.Num3);
                obj_sheet.SetValue(i + addnum + startrow, 5, obj.Num4);
                obj_sheet.SetValue(i + addnum + startrow, 6, obj.Num5);
                obj_sheet.SetValue(i + addnum + startrow, 7, obj.Num6);
                obj_sheet.SetValue(i + addnum + startrow, 8, obj.Num7);
                obj_sheet.SetValue(i + addnum + startrow, 9, obj.Num8);
                obj_sheet.SetValue(i + addnum + startrow, 10, _sum);

                itemcount          = itemcount + 1;
                addnum             = addnum + 1;
                obj_sheet.RowCount = obj_sheet.RowCount + 1;
                obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                obj_sheet.SetValue(i + addnum + startrow, 1, "所占比例(%)");
                if (_sum == 0)
                {
                    obj_sheet.SetValue(i + addnum + startrow, 2, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 3, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 4, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 5, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 6, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 7, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 8, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 9, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 10, "0");
                }
                else
                {
                    obj_sheet.SetValue(i + addnum + startrow, 2, Convert.ToDecimal((obj.Num1 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 3, Convert.ToDecimal((obj.Num2 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 4, Convert.ToDecimal((obj.Num3 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 5, Convert.ToDecimal((obj.Num4 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 6, Convert.ToDecimal((obj.Num5 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 7, Convert.ToDecimal((obj.Num6 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 8, Convert.ToDecimal((obj.Num7 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 9, Convert.ToDecimal((obj.Num8 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 10, "100");
                }
                obj_sheet.AddSpanCell(i + addnum + startrow - 1, 0, 2, 1);

                rowsum  = rowsum + Convert.ToString(startrow - 2 + 2 * (i + 1)) + ",";
                rowsum2 = rowsum2 + Convert.ToString(startrow - 1 + 2 * (i + 1)) + ",";
                if (sheetEnd)
                {
                    addnum             = addnum + 1;
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, "全市合计");
                    obj_sheet.SetValue(i + addnum + startrow, 1, "线路回数(回)");
                    TC.Sheet_WriteFormula_RowSum3(obj_sheet, TC.getRowList(rowsum), 2, i + addnum + startrow, 2, 9);
                    addnum             = addnum + 1;
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, "全市合计");
                    obj_sheet.SetValue(i + addnum + startrow, 1, "所占比例(%)");
                    //TC.Sheet_WriteFormula_TwoCol_Percent(obj_sheet, i + addnum + startrow - 1, 2, 7, 1, i + addnum + startrow, 2);
                    obj_sheet.SetValue(i + addnum + startrow, 10, "100");
                    obj_sheet.AddSpanCell(i + addnum + startrow - 1, 0, 2, 1);
                }
            }
        }
Пример #7
0
        //此处为动态添加数据方法
        private void Sheet_AddData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            int       startrow  = 3;
            int       addnum    = 0;
            int       itemcount = 0;
            int       firstrow  = 0;
            ArrayList rowsum    = new ArrayList();

            Itop.Domain.PWTable.PW_tb3a p = new Itop.Domain.PWTable.PW_tb3a();
            p.col2 = Itop.Client.MIS.ProgUID;
            IList <PW_tb3a> list = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aBy2251", p);

            PW_tb3c p3 = new PW_tb3c();

            p3.col4 = Itop.Client.MIS.ProgUID;
            IList <PW_tb3c> plist = Services.BaseService.GetList <PW_tb3c>("SelectPW_tb3cList", p3);
            IList <PW_tb3a> alist = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aListDIS", p);

            for (int n = 0; n < plist.Count; n++)
            {
                rowsum.Add("");
            }
            bool sheetEnd = false;

            for (int i = 0; i < list.Count; i++)
            {
                PW_tb3a obj  = list[i];
                PW_tb3a obj2 = new PW_tb3a();
                if (i < list.Count - 1)
                {
                    obj2 = list[i + 1];
                }
                else
                {
                    sheetEnd = true;
                }
                itemcount          = itemcount + 1;
                obj_sheet.RowCount = obj_sheet.RowCount + 1;
                obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                obj_sheet.SetValue(i + addnum + startrow, 1, obj.PQtype);
                obj_sheet.SetValue(i + addnum + startrow, 2, obj.Num10);
                obj_sheet.SetValue(i + addnum + startrow, 3, obj.Num3);
                obj_sheet.SetValue(i + addnum + startrow, 4, obj.Num2);
                obj_sheet.SetValue(i + addnum + startrow, 5, obj.Num4);
                obj_sheet.SetValue(i + addnum + startrow, 6, obj.KggNum);
                obj_sheet.SetValue(i + addnum + startrow, 7, obj.KG);
                obj_sheet.SetValue(i + addnum + startrow, 8, obj.KgzHwNum);
                obj_sheet.SetValue(i + addnum + startrow, 9, obj.Num11);
                // obj_sheet.SetValue(i + 3, 10, 1);
                if (obj.PQName != obj2.PQName)
                {
                    addnum = addnum + 1;
                    for (int x = 0; x < rowsum.Count; x++)
                    {
                        string str = (string)rowsum[x];
                        str       = str + Convert.ToString(i + addnum + startrow - x - 1) + ",";
                        rowsum[x] = str;
                    }

                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                    obj_sheet.SetValue(i + addnum + startrow, 1, "小计");
                    int num1 = startrow + addnum + firstrow;
                    if (firstrow == 0)
                    {
                        num1 = num1 - 1;
                    }
                    TC.Sheet_WriteFormula_RowSum(obj_sheet, num1, 2, itemcount, 1, i + addnum + startrow, 2, 8);
                    obj_sheet.AddSpanCell(num1, 0, itemcount + 1, 1);
                    firstrow  = i;
                    startrow  = 3;
                    itemcount = 0;
                }
                if (sheetEnd)
                {
                    int[] sum = new int[plist.Count];
                    rowsum.Reverse();
                    for (int m = 0; m < plist.Count; m++)
                    {
                        PW_tb3c _p = plist[m];
                        addnum             = addnum + 1;
                        obj_sheet.RowCount = obj_sheet.RowCount + 1;
                        obj_sheet.SetValue(i + addnum + startrow, 0, "全市合计");
                        obj_sheet.SetValue(i + addnum + startrow, 1, _p.col1);
                        sum[m] = i + addnum + startrow;
                        int num1 = startrow + addnum + firstrow;
                        //if (firstrow == 0) { num1 = num1 - 1; }
                        TC.Sheet_WriteFormula_RowSum3(obj_sheet, TC.getRowList(rowsum[m].ToString()), 2, i + addnum + startrow, 2, 8);
                    }
                    addnum             = addnum + 1;
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, "全市合计");
                    obj_sheet.SetValue(i + addnum + startrow, 1, "总计");
                    TC.Sheet_WriteFormula_RowSum3(obj_sheet, sum, 2, i + addnum + startrow, 2, 8);
                    obj_sheet.AddSpanCell(sum[0], 0, sum.Length + 1, 1);
                }
            }
        }
Пример #8
0
        private void FrmProject_Sum_Load(object sender, EventArgs e)
        {
            //this.gridBand7.Columns.Add(this.bandedGridColumn7);

            InitRight();
            try
            {
                PW_tb3a p = new PW_tb3a();
                p.col1 = "'����'";
                p.col2 = Itop.Client.MIS.ProgUID;
                IList<PW_tb3a> list = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy341", p);
                this.gridControl.DataSource =GetList( list);
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message);
            }
        }
Пример #9
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     string str = "";
     if(comboBox1.Text=="����"){
         str = "'����'";
     }
     if (comboBox1.Text == "ר��")
     {
         str = "'ר��'";
     }
     if (comboBox1.Text == "ȫ��")
     {
         str = "'����','ר��'";
     }
     try
     {
         PW_tb3a p = new PW_tb3a();
         p.col1 = str;
         p.col2 = Itop.Client.MIS.ProgUID;
         IList<PW_tb3a> list = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy341", p);
         this.gridControl.DataSource =GetList( list);
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }
Пример #10
0
        public IList<PW_tb3a> GetList(IList<PW_tb3a> list)
        {
            IList<PW_tb3a> list2 = new List<PW_tb3a>();
            for (int i = 0; i < list.Count; i++)
            {
                decimal nump = 0;
                PW_tb3a a = list[i];
                if (a.PQName != "")
                {

                    if (a.PQName.Contains("+") || a.PQName.Contains("��"))
                    {
                        a.PQName = a.PQName.Replace("��", "+");
                        string[] str = a.PQName.Split("+".ToCharArray());
                        for (int k = 0; k < str.Length; k++)
                        {
                            str[k] = str[k].Replace("��", "*");
                        }
                        decimal[] num = new decimal[str.Length];
                        for (int n = 0; n < num.Length; n++)
                        {
                            num[n] = Convert.ToDecimal(new DataTable().Compute(str[n], null));
                        }
                        if (num[0] > num[1])
                        {
                            a.Num4 =Convert.ToDecimal( Convert.ToDouble( num[1]) * 1.235);
                        }
                        else
                        {
                            a.Num4 =Convert.ToDecimal( Convert.ToDouble(num[0]) * 1.235);
                        }
                    }
                    if (a.PQName.Contains("��"))
                    {
                        string[] str = a.PQName.Split("��".ToCharArray());
                        decimal[] num = new decimal[str.Length];
                        for (int n = 0; n < num.Length; n++)
                        {
                            num[n] = Convert.ToDecimal(new DataTable().Compute(str[n], null));
                        }
                        if (num[0] == 1)
                        {
                            a.Num4 = 0;
                        }
                        else
                        {
                            a.Num4 = Convert.ToDecimal(Convert.ToDouble(num[1]) * 1.235);
                        }
                    }
                    else
                    {
                        a.Num4 = 0;
                    }

                }
                else
                {
                    a.Num4 = 0;
                }
                ///////////////////////////////////////////////////////////////
                if (a.LLXMC.Trim() != "")
                {
                    string[] str = a.LLXMC.Split(",".ToCharArray());
                    for (int j = 0; j < str.Length; j++)
                    {
                        if (str[j] != "")
                        {
                            PW_tb3a pp = new PW_tb3a();
                            pp.LineName = str[j];
                            pp.col2 = Itop.Client.MIS.ProgUID;
                            pp = (PW_tb3a)Services.BaseService.GetObject("SelectPW_tb3aByLineName", pp);
                            nump = nump + (pp.SafeFH - pp.MaxFH);
                        }
                    }
                }
                if (nump > a.MaxFH)
                {
                    a.Num6 = a.MaxFH;
                }
                else
                {
                    a.Num6 = nump;
                }

                //if (a.Num3 == 0)
                //{
                //    a.col1 = "0";
                //}
                //else
                //{
                //    a.col1 = Convert.ToDecimal((a.Num3-(a.Num4 + a.Num6)) / a.Num3 * 100).ToString("##.##") + "%";
                //}

                //if (a.Num4 + a.Num6 > a.Num3)
                //{
                //    a.col2 = "��";
                //    a.col1 = "0";
                //}
                //else
                //{
                //    if ((a.Num4 + a.Num6) / a.Num3 * 100 < 100)
                //    {
                //        a.col2 = "��";
                //    }
                //    else
                //    {
                //        a.col2 = "��";
                //    }
                //}
                list2.Add(a);
            }
            /////////////////////////////
            IList<PW_tb3a> list3 = new List<PW_tb3a>();
            if (list2.Count > 0)
            {
                PW_tb3a pp = list[0];
                for (int i = 1; i < list2.Count; i++)
                {
                    PW_tb3a pp2 = list2[i];
                    if (pp2.SubName == pp.SubName)
                    {
                        pp.Num6 = pp.Num6  + pp2.Num6;
                    }
                    else
                    {
                        list3.Add(pp);
                        pp = list2[i];
                    }
                }
                list3.Add(pp);
            }
            for (int n = 0; n < list3.Count; n++)
            {
                PW_tb3a a = list3[n];
                if (a.Num3 == 0)
                {
                    a.col1 = "0";
                }
                else
                {
                    a.col1 = Convert.ToDecimal((a.Num3 - (a.Num4 + a.Num6)) / a.Num3 * 100).ToString("##.##") + "%";
                }

                if (a.Num4 + a.Num6 > a.Num3)
                {
                    a.col2 = "��";
                    a.col1 = "0";
                }
                else
                {
                    if ((a.Num4 + a.Num6) / a.Num3 * 100 < 100)
                    {
                        a.col2 = "��";
                    }
                    else
                    {
                        a.col2 = "��";
                    }
                }
            }

            return list3;
        }
Пример #11
0
        //此处为动态添加数据方法
        private void Sheet_AddData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            int       startrow  = 2;
            int       addnum    = 0;
            int       itemcount = 0;
            int       firstrow  = 0;
            ArrayList rowsum    = new ArrayList();

            Itop.Domain.PWTable.PW_tb3a p = new Itop.Domain.PWTable.PW_tb3a();
            p.col2 = Itop.Client.MIS.ProgUID;
            IList <PW_tb3a> alist = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aListDIS", p);

            for (int n = 0; n < alist.Count; n++)
            {
                for (int m = 0; m < 8; m++)
                {
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                }

                obj_sheet.AddSpanCell(2, 0, 8, 1);
                obj_sheet.SetValue(2, 0, "XX区(县)");

                //2列标题内容
                obj_sheet.AddSpanCell(startrow + n * 8, 1, 6, 1);
                obj_sheet.SetValue(startrow + n * 8, 1, "典型接线(回)");
                obj_sheet.AddSpanCell(startrow + (n + 1) * 8 - 1, 1, 1, 2);
                obj_sheet.SetValue(startrow + (n + 1) * 8 - 1, 1, "辐射型");
                obj_sheet.AddSpanCell(startrow + (n + 1) * 8, 1, 1, 2);
                obj_sheet.SetValue(startrow + (n + 1) * 8, 1, "其他非典型接线(回)");

                //3列标题内容
                obj_sheet.SetValue(startrow + n * 8, 2, "两供一备");
                obj_sheet.SetValue(startrow + n * 8 + 1, 2, "三供一备");
                obj_sheet.SetValue(startrow + n * 8 + 2, 2, "单环网");
                obj_sheet.SetValue(startrow + n * 8 + 3, 2, "双环网");
                obj_sheet.SetValue(startrow + n * 8 + 4, 2, "多分段两联络");
                obj_sheet.SetValue(startrow + n * 8 + 5, 2, "多分段三联络");

                PW_tb3a _tba = alist[n];
                p.PQName = _tba.PQName;
                p.JXMS   = "两供一备";
                IList <PW_tb3a> list1 = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "三供一备";
                IList <PW_tb3a> list2 = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "单环网";
                IList <PW_tb3a> list3 = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "双环网";
                IList <PW_tb3a> list4 = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "多分段两联络";
                IList <PW_tb3a> list5 = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "多分段三联络";
                IList <PW_tb3a> list6 = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "辐射型";
                IList <PW_tb3a> list7 = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "其他非典型接线";
                IList <PW_tb3a> list8 = Services.BaseService.GetList <PW_tb3a>("SelectPW_tb3aBy2255", p);
                if (list1.Count > 0)
                {
                    PW_tb3a obj = list1[0];
                    obj_sheet.SetValue(n + startrow + n * 7, 0, obj.PQName);
                    obj_sheet.SetValue(n + startrow + n * 7, 3, obj.Num1);
                    obj_sheet.SetValue(n + startrow + n * 7, 4, obj.Num2);
                    obj_sheet.SetValue(n + startrow + n * 7, 5, obj.Num3);
                    obj_sheet.SetValue(n + startrow + n * 7, 6, obj.Num4);
                    obj_sheet.SetValue(n + startrow + n * 7, 7, obj.Num5);
                    obj_sheet.SetValue(n + startrow + n * 7, 8, obj.Num6);
                    obj_sheet.SetValue(n + startrow + n * 7, 9, obj.Num7);
                    obj_sheet.SetValue(n + startrow + n * 7, 10, obj.Num8);
                }
                else
                {
                    TC.Sheet_WriteZero(obj_sheet, n + startrow + n * 7, 3, 1, 8);
                }
            }
        }
Пример #12
0
 private void FrmProject_Sum_Load(object sender, EventArgs e)
 {
     InitRight();
     this.gridBand40.Columns.Add(this.bandedGridColumn6);
     this.gridBand41.Columns.Add(this.bandedGridColumn7);
     this.gridBand42.Columns.Add(this.bandedGridColumn8);
     this.gridBand43.Columns.Add(this.bandedGridColumn9);
     this.gridBand44.Columns.Add(this.bandedGridColumn10);
     this.gridBand45.Columns.Add(this.bandedGridColumn11);
     this.gridBand46.Columns.Add(this.bandedGridColumn12);
     this.gridBand47.Columns.Add(this.bandedGridColumn13);
     this.gridBand48.Columns.Add(this.bandedGridColumn14);
     this.gridBand50.Columns.Add(this.bandedGridColumn17);
     try
     {
         PW_tb3a p = new PW_tb3a();
         p.col1 = "'����'";
         p.col2 = Itop.Client.MIS.ProgUID;
         IList<PW_tb3a> list = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy332", p);
         this.gridControl.DataSource = GetList(list);
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }
Пример #13
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     string str = "";
     if(comboBox1.Text=="����"){
         str = "'����'";
     }
     if (comboBox1.Text == "ר��")
     {
         str = "'ר��'";
     }
     if (comboBox1.Text == "ȫ��")
     {
         str = "'����','ר��'";
     }
     try
     {
         PW_tb3a p = new PW_tb3a();
         p.col1 = str;
         p.col2 = Itop.Client.MIS.ProgUID;
         IList<PW_tb3a> list = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy327", p);
         IList<PW_tb3a> list2 = new List<PW_tb3a>();
         if (list.Count > 0)
         {
             PW_tb3a pp = list[0];
             for (int i = 1; i < list.Count; i++)
             {
                 PW_tb3a pp2 = list[i];
                 if (pp2.LineName == pp.LineName)
                 {
                     pp.LineType = pp.LineType + "," + pp2.LineType;
                 }
                 else
                 {
                     list2.Add(pp);
                     pp = list[i];
                 }
             }
             list2.Add(pp);
         }
         this.gridControl.DataSource = list2;
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }
Пример #14
0
        private void FrmProject_Sum_Load(object sender, EventArgs e)
        {
            InitRight();
            //this.gridBand7.Columns.Add(this.bandedGridColumn7);

            try
            {
                PW_tb3a p = new PW_tb3a();
                p.col1 = "'����'";
                p.col2 = Itop.Client.MIS.ProgUID;
                IList<PW_tb3a> list = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy327", p);
                IList<PW_tb3a> list2 = new List<PW_tb3a>();
                if (list.Count > 0)
                {
                    PW_tb3a pp = list[0];
                    for (int i = 1; i < list.Count; i++)
                    {
                        PW_tb3a pp2 = list[i];
                        if (pp2.LineName == pp.LineName)
                        {
                            pp.LineType = pp.LineType + "," + pp2.LineType;
                        }
                        else
                        {
                            list2.Add(pp);
                            pp = list[i];
                        }
                    }
                    list2.Add(pp);
                }
                this.gridControl.DataSource = list2;
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message);
            }
        }
Пример #15
0
        private void InsertInfo()
        {
            string columnname = "";

            try
            {
                DataTable dts = new DataTable();
                OpenFileDialog op = new OpenFileDialog();
                op.Filter = "Excel�ļ�(*.xls)|*.xls";
                if (op.ShowDialog() == DialogResult.OK)
                {
                    dts = GetExcel(op.FileName);
                    IList<PW_tb3a> lii = new List<PW_tb3a>();
                    DateTime s8 = DateTime.Now;
                    for (int i = 0; i < dts.Rows.Count; i++)
                    {

                        PW_tb3a l1 = new PW_tb3a();
                        foreach (DataColumn dc in dts.Columns)
                        {
                            columnname = dc.ColumnName;
                            //if (dts.Rows[i][dc.ColumnName].ToString() == "")
                            //    continue;

                            switch (dc.ColumnName)
                            {

                                case "LineLength":
                                case "Num1":
                                case "Num2":
                                case "Num3":
                                case "Num4":
                                case "Num6":
                                case "Num8":
                                case "MaxFH":
                                case "SafeFH":
                                case "WG1":
                                case "WG2":
                                case "FZL":
                                    decimal LL2 = 0;
                                    try
                                    {
                                        LL2 = Convert.ToDecimal(dts.Rows[i][dc.ColumnName].ToString());
                                    }
                                    catch { }
                                    l1.GetType().GetProperty(dc.ColumnName).SetValue(l1, LL2, null);
                                    break;
                                case "Num5":
                                case "Num7":
                                case "KBS":
                                case "KG":
                                    int l5 = 0;
                                    try
                                    {
                                        l5 = Convert.ToInt32(dts.Rows[i][dc.ColumnName].ToString());
                                    }
                                    catch { }
                                    l1.GetType().GetProperty(dc.ColumnName).SetValue(l1, l5, null);
                                    break;
                                default:
                                    l1.GetType().GetProperty(dc.ColumnName).SetValue(l1, dts.Rows[i][dc.ColumnName].ToString(), null);
                                    break;
                            }
                        }
                        lii.Add(l1);
                    }

                    foreach (PW_tb3a lll in lii)
                    {

                        PW_tb3a l1 = new PW_tb3a();

                        IList<PW_tb3a> list = new List<PW_tb3a>();

                        //if (type == "2")
                        //{
                        //    l1.S1 = lll.S1;
                        //    l1.T1 = lll.T1;
                        //    l1.T5 = lll.T5;
                        //    l1.S5 = type;
                        //    list = Common.Services.BaseService.GetList<Project_Sum>("SelectProject_SumByvalue3", l1);
                        //}

                        //if (list.Count > 0)
                        //{
                        //    lll.UID = list[0].UID;
                        //    Services.BaseService.Update<PW_tb3a>(lll);
                        //}
                        //else
                        //{
                            lll.UID = Guid.NewGuid().ToString();
                            lll.col2 = Itop.Client.MIS.ProgUID;
                            Services.BaseService.Create<PW_tb3a>(lll);
                        //}
                    }
                    this.ctrlProject_Sum1.RefreshData();
                }
            }
            catch (Exception ex)
            {
                MsgBox.Show(columnname + ex.Message);
                MsgBox.Show("�����ʽ����ȷ��");

            }
        }
Пример #16
0
        //�˴�Ϊ��̬������ݷ���
        private void Sheet_AddData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            int startrow = 3;
            int addnum = 0;
            int itemcount = 0;
            int firstrow = 0;
            string rowsum = "";
            string rowsum2 = "";
            Itop.Domain.PWTable.PW_tb3a p = new Itop.Domain.PWTable.PW_tb3a();
            p.col2 = Itop.Client.MIS.ProgUID;
            IList<PW_tb3a> list = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2254", p);

            bool sheetEnd = false;
            for (int i = 0; i < list.Count;i++ )
            {

                PW_tb3a obj = list[i];
                PW_tb3a obj2 = new PW_tb3a();
                if (i < list.Count - 1)
                {
                    obj2 = list[i + 1];
                }
                else
                {
                    sheetEnd = true;
                }
                decimal _sum = obj.Num1 + obj.Num2 + obj.Num3 + obj.Num4 + obj.Num5 + obj.Num6 + obj.Num7 + obj.Num8;
                itemcount = itemcount + 1;
                obj_sheet.RowCount = obj_sheet.RowCount + 1;
                obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                obj_sheet.SetValue(i + addnum + startrow, 1, "��·�������أ�");
                obj_sheet.SetValue(i + addnum + startrow, 2, obj.Num1);
                obj_sheet.SetValue(i + addnum + startrow, 3, obj.Num2);
                obj_sheet.SetValue(i + addnum + startrow, 4, obj.Num3);
                obj_sheet.SetValue(i + addnum + startrow, 5, obj.Num4);
                obj_sheet.SetValue(i + addnum + startrow, 6, obj.Num5);
                obj_sheet.SetValue(i + addnum + startrow, 7, obj.Num6);
                obj_sheet.SetValue(i + addnum + startrow, 8, obj.Num7);
                obj_sheet.SetValue(i + addnum + startrow, 9, obj.Num8);
                obj_sheet.SetValue(i + addnum + startrow, 10, _sum);

                itemcount = itemcount + 1;
                addnum = addnum + 1;
                obj_sheet.RowCount = obj_sheet.RowCount + 1;
                obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                obj_sheet.SetValue(i + addnum + startrow, 1, "��ռ������%��");
                if (_sum == 0)
                {
                    obj_sheet.SetValue(i + addnum + startrow, 2, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 3, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 4, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 5, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 6, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 7, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 8, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 9, "0");
                    obj_sheet.SetValue(i + addnum + startrow, 10, "0");
                }
                else
                {
                    obj_sheet.SetValue(i + addnum + startrow, 2, Convert.ToDecimal((obj.Num1 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 3, Convert.ToDecimal((obj.Num2 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 4, Convert.ToDecimal((obj.Num3 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 5, Convert.ToDecimal((obj.Num4 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 6, Convert.ToDecimal((obj.Num5 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 7, Convert.ToDecimal((obj.Num6 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 8, Convert.ToDecimal((obj.Num7 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 9, Convert.ToDecimal((obj.Num8 / _sum) * 100).ToString("0.##"));
                    obj_sheet.SetValue(i + addnum + startrow, 10, "100");
                }
                obj_sheet.AddSpanCell(i + addnum + startrow-1, 0, 2, 1);

                rowsum = rowsum + Convert.ToString(startrow-2+2*(i+1)) + ",";
                rowsum2 = rowsum2 + Convert.ToString(startrow - 1 + 2 * (i + 1)) + ",";
                if (sheetEnd)
                {
                    addnum = addnum + 1;
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, "ȫ�кϼ�");
                    obj_sheet.SetValue(i + addnum + startrow, 1, "��·�������أ�");
                    TC.Sheet_WriteFormula_RowSum3(obj_sheet, TC.getRowList(rowsum), 2, i + addnum + startrow, 2, 9);
                    addnum = addnum + 1;
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, "ȫ�кϼ�");
                    obj_sheet.SetValue(i + addnum + startrow, 1, "��ռ������%��");
                    //TC.Sheet_WriteFormula_TwoCol_Percent(obj_sheet, i + addnum + startrow - 1, 2, 7, 1, i + addnum + startrow, 2);
                    obj_sheet.SetValue(i + addnum + startrow, 10, "100");
                    obj_sheet.AddSpanCell(i + addnum + startrow-1, 0, 2, 1);
                }
            }
        }
Пример #17
0
        //�˴�Ϊ��̬������ݷ���
        private void Sheet_AddData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            int startrow = 2;
            int addnum = 0;
            int itemcount = 0;
            int firstrow = 0;
            ArrayList rowsum = new ArrayList();
            Itop.Domain.PWTable.PW_tb3a p = new Itop.Domain.PWTable.PW_tb3a();
            p.col2 = Itop.Client.MIS.ProgUID;
            IList<PW_tb3a> alist = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aListDIS", p);

            for (int n = 0; n < alist.Count; n++)
            {
                for (int m = 0; m < 8; m++)
                {
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                }

                obj_sheet.AddSpanCell(2, 0, 8, 1);
                obj_sheet.SetValue(2, 0, "XX�����أ�");

                //2�������
                obj_sheet.AddSpanCell(startrow+n * 8, 1, 6, 1);
                obj_sheet.SetValue(startrow + n * 8, 1, "���ͽ��ߣ��أ�");
                obj_sheet.AddSpanCell(startrow + (n + 1) * 8-1, 1, 1, 2);
                obj_sheet.SetValue(startrow + (n + 1) * 8-1, 1, "������");
                obj_sheet.AddSpanCell(startrow + (n + 1) * 8, 1, 1, 2);
                obj_sheet.SetValue(startrow + (n+1) * 8, 1, "�����ǵ��ͽ��ߣ��أ�");

                //3�������
                obj_sheet.SetValue(startrow + n * 8, 2, "����һ��");
                obj_sheet.SetValue(startrow + n * 8+1, 2, "����һ��");
                obj_sheet.SetValue(startrow + n * 8 + 2, 2, "������");
                obj_sheet.SetValue(startrow + n * 8 + 3, 2, "˫����");
                obj_sheet.SetValue(startrow + n * 8 + 4, 2, "��ֶ�������");
                obj_sheet.SetValue(startrow + n * 8 + 5, 2, "��ֶ�������");

                PW_tb3a _tba = alist[n];
                p.PQName = _tba.PQName;
                p.JXMS = "����һ��";
                IList<PW_tb3a> list1 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "����һ��";
                IList<PW_tb3a> list2 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "������";
                IList<PW_tb3a> list3 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "˫����";
                IList<PW_tb3a> list4 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "��ֶ�������";
                IList<PW_tb3a> list5 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "��ֶ�������";
                IList<PW_tb3a> list6 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "������";
                IList<PW_tb3a> list7 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                p.JXMS = "�����ǵ��ͽ���";
                IList<PW_tb3a> list8 = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2255", p);
                if (list1.Count > 0)
                {
                    PW_tb3a obj = list1[0];
                    obj_sheet.SetValue(n+startrow+n*7, 0, obj.PQName);
                    obj_sheet.SetValue(n+startrow+n*7, 3, obj.Num1);
                    obj_sheet.SetValue(n+startrow+n*7, 4, obj.Num2);
                    obj_sheet.SetValue(n+startrow+n*7, 5, obj.Num3);
                    obj_sheet.SetValue(n+startrow+n*7, 6, obj.Num4);
                    obj_sheet.SetValue(n+startrow+n*7, 7, obj.Num5);
                    obj_sheet.SetValue(n+startrow+n*7, 8, obj.Num6);
                    obj_sheet.SetValue(n+startrow+n*7, 9, obj.Num7);
                    obj_sheet.SetValue(n+startrow+n*7, 10, obj.Num8);
                }
                else
                {
                    TC.Sheet_WriteZero(obj_sheet, n + startrow+n*7,3,1,8);
                }
            }
        }
Пример #18
0
        //�˴�Ϊ��̬������ݷ���
        private void Sheet_AddData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            int startrow = 3;
            int addnum = 0;
            int itemcount = 0;
            int firstrow = 0;
            ArrayList rowsum = new ArrayList();
            Itop.Domain.PWTable.PW_tb3a p = new Itop.Domain.PWTable.PW_tb3a();
            p.col2 = Itop.Client.MIS.ProgUID;
            IList<PW_tb3a> list = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2251", p);

            PW_tb3c p3 = new PW_tb3c();
            p3.col4 = Itop.Client.MIS.ProgUID;
            IList<PW_tb3c> plist = Services.BaseService.GetList<PW_tb3c>("SelectPW_tb3cList", p3);
            IList<PW_tb3a> alist = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aListDIS",p);

            for (int n = 0; n < plist.Count; n++)
            {
                rowsum.Add("");
            }
            bool sheetEnd = false;
            for (int i = 0; i < list.Count;i++ )
            {

                PW_tb3a obj = list[i];
                PW_tb3a obj2 = new PW_tb3a();
                if (i < list.Count - 1)
                {
                    obj2 = list[i + 1];
                }
                else
                {
                    sheetEnd = true;
                }
                itemcount = itemcount + 1;
                obj_sheet.RowCount = obj_sheet.RowCount + 1;
                obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                obj_sheet.SetValue(i + addnum + startrow, 1, obj.PQtype);
                obj_sheet.SetValue(i + addnum + startrow, 2, obj.Num10);
                obj_sheet.SetValue(i + addnum + startrow, 3, obj.Num3);
                obj_sheet.SetValue(i + addnum + startrow, 4, obj.Num2);
                obj_sheet.SetValue(i + addnum + startrow, 5, obj.Num4);
                obj_sheet.SetValue(i + addnum + startrow, 6, obj.KggNum);
                obj_sheet.SetValue(i + addnum + startrow, 7, obj.KG);
                obj_sheet.SetValue(i + addnum + startrow, 8, obj.KgzHwNum);
                obj_sheet.SetValue(i + addnum + startrow, 9, obj.Num11);
               // obj_sheet.SetValue(i + 3, 10, 1);
                if (obj.PQName != obj2.PQName)
                {
                    addnum = addnum + 1;
                        for (int x = 0; x < rowsum.Count; x++)
                        {
                            string str = (string)rowsum[x];
                            str = str + Convert.ToString(i + addnum + startrow - x - 1) + ",";
                            rowsum[x] = str;
                        }

                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                    obj_sheet.SetValue(i + addnum + startrow, 1, "��");
                    int num1 = startrow + addnum + firstrow;
                    if (firstrow == 0) { num1 = num1 - 1; }
                    TC.Sheet_WriteFormula_RowSum(obj_sheet, num1, 2, itemcount, 1, i + addnum + startrow, 2, 8);
                    obj_sheet.AddSpanCell(num1, 0, itemcount+1, 1);
                    firstrow = i;
                    startrow = 3;
                    itemcount = 0;
                }
                if (sheetEnd)
                {
                    int[] sum = new int[plist.Count];
                    rowsum.Reverse();
                    for (int m = 0; m < plist.Count; m++)
                    {
                        PW_tb3c _p = plist[m];
                        addnum = addnum + 1;
                        obj_sheet.RowCount = obj_sheet.RowCount + 1;
                        obj_sheet.SetValue(i + addnum + startrow, 0, "ȫ�кϼ�");
                        obj_sheet.SetValue(i + addnum + startrow, 1, _p.col1);
                        sum[m] = i + addnum + startrow;
                        int num1 = startrow + addnum + firstrow;
                        //if (firstrow == 0) { num1 = num1 - 1; }
                        TC.Sheet_WriteFormula_RowSum3(obj_sheet, TC.getRowList(rowsum[m].ToString()), 2, i + addnum + startrow, 2, 8);
                    }
                    addnum = addnum + 1;
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, "ȫ�кϼ�");
                    obj_sheet.SetValue(i + addnum + startrow, 1, "�ܼ�");
                    TC.Sheet_WriteFormula_RowSum3(obj_sheet, sum, 2, i + addnum + startrow, 2, 8);
                    obj_sheet.AddSpanCell(sum[0], 0, sum.Length+1, 1);
                }
            }
        }