Пример #1
0
        /// <summary>
        /// 修改焦点对象
        /// </summary>
        public void UpdateObject()
        {
            //获取焦点对象
            Project_Sum obj = FocusedObject;

            if (obj == null)
            {
                return;
            }

            //创建对象的一个副本
            Project_Sum objCopy = new Project_Sum();

            DataConverter.CopyTo <Project_Sum>(obj, objCopy);

            //执行修改操作
            using (FrmProject_SumDialog dlg = new FrmProject_SumDialog())
            {
                dlg.Object = objCopy;                   //绑定副本
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //用副本更新焦点对象
            DataConverter.CopyTo <Project_Sum>(objCopy, obj);
            //刷新表格
            gridControl.RefreshDataSource();
        }
Пример #2
0
        /// <summary>
        /// 计算线路的造价
        /// </summary>
        /// <param name="DY">电压</param>
        /// <param name="LineLong">线路长度(KM)</param>
        /// <param name="LineType">导线型号</param>
        /// <returns>返回线路造价</returns>
        public static double ComputerLineMoney(int DY, double LineLong, string LineType)
        {
            double sumvalueLine = 0;

            Project_Sum ps = new Project_Sum();

            ps.S5 = "1";
            ps.S1 = DY.ToString();
            ps.L1 = LineType;
            IList <Project_Sum> sum = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByLinevalue2", ps);

            if (sum.Count == 1)
            {
                foreach (Project_Sum pp in sum)
                {
                    if (pp.Num.ToString() == null || pp.Num.ToString() == "")
                    {
                        pp.Num = 0;
                    }

                    sumvalueLine = pp.Num * LineLong;
                }
            }
            return(sumvalueLine);
        }
Пример #3
0
        /// <summary>
        /// 添加对象
        /// </summary>
        public void AddObject()
        {
            //检查对象链表是否已经加载
            if (ObjectList == null)
            {
                return;
            }
            //新建对象
            Project_Sum obj = new Project_Sum();

            obj.UID = Guid.NewGuid().ToString();
            obj.S5  = type;

            //执行添加操作
            using (FrmProject_SumDialog dlg = new FrmProject_SumDialog())
            {
                dlg.IsCreate = true;                    //设置新建标志
                dlg.Object   = obj;
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //将新对象加入到链表中
            ObjectList.Add(obj);

            //刷新表格,并将焦点行定位到新对象上。
            gridControl.RefreshDataSource();
            GridHelper.FocuseRow(this.gridView, obj);
        }
Пример #4
0
        private void spinEdit3_EditValueChanged(object sender, EventArgs e)
        {
            string      sql = " S1='" + comboBoxEdit5.Text + "' and Type='电缆'";
            Project_Sum p   = (Project_Sum)Services.BaseService.GetObject("SelectProject_SumByValues", sql);

            if (p != null)
            {
                txtje2.Text = Convert.ToString(Convert.ToDecimal(p.Num) * spinEdit3.Value);
                txttz.Text  = Convert.ToString(Convert.ToDecimal(txtje1.Text) + Convert.ToDecimal(txtje2.Text));
            }
        }
Пример #5
0
        /// <summary>
        /// 计算变电站的造价
        /// </summary>
        /// <param name="DY">电压</param>
        /// <param name="Number">主变台数</param>
        /// <param name="MVA">单台容量</param>
        /// <param name="LineLong">线路长度(KM)</param>
        /// <param name="LineType">导线型号</param>
        /// <param name="Flag">是否附带线路造价信息,是true,否false</param>
        /// <returns>返回变电站造价</returns>
        public static double ComputerPowerMoney(int DY, int Number, string MVA, double LineLong, string LineType, bool Flag)
        {
            double      sumvalue     = 0;
            double      sumvaluedata = 0;
            double      sumvalueLine = 0;
            Project_Sum ps           = new Project_Sum();

            //ps.T2 = OBJ.L2;
            //ps.T3 = OBJ.L13;
            //ps.T4 = OBJ.L14;
            ps.S5 = "2";
            ps.S1 = DY.ToString();
            ps.T5 = MVA.ToString();
            ps.T1 = Number.ToString();
            //ps.Type = OBJ.L7;

            Project_Sum sum = (Project_Sum)Common.Services.BaseService.GetObject("SelectProject_SumByvalue3", ps);

            if (sum != null)
            {
                // sumvaluedata = sum.Num*Number/int.Parse(sum.T1);
                sumvaluedata = sum.Num;
            }


            if (Flag == true)//变电站下的线路,线路信息
            {
                Project_Sum pps = new Project_Sum();
                pps.S5 = "1";
                pps.S1 = DY.ToString();
                pps.L1 = LineType;
                ////ps.L2 = OBJ.L15;
                ////ps.L3 = OBJ.L16;

                IList <Project_Sum> summ = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByLinevalue2", pps);
                if (summ.Count == 1)
                {
                    foreach (Project_Sum pp in summ)
                    {
                        if (pp.Num.ToString() == null || pp.Num.ToString() == "")
                        {
                            pp.Num = 0;
                        }

                        sumvalueLine = pp.Num * LineLong;
                    }
                }
            }

            return(sumvalue = sumvaluedata + sumvalueLine);
        }
Пример #6
0
        /// <summary>
        /// 删除焦点对象
        /// </summary>
        public void DeleteObject()
        {
            //获取焦点对象
            Project_Sum obj = FocusedObject;

            if (obj == null)
            {
                return;
            }

            //请求确认
            if (MsgBox.ShowYesNo(Strings.SubmitDelete) != DialogResult.Yes)
            {
                return;
            }

            //执行删除操作
            try
            {
                Services.BaseService.Delete <Project_Sum>(obj);
            }
            catch (Exception exc)
            {
                Debug.Fail(exc.Message);
                HandleException.TryCatch(exc);
                return;
            }

            this.gridView.BeginUpdate();
            //记住当前焦点行索引
            int iOldHandle = this.gridView.FocusedRowHandle;

            //从链表中删除
            ObjectList.Remove(obj);
            //刷新表格
            gridControl.RefreshDataSource();
            //设置新的焦点行索引
            GridHelper.FocuseRowAfterDelete(this.gridView, iOldHandle);
            this.gridView.EndUpdate();
        }
Пример #7
0
        private void InsertSubstation_Info()
        {
            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 <Project_Sum> lii = new List <Project_Sum>();
                    DateTime            s8  = DateTime.Now;
                    for (int i = 0; i < dts.Rows.Count; i++)
                    {
                        Project_Sum l1 = new Project_Sum();
                        foreach (DataColumn dc in dts.Columns)
                        {
                            columnname = dc.ColumnName;
                            //if (dts.Rows[i][dc.ColumnName].ToString() == "")
                            //    continue;

                            switch (dc.ColumnName)
                            {
                            //case "L2":
                            //case "L9":
                            case "Num":
                                double LL2 = 0;
                                try
                                {
                                    LL2 = Convert.ToDouble(dts.Rows[i][dc.ColumnName].ToString());
                                }
                                catch { }
                                l1.GetType().GetProperty(dc.ColumnName).SetValue(l1, LL2, null);
                                break;

                            //case "L1":
                            //case "L3":
                            //    int LL3 = 0;
                            //    try
                            //    {
                            //        LL3 = Convert.ToInt32(dts.Rows[i][dc.ColumnName].ToString());
                            //    }
                            //    catch { }
                            //    l1.GetType().GetProperty(dc.ColumnName).SetValue(l1, LL3, null);
                            //    break;

                            default:
                                l1.GetType().GetProperty(dc.ColumnName).SetValue(l1, dts.Rows[i][dc.ColumnName].ToString(), null);
                                break;
                            }
                        }
                        l1.S5 = type;
                        //l1.CreateDate = s8.AddSeconds(i);
                        lii.Add(l1);
                    }

                    foreach (Project_Sum lll in lii)
                    {
                        ////////if (lll.Name == "")
                        ////////    continue;
                        Project_Sum l1 = new Project_Sum();
                        ////////l1.Name = lll.Name;

                        ////////l1.S5 = type;
                        ////////object obj = Services.BaseService.GetObject("SelectProject_SumByNameandS5", l1);

                        IList <Project_Sum> list = new List <Project_Sum>();
                        if (type == "1")
                        {
                            l1.S1 = lll.S1;
                            l1.L1 = lll.L1;
                            l1.S5 = type;
                            list  = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByLinevalue2", l1);
                        }
                        else 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 <Project_Sum>(lll);
                        }
                        else
                        {
                            lll.UID = Guid.NewGuid().ToString();
                            Services.BaseService.Create <Project_Sum>(lll);
                        }
                    }
                    this.ctrlProject_Sum1.RefreshData();
                }
            }
            catch (Exception ex)
            {
                MsgBox.Show(columnname + ex.Message);
                MsgBox.Show("导入格式不正确!");
            }
        }
Пример #8
0
        public void InitSodata()
        {
            if (ctrlPowerEachList1.FocusedObject == null)
            {
                return;
            }

            string sid = typeFlag = ctrlPowerEachList1.FocusedObject.UID;

            ctrlPSP_Project_List1.Flag = typeFlag;

            Hashtable hs  = new Hashtable();
            Hashtable hs1 = new Hashtable();

            IList <LineInfo> listLineInfo = Services.BaseService.GetList <LineInfo>("SelectLineInfoByPowerID", sid);

            foreach (LineInfo l1 in listLineInfo)
            {
                hs.Add(Guid.NewGuid().ToString(), l1.UID);
            }

            IList <substation> listsubstation = Services.BaseService.GetList <substation>("SelectsubstationByPowerID2", sid);

            foreach (substation s1 in listsubstation)
            {
                hs.Add(Guid.NewGuid().ToString(), s1.UID);
            }

            PSP_Project_List psp_Type = new PSP_Project_List();

            psp_Type.Flag2 = sid;
            IList <PSP_Project_List> listProTypes = Common.Services.BaseService.GetList <PSP_Project_List>("SelectPSP_Project_ListByFlag2", psp_Type);

            foreach (PSP_Project_List ps in listProTypes)
            {
                hs1.Add(Guid.NewGuid().ToString(), ps.Code);
            }

            foreach (PSP_Project_List p1 in listProTypes)
            {
                if (p1.Code != "" && !hs.ContainsValue(p1.Code) && p1.ParentID != "0")
                {
                    //删除
                    Services.BaseService.Delete <PSP_Project_List>(p1);
                }
            }

            foreach (LineInfo l2 in listLineInfo)
            {
                if (!hs1.ContainsValue(l2.UID) && l2.Voltage != "")
                {
                    //添加
                    try
                    {
                        PSP_Project_List ps2 = new PSP_Project_List();
                        ps2.ParentID = l2.Voltage.ToUpper().Replace("KV", "");
                        ps2.L3       = l2.LineName;
                        ps2.Code     = l2.UID;
                        ps2.Flag     = 1;
                        ps2.Flag2    = sid;
                        ps2.L4       = l2.Voltage;
                        ps2.L8       = double.Parse(l2.Length).ToString();;
                        ps2.L9       = l2.LineType;
                        if (l2.ObligateField1 == "运行")
                        {
                            ps2.L2 = "扩建";
                        }
                        else if (l2.ObligateField1 == "规划")
                        {
                            ps2.L2 = "新建";
                        }
                        ps2.L15 = l2.ObligateField3;
                        ps2.ID  = Guid.NewGuid().ToString();
                        Services.BaseService.Create <PSP_Project_List>(ps2);
                    }
                    catch (Exception ex)
                    {
                        System.Console.WriteLine(ex.Message);
                    }
                }

                if (hs1.ContainsValue(l2.UID) && l2.Voltage != "")
                {
                    //更新
                    try
                    {
                        PSP_Project_List p2 = new PSP_Project_List();
                        p2.Code  = l2.UID;
                        p2.Flag2 = sid;
                        PSP_Project_List ps2 = (PSP_Project_List)Services.BaseService.GetObject("SelectPSP_Project_ListByObject", p2);
                        ps2.ParentID = l2.Voltage.ToUpper().Replace("KV", "");
                        ps2.Flag     = 1;
                        if (l2.ObligateField1 == "运行")
                        {
                            l2.ObligateField1 = "扩建";
                        }
                        else if (l2.ObligateField1 == "规划")
                        {
                            l2.ObligateField1 = "新建";
                        }
                        if (double.Parse(l2.Length).ToString() == "" || double.Parse(l2.Length).ToString() == null)
                        {
                            l2.Length = "0";
                        }
                        if (ps2.L3 != l2.LineName || ps2.L4 != l2.Voltage || ps2.L8 != double.Parse(l2.Length).ToString() || ps2.L9 != l2.LineType || l2.ObligateField1 != ps2.L2 || ps2.L15 != l2.ObligateField3)
                        {
                            ps2.L3 = l2.LineName;
                            ps2.L4 = l2.Voltage;
                            ps2.L8 = double.Parse(l2.Length).ToString();
                            ps2.L9 = l2.LineType;
                            if (l2.ObligateField1 == "运行")
                            {
                                ps2.L2 = "扩建";
                            }
                            else if (l2.ObligateField1 == "规划")
                            {
                                ps2.L2 = "新建";
                            }
                            ps2.L15 = l2.ObligateField3;

                            Services.BaseService.Update("UpdatePSP_Project_ListByCode", ps2);
                        }
                    }
                    catch (Exception ex)
                    {
                        System.Console.WriteLine(ex.Message);
                    }
                }
            }

            Project_Sum psp = new Project_Sum();

            psp.S5 = "2";
            IList <Project_Sum> sum = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS5", psp);


            Hashtable ha = new Hashtable();
            ArrayList al = new ArrayList();

            foreach (substation s2 in listsubstation)
            {
                if (!hs1.ContainsValue(s2.UID) && s2.ObligateField1 != "")
                {
                    ha.Clear();
                    al.Clear();
                    int kk = 0;
                    //添加
                    try
                    {
                        Substation_Info sub = new Substation_Info();
                        sub.Code = s2.UID;
                        //Substation_Info station = (Substation_Info)Common.Services.BaseService.GetObject("SelectSubstation_InfoByCode", sub);


                        PSP_Project_List ps3 = new PSP_Project_List();
                        ps3.ParentID = s2.ObligateField1;
                        ps3.L3       = s2.EleName;
                        ps3.Code     = s2.UID;
                        ps3.Flag     = 2;
                        ps3.Flag2    = sid;
                        ps3.L4       = s2.ObligateField1.ToString();
                        if (s2.ObligateField3 == "运行")
                        {
                            ps3.L2 = "扩建";
                        }
                        else if (s2.ObligateField3 == "规划")
                        {
                            ps3.L2 = "新建";
                        }
                        ps3.L15 = s2.ObligateField5;
                        //if (station != null)
                        //{
                        //    ps3.L5 = station.L3.ToString();
                        //}

                        foreach (Project_Sum ps1 in sum)
                        {
                            if (s2.ObligateField1.ToString() == ps1.S1.ToString())
                            {
                                try
                                {
                                    double mva = double.Parse(s2.Number.ToString());
                                    double t5  = Convert.ToDouble(ps1.T5); //单台容量
                                    int    ta  = Convert.ToInt32(ps1.T1);  //主变台数
                                    if (mva == (t5 * ta))
                                    {
                                        ha.Add(t5, ta);
                                        al.Add(t5);
                                    }
                                }
                                catch { }
                            }
                        }
                        if (al.Count > 0)
                        {
                            double va = Convert.ToDouble(al[0].ToString());
                            for (int ii = 0; ii < al.Count; ii++)
                            {
                                if (va < Convert.ToDouble(al[ii].ToString()))
                                {
                                    va = Convert.ToDouble(al[ii].ToString());
                                }
                            }
                            ps3.L5 = ha[va].ToString();
                            ps3.L6 = va.ToString();
                        }
                        else
                        {
                            ps3.L5 = "";
                            ps3.L6 = "";
                        }
                        ps3.IsConn = double.Parse(s2.Number.ToString()).ToString();//总容量
                        ps3.ID     = Guid.NewGuid().ToString();
                        Services.BaseService.Create <PSP_Project_List>(ps3);
                    }
                    catch { }
                }
                if (hs1.ContainsValue(s2.UID) && s2.ObligateField1 != "")
                {
                    ha.Clear();
                    al.Clear();
                    int kk = 0;
                    //更新
                    try
                    {
                        Substation_Info sub = new Substation_Info();
                        sub.Code = s2.UID;
                        //Substation_Info station = (Substation_Info)Common.Services.BaseService.GetObject("SelectSubstation_InfoByCode", sub);

                        PSP_Project_List p3 = new PSP_Project_List();
                        p3.Code  = s2.UID;
                        p3.Flag2 = sid;
                        PSP_Project_List ps3 = (PSP_Project_List)Services.BaseService.GetObject("SelectPSP_Project_ListByObject", p3);
                        ps3.ParentID = s2.ObligateField1;
                        ps3.Flag     = 2;
                        if (s2.ObligateField3 == "运行")
                        {
                            s2.ObligateField3 = "扩建";
                        }
                        else if (s2.ObligateField3 == "规划")
                        {
                            s2.ObligateField3 = "新建";
                        }
                        string l5 = "";
                        string l6 = "";
                        foreach (Project_Sum ps1 in sum)
                        {
                            if (s2.ObligateField1.ToString() == ps1.S1.ToString())
                            {
                                try
                                {
                                    double mva = 0;
                                    if (s2.Number.ToString() != "" && s2.Number.ToString() != null)
                                    {
                                        mva = double.Parse(s2.Number.ToString());
                                    }
                                    double t5 = Convert.ToDouble(ps1.T5); //单台容量
                                    int    ta = Convert.ToInt32(ps1.T1);  //主变台数
                                    if (mva == (t5 * ta))
                                    {
                                        ha.Add(t5, ta);
                                        al.Add(t5);
                                    }
                                }
                                catch { }
                            }
                        }
                        if (al.Count > 0)
                        {
                            double va = Convert.ToDouble(al[0].ToString());
                            for (int ii = 0; ii < al.Count; ii++)
                            {
                                if (va < Convert.ToDouble(al[ii].ToString()))
                                {
                                    va = Convert.ToDouble(al[ii].ToString());
                                }
                            }
                            l5 = ha[va].ToString();
                            l6 = va.ToString();
                        }
                        else
                        {
                            l5 = "";
                            l6 = "";
                        }

                        if (ps3.L3 != s2.EleName || ps3.L4 != s2.ObligateField1.ToString() || s2.ObligateField3 != ps3.L2 || ps3.L15 != s2.ObligateField5 || ps3.L5 != l5 || ps3.L6 != l6)
                        {
                            ps3.L3 = s2.EleName;
                            ps3.L4 = s2.ObligateField1.ToString();
                            if (s2.ObligateField3 == "运行")
                            {
                                ps3.L2 = "扩建";
                            }
                            else if (s2.ObligateField3 == "规划")
                            {
                                ps3.L2 = "新建";
                            }
                            ps3.L15 = s2.ObligateField5;
                            //if (station != null)
                            //{
                            //    ps3.L5 = station.L3.ToString();
                            //}

                            ps3.IsConn = double.Parse(s2.Number.ToString()).ToString();//总容量
                            Services.BaseService.Update("UpdatePSP_Project_ListByCode", ps3);
                        }
                    }
                    catch { }
                }
            }
        }
Пример #9
0
        /// <summary>
        /// 计算变电站的造价
        /// </summary>
        /// <param name="DY">电压</param>
        /// <param name="Number">主变台数</param>
        /// <param name="MVA">单台容量</param>
        /// <param name="LineLong">线路长度(KM)</param>
        /// <param name="LineType">导线型号</param>
        /// <param name="Flag">是否附带线路造价信息,是true,否false</param>
        /// <returns>返回变电站造价</returns>
        public static double ComputerPowerMoney(int DY, double MVA, double LineLong, string LineType, bool Flag)
        {
            double      sumvalue     = 0;
            double      sumvaluedata = 0;
            double      sumvalueLine = 0;
            Project_Sum ps           = new Project_Sum();

            //ps.T2 = OBJ.L2;
            //ps.T3 = OBJ.L13;
            //ps.T4 = OBJ.L14;
            ps.S5 = "2";
            ps.S1 = DY.ToString();
            Hashtable ha = new Hashtable();
            int       t  = 0;

            //ps.Type = OBJ.L7;
            IList <Project_Sum> sum = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", ps);

            foreach (Project_Sum ps1 in sum)
            {
                try
                {
                    int mva = (int)MVA;
                    int t5  = Convert.ToInt32(ps1.T5);
                    int ta  = Convert.ToInt32(ps1.T1);
                    if (mva % (t5 * ta) == 0)
                    {
                        ha.Add(t5, ps1.Num);
                        if (t5 > t)
                        {
                            t = t5;
                        }

                        //sumvaluedata = ps1.Num;
                        //break;
                    }
                }
                catch { }
            }
            try
            {
                if (ha.Count > 0)
                {
                    sumvaluedata = (double)ha[t];
                }
            }
            catch { }



            if (Flag == true)//变电站下的线路,线路信息
            {
                Project_Sum pps = new Project_Sum();
                pps.S5 = "1";
                pps.S1 = DY.ToString();
                pps.L1 = LineType;
                ////ps.L2 = OBJ.L15;
                ////ps.L3 = OBJ.L16;
                IList <Project_Sum> summ = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByLinevalue2", pps);
                if (summ.Count == 1)
                {
                    foreach (Project_Sum pp in summ)
                    {
                        if (pp.Num.ToString() == null || pp.Num.ToString() == "")
                        {
                            pp.Num = 0;
                        }

                        sumvalueLine = pp.Num * LineLong;
                    }
                }
            }

            return(sumvalue = sumvaluedata + sumvalueLine);
        }
Пример #10
0
        protected bool InputCheck()
        {
            if (_obj.S1 == "")
            {
                MsgBox.Show("电压等级不能为空!");
                return(false);
            }

            if (_obj.Name == "")
            {
                MsgBox.Show("项目名称不能为空!");
                return(false);
            }

            if (Object.S5 == "1") //xianlu
            {
                //if (_obj.L1 == "")
                //{
                //    MsgBox.Show("导线型号不能为空!");
                //    return false;
                //}
            }
            else
            {
                //if (_obj.T1 == "")
                //{
                //    MsgBox.Show("主变台数不能为空!");
                //    return false;
                //}

                //if (_obj.T5 == "")
                //{
                //    MsgBox.Show("规模不能为空!");
                //    return false;
                //}
                //单台容量
            }
            //if (_obj.Num== 0)
            //{
            //    MsgBox.Show("静态投资不能为空!");
            //    return false;
            //}

            Project_Sum str = new Project_Sum();

            str.Name = _obj.Name;
            str.S5   = _obj.S5;
            IList <Project_Sum> list = new List <Project_Sum>();

            //////////IList<Project_Sum> list    = Common.Services.BaseService.GetList<Project_Sum>("SelectProject_SumByNameandS5", str);
            //////////if (IsCreate)
            //////////{
            //////////    if (list.Count > 0)
            //////////    {
            //////////        MsgBox.Show("已存在同名的典型方案!");
            //////////        list.Clear();
            //////////        return false;

            //////////    }
            //////////}
            //////////else
            //////////{
            //////////    if (list.Count == 1)
            //////////    {
            //////////        //IList<Project_Sum> listtemp = list as IList<Project_Sum>;
            //////////        //////////    if (list[0].UID != _obj.UID)
            //////////        ////////// {
            //////////        //////////     MsgBox.Show("已存在同名的典型方案!");
            //////////        //////////     list.Clear();
            //////////        //////////     return false;
            //////////        ////////// }
            //////////        //////////}
            //////////        //////////else if (list.Count > 1)
            //////////        //////////{
            //////////        //////////    MsgBox.Show("已存在同名的典型方案!");
            //////////        //////////    list.Clear();
            //////////        //////////    return false;

            //////////    }

            //////////}
            // if (_obj.S5 == "1")
            // {
            str.S1   = _obj.S1;
            str.Type = _obj.Type;
            str.T5   = _obj.T5;
            str.Name = _obj.Name;
            list     = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumBySxt", str);
            if (IsCreate)
            {
                if (list.Count > 0)
                {
                    MsgBox.Show("已存在相同的方案(电压、项目名称、规格、规模完全相同)!");
                    list.Clear();
                    return(false);
                }
            }
            else
            {
                if (list.Count == 1)
                {
                    //IList<Project_Sum> listtemp = list as IList<Project_Sum>;
                    if (list[0].UID != _obj.UID)
                    {
                        MsgBox.Show("已存在相同的方案(电压、项目名称、规格、规模完全相同)!");
                        list.Clear();
                        return(false);
                    }
                }
                else if (list.Count > 1)
                {
                    MsgBox.Show("已存在相同的方案(电压、项目名称、规格、规模完全相同)!");
                    list.Clear();
                    return(false);
                }
            }
            //  }
            //else
            //    if (_obj.S5 == "2")
            //    {
            //        str.S1 = _obj.S1;
            //        str.T1 = _obj.T1;
            //        str.T5 = _obj.T5;
            //        str.S5 = _obj.S5;
            //        list = Common.Services.BaseService.GetList<Project_Sum>("SelectProject_SumByvalue3", str);
            //        if (IsCreate)
            //        {
            //            if (list.Count > 0)
            //            {
            //                MsgBox.Show("已存在相同的方案(电压、主变台数、单台容量完全相同)!");
            //                list.Clear();
            //                return false;

            //            }
            //        }
            //        else
            //        {
            //            if (list.Count == 1)
            //            {
            //                //IList<Project_Sum> listtemp = list as IList<Project_Sum>;
            //                if (list[0].UID != _obj.UID)
            //                {
            //                    MsgBox.Show("已存在相同的方案(电压、主变台数、单台容量完全相同)!");
            //                    list.Clear();
            //                    return false;

            //                }
            //            }
            //            else if (list.Count > 1)
            //            {
            //                MsgBox.Show("已存在相同的方案(电压、主变台数、单台容量完全相同)!");
            //                list.Clear();
            //                return false;

            //            }
            //        }

            //    }
            return(true);
        }
Пример #11
0
        private void CreateInit()
        {
            double sumvalue = 0;

            OBJ.L11 = "0";
            if (OBJ.L4 == "220")
            {
                Project_Sum pjt = new Project_Sum();
                if (OBJ.Flag == 2)
                {
                    pjt.S1 = "220";
                    pjt.S5 = "2";
                    IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum ps in lt)
                    {
                        if (ps.T5 != null && ps.T5 != "")
                        {
                            if (!this.repositoryItemComboBox3.Items.Contains(ps.T5))
                            {
                                this.repositoryItemComboBox3.Items.Add(ps.T5);
                            }
                        }
                    }
                    if (this.repositoryItemComboBox3.Items.Count > 0)
                    {
                        OBJ.L6 = this.repositoryItemComboBox3.Items[0].ToString();
                    }
                }
                pjt.S1 = "220";
                pjt.S5 = "1";
                IList <Project_Sum> ltt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                foreach (Project_Sum pss in ltt)
                {
                    if (pss.L1 != null && pss.L1 != "")
                    {
                        if (!this.repositoryItemComboBox10.Items.Contains(pss.L1))
                        {
                            this.repositoryItemComboBox10.Items.Add(pss.L1);
                        }
                    }
                }
                if (OBJ.Flag == 1)
                {
                    if (this.repositoryItemComboBox10.Items.Count > 0)
                    {
                        OBJ.L9 = this.repositoryItemComboBox10.Items[0].ToString();
                    }
                }
            }
            if (OBJ.L4 == "110")
            {
                Project_Sum pjt = new Project_Sum();
                if (OBJ.Flag == 2)
                {
                    pjt.S1 = "110";
                    pjt.S5 = "2";

                    IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum ps in lt)
                    {
                        if (ps.T5 != null && ps.T5 != "")
                        {
                            if (!this.repositoryItemComboBox3.Items.Contains(ps.T5))
                            {
                                this.repositoryItemComboBox3.Items.Add(ps.T5);
                            }
                        }
                    }
                    if (this.repositoryItemComboBox3.Items.Count > 0)
                    {
                        OBJ.L6 = this.repositoryItemComboBox3.Items[0].ToString();
                    }
                }
                pjt.S1 = "110";
                pjt.S5 = "1";
                IList <Project_Sum> ltt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                foreach (Project_Sum pss in ltt)
                {
                    if (pss.L1 != null && pss.L1 != "")
                    {
                        if (!this.repositoryItemComboBox10.Items.Contains(pss.L1))
                        {
                            this.repositoryItemComboBox10.Items.Add(pss.L1);
                        }
                    }
                }
                if (OBJ.Flag == 1)
                {
                    if (this.repositoryItemComboBox10.Items.Count > 0)
                    {
                        OBJ.L9 = this.repositoryItemComboBox10.Items[0].ToString();
                    }
                }
            }
            if (OBJ.L4 == "35")
            {
                Project_Sum pjt = new Project_Sum();
                if (OBJ.Flag == 2)
                {
                    pjt.S1 = "35";
                    pjt.S5 = "2";

                    IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum ps in lt)
                    {
                        if (ps.T5 != null && ps.T5 != "")
                        {
                            if (!this.repositoryItemComboBox3.Items.Contains(ps.T5))
                            {
                                this.repositoryItemComboBox3.Items.Add(ps.T5);
                            }
                        }
                    }
                    if (this.repositoryItemComboBox3.Items.Count > 0)
                    {
                        OBJ.L6 = this.repositoryItemComboBox3.Items[0].ToString();
                    }
                }
                pjt.S1 = "35";
                pjt.S5 = "1";
                IList <Project_Sum> ltt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                foreach (Project_Sum pss in ltt)
                {
                    if (pss.L1 != null && pss.L1 != "")
                    {
                        if (!this.repositoryItemComboBox10.Items.Contains(pss.L1))
                        {
                            this.repositoryItemComboBox10.Items.Add(pss.L1);
                        }
                    }
                }
                if (OBJ.Flag == 1)
                {
                    if (this.repositoryItemComboBox10.Items.Count > 0)
                    {
                        OBJ.L9 = this.repositoryItemComboBox10.Items[0].ToString();
                    }
                }
            }
            if (OBJ.L4 == "66")
            {
                Project_Sum pjt = new Project_Sum();

                if (OBJ.Flag == 2)
                {
                    pjt.S1 = "66";
                    pjt.S5 = "2";

                    IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum ps in lt)
                    {
                        if (ps.T5 != null && ps.T5 != "")
                        {
                            if (!this.repositoryItemComboBox3.Items.Contains(ps.T5))
                            {
                                this.repositoryItemComboBox3.Items.Add(ps.T5);
                            }
                        }
                    }
                    if (this.repositoryItemComboBox3.Items.Count > 0)
                    {
                        OBJ.L6 = this.repositoryItemComboBox3.Items[0].ToString();
                    }
                }
                pjt.S1 = "66";
                pjt.S5 = "1";
                IList <Project_Sum> ltt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                foreach (Project_Sum pss in ltt)
                {
                    if (pss.L1 != null && pss.L1 != "")
                    {
                        if (!this.repositoryItemComboBox10.Items.Contains(pss.L1))
                        {
                            this.repositoryItemComboBox10.Items.Add(pss.L1);
                        }
                    }
                }
                if (OBJ.Flag == 1)
                {
                    if (this.repositoryItemComboBox10.Items.Count > 0)
                    {
                        OBJ.L9 = this.repositoryItemComboBox10.Items[0].ToString();
                    }
                }
            }
            if (OBJ.L4 == "500")
            {
                Project_Sum pjt = new Project_Sum();
                if (OBJ.Flag == 2)
                {
                    pjt.S1 = "500";
                    pjt.S5 = "2";

                    IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum ps in lt)
                    {
                        if (ps.T5 != null && ps.T5 != "")
                        {
                            if (!this.repositoryItemComboBox3.Items.Contains(ps.T5))
                            {
                                this.repositoryItemComboBox3.Items.Add(ps.T5);
                            }
                        }
                    }
                    if (this.repositoryItemComboBox3.Items.Count > 0)
                    {
                        OBJ.L6 = this.repositoryItemComboBox3.Items[0].ToString();
                    }
                }
                pjt.S1 = "500";
                pjt.S5 = "1";
                IList <Project_Sum> ltt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                foreach (Project_Sum pss in ltt)
                {
                    if (pss.L1 != null && pss.L1 != "")
                    {
                        if (!this.repositoryItemComboBox10.Items.Contains(pss.L1))
                        {
                            this.repositoryItemComboBox10.Items.Add(pss.L1);
                        }
                    }
                }
                if (OBJ.Flag == 1)
                {
                    if (this.repositoryItemComboBox10.Items.Count > 0)
                    {
                        OBJ.L9 = this.repositoryItemComboBox10.Items[0].ToString();
                    }
                }
            }
            if (OBJ.Flag == 2)
            {
                this.单台容量.Enabled = true;
                this.主变台数.Enabled = true;
            }


            PSP_Project_List sf  = (PSP_Project_List)Services.BaseService.GetObject("SelectPSP_Project_ListByMaxCreateTime", null);
            IList            sf1 = Services.BaseService.GetList("selectPag2", null);

            foreach (PSP_Project_List kk in sf1)
            {
                if (kk.L1 != "" && kk.L1 != null)
                {
                    this.repositoryItemComboBox5.Items.Add(kk.L1);
                }
            }
            if (sf != null)
            {
                if (sf.L1 != "" && sf.L1 != null)
                {
                    OBJ.L1 = sf.L1;
                }
                else if (this.repositoryItemComboBox5.Items.Count > 0)
                {
                    OBJ.L1 = this.repositoryItemComboBox5.Items[0].ToString();
                }
                else if (this.repositoryItemComboBox5.Items.Count > 0)
                {
                    OBJ.L1 = this.repositoryItemComboBox5.Items[0].ToString();
                }
            }
        }
Пример #12
0
        private void vGridControl1_CellValueChanged(object sender, DevExpress.XtraVerticalGrid.Events.CellValueChangedEventArgs e)
        {
            if (e.Row.Properties.FieldName.ToString() == "L19" || e.Row.Properties.FieldName.ToString() == "L4")
            {
                repositoryItemComboBox3.Items.Clear();
                this.repositoryItemComboBox10.Items.Clear();
                if (OBJ.L4 == "220")
                {
                    Project_Sum pjt = new Project_Sum();
                    if (OBJ.Flag == 2)
                    {
                        pjt.S1 = "220";
                        pjt.S5 = "2";

                        IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                        foreach (Project_Sum ps in lt)
                        {
                            if (ps.T5 != null && ps.T5 != "")
                            {
                                if (!this.repositoryItemComboBox3.Items.Contains(ps.T5))
                                {
                                    this.repositoryItemComboBox3.Items.Add(ps.T5);
                                }
                            }
                        }
                    }

                    pjt.S1 = "220";
                    pjt.S5 = "1";

                    IList <Project_Sum> ltt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum pss in ltt)
                    {
                        if (pss.L1 != null && pss.L1 != "")
                        {
                            if (!this.repositoryItemComboBox10.Items.Contains(pss.L1))
                            {
                                this.repositoryItemComboBox10.Items.Add(pss.L1);
                            }
                        }
                    }
                }
                if (OBJ.L4 == "110")
                {
                    Project_Sum pjt = new Project_Sum();
                    if (OBJ.Flag == 2)
                    {
                        pjt.S1 = "110";
                        pjt.S5 = "2";

                        IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                        foreach (Project_Sum ps in lt)
                        {
                            if (ps.T5 != null && ps.T5 != "")
                            {
                                if (!this.repositoryItemComboBox3.Items.Contains(ps.T5))
                                {
                                    this.repositoryItemComboBox3.Items.Add(ps.T5);
                                }
                            }
                        }
                    }
                    pjt.S1 = "110";
                    pjt.S5 = "1";
                    IList <Project_Sum> ltt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum pss in ltt)
                    {
                        if (pss.L1 != null && pss.L1 != "")
                        {
                            if (!this.repositoryItemComboBox10.Items.Contains(pss.L1))
                            {
                                this.repositoryItemComboBox10.Items.Add(pss.L1);
                            }
                        }
                    }
                }
                if (OBJ.L4 == "35")
                {
                    Project_Sum pjt = new Project_Sum();
                    if (OBJ.Flag == 2)
                    {
                        pjt.S1 = "35";
                        pjt.S5 = "2";

                        IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                        foreach (Project_Sum ps in lt)
                        {
                            if (ps.T5 != null && ps.T5 != "")
                            {
                                if (!this.repositoryItemComboBox3.Items.Contains(ps.T5))
                                {
                                    this.repositoryItemComboBox3.Items.Add(ps.T5);
                                }
                            }
                        }
                    }

                    pjt.S1 = "35";
                    pjt.S5 = "1";
                    IList <Project_Sum> ltt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum pss in ltt)
                    {
                        if (pss.L1 != null && pss.L1 != "")
                        {
                            if (!this.repositoryItemComboBox10.Items.Contains(pss.L1))
                            {
                                this.repositoryItemComboBox10.Items.Add(pss.L1);
                            }
                        }
                    }
                }
                if (OBJ.L4 == "66")
                {
                    Project_Sum pjt = new Project_Sum();

                    if (OBJ.Flag == 2)
                    {
                        pjt.S1 = "66";
                        pjt.S5 = "2";

                        IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                        foreach (Project_Sum ps in lt)
                        {
                            if (ps.T5 != null && ps.T5 != "")
                            {
                                if (!this.repositoryItemComboBox3.Items.Contains(ps.T5))
                                {
                                    this.repositoryItemComboBox3.Items.Add(ps.T5);
                                }
                            }
                        }
                    }
                    pjt.S1 = "66";
                    pjt.S5 = "1";
                    IList <Project_Sum> ltt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum pss in ltt)
                    {
                        if (pss.L1 != null && pss.L1 != "")
                        {
                            if (!this.repositoryItemComboBox10.Items.Contains(pss.L1))
                            {
                                this.repositoryItemComboBox10.Items.Add(pss.L1);
                            }
                        }
                    }
                }
                if (OBJ.L4 == "500")
                {
                    Project_Sum pjt = new Project_Sum();
                    if (OBJ.Flag == 2)
                    {
                        pjt.S1 = "500";
                        pjt.S5 = "2";

                        IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                        foreach (Project_Sum ps in lt)
                        {
                            if (ps.T5 != null && ps.T5 != "")
                            {
                                if (!this.repositoryItemComboBox3.Items.Contains(ps.T5))
                                {
                                    this.repositoryItemComboBox3.Items.Add(ps.T5);
                                }
                            }
                        }
                    }
                    pjt.S1 = "500";
                    pjt.S5 = "1";
                    IList <Project_Sum> ltt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum pss in ltt)
                    {
                        if (pss.L1 != null && pss.L1 != "")
                        {
                            if (!this.repositoryItemComboBox10.Items.Contains(pss.L1))
                            {
                                this.repositoryItemComboBox10.Items.Add(pss.L1);
                            }
                        }
                    }
                }
            }

            if (e.Row.Properties.FieldName.ToString() == "L19")
            {
                Project_Sum pjt = new Project_Sum();
                if (e.Value.ToString() == "变电站")
                {
                    this.repositoryItemComboBox3.Items.Clear();
                    OBJ.Flag = 2;
                    pjt.S1   = OBJ.L4;
                    pjt.S5   = "2";

                    IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum ps in lt)
                    {
                        if (ps.T5 != null && ps.T5 != "")
                        {
                            if (!this.repositoryItemComboBox3.Items.Contains(ps.T5))
                            {
                                this.repositoryItemComboBox3.Items.Add(ps.T5);
                            }
                        }
                    }
                }
                else
                {
                    this.repositoryItemComboBox3.Items.Clear();
                    OBJ.Flag = 1;
                    pjt.S1   = OBJ.L4;
                    pjt.S5   = "1";

                    IList <Project_Sum> lt = Common.Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", pjt);

                    foreach (Project_Sum ps in lt)
                    {
                        if (ps.T5 != null && ps.T5 != "")
                        {
                            if (!this.repositoryItemComboBox10.Items.Contains(ps.T5))
                            {
                                this.repositoryItemComboBox10.Items.Add(ps.T5);
                            }
                        }
                    }
                }

                if (OBJ.Flag == 1)
                {
                    OBJ.L5            = "";
                    OBJ.L6            = "";
                    OBJ.L7            = "";
                    this.单台容量.Enabled = false;
                    this.主变台数.Enabled = false;
                }
                if (OBJ.Flag == 2)
                {
                    this.单台容量.Enabled = true;
                    this.主变台数.Enabled = true;
                }
            }

            this.vGridControl1.Refresh();
            return;
        }
Пример #13
0
        private void FrmEditProject_Load(object sender, EventArgs e)
        {
            SetData();
            string q1  = "";
            string q2  = "";
            string q3  = "";
            string q4  = "";
            string q5  = "";
            string q6  = "";
            string q7  = "";
            string q8  = "";
            string q9  = "";
            string q10 = "";
            string q11 = "";
            string q12 = "";

            int t1 = 0;

            PSP_PowerProValues_LangFang ppt = new PSP_PowerProValues_LangFang();

            ppt.ID    = poweruid;
            ppt.Flag2 = flag;

            PSP_PowerProValues_LangFang ps = Common.Services.BaseService.GetOneByKey <PSP_PowerProValues_LangFang>(ppt);

            if (ps != null)
            {
                groupBox1.Text = ps.Title;
                powerid        = ps.Code;
                t1             = ps.Flag;

                // q1 = ps.L1;
                // q2 = ps.L2;
                q3  = ps.L3;
                q4  = ps.L4;
                q5  = ps.L5;
                q6  = ps.L6;
                q7  = ps.L7;
                q8  = ps.L8;
                q9  = ps.L9;
                q10 = ps.L10.ToString();
                q11 = ps.L11;
                q12 = ps.L12.ToString();
            }


            LineInfo li22 = Common.Services.BaseService.GetOneByKey <LineInfo>(powerid);

            if (li22 != null || t1 == 1)
            {
                isline = true;
            }

            substation sb = Common.Services.BaseService.GetOneByKey <substation>(powerid);

            if (sb != null || t1 == 2)
            {
                isPower = true;
            }


            PowerProValues ppv = new PowerProValues();

            ppv.TypeID  = poweruid;
            ppv.TypeID1 = flag;
            IList <PowerProValues> listValues = Common.Services.BaseService.GetList <PowerProValues>("SelectPowerProValuesList", ppv);



            PowerProYears pps = new PowerProYears();

            pps.Flag = flag;
            IList <PowerProYears> li = Common.Services.BaseService.GetList <PowerProYears>("SelectPowerProYearsListByFlag", pps);

            lb = new Label[li.Count];
            te = new TextEdit[li.Count];

            int i = 0;


            //if (!isPower)
            // {
            ////lt1.Text = "设备名称:";
            ////lt1.Location = new Point(52, 27 + 33 * i);
            ////groupBox1.Controls.Add(lt1);

            ////tt1 = new TextEdit();
            ////tt1.Location = new Point(157, 26 + 33 * i);
            ////tt1.Size = new Size(231, 21);
            ////tt1.TextChanged += new EventHandler(tt1_TextChanged);
            ////tt1.Properties.DisplayFormat.FormatString = "n4";
            ////tt1.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            ////tt1.Properties.EditFormat.FormatString = "n4";
            ////tt1.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            ////tt1.Properties.Mask.EditMask = "#####0.####";
            ////tt1.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;


            ////groupBox1.Controls.Add(tt1);

            ////i++;

            ////lt2.Text = "台数:";
            ////lt2.Location = new Point(52, 27 + 33 * i);
            ////groupBox1.Controls.Add(lt2);

            ////tt2 = new TextEdit();
            ////tt2.Location = new Point(157, 26 + 33 * i);
            ////tt2.Size = new Size(231, 21);
            ////groupBox1.Controls.Add(tt2);

            ////i++;
            // }


            //if (!isline)
            {
                lt3.Text     = "工 程 名 称 :";
                lt3.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt3);

                // tt3 = new TextEdit();
                cb0.Location = new Point(157, 26 + 33 * i);
                cb0.Size     = new Size(231, 21);

                cb0.Properties.DisplayFormat.FormatString = "n0";
                cb0.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                cb0.Properties.EditFormat.FormatString    = "n0";
                cb0.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                // cb0.Properties.Mask.EditMask = "########";
                cb0.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;


                groupBox1.Controls.Add(cb0);

                i++;

                lt4.Text     = "电 压 等 级 :";
                lt4.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt4);



                // tt4 = new TextEdit();
                cb1.Location = new Point(157, 26 + 33 * i);
                cb1.Size     = new Size(231, 21);

                cb1.Properties.DisplayFormat.FormatString = "n4";
                cb1.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                cb1.Properties.EditFormat.FormatString    = "n4";
                cb1.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                // cb1.Properties.Mask.EditMask = "#####0.####";
                cb1.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;


                groupBox1.Controls.Add(cb1);
                i++;

                lt5.Text     = "主 变 台 数 :";
                lt5.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt5);

                //  tt5 = new TextEdit();
                cb2.Location = new Point(157, 26 + 33 * i);
                cb2.Size     = new Size(231, 21);

                cb2.Properties.DisplayFormat.FormatString = "####.##";
                cb2.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                cb2.Properties.EditFormat.FormatString    = "####.##";
                cb2.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                // cb2.Properties.Mask.EditMask = "P2";
                cb2.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;


                groupBox1.Controls.Add(cb2);
                i++;

                lt6.Text     = "单台容量(MVA):";
                lt6.Location = new Point(50, 27 + 33 * i);
                lt6.Width    = 105;
                groupBox1.Controls.Add(lt6);

                //tt6 = new TextEdit();
                cb3.Location = new Point(157, 26 + 33 * i);
                cb3.Size     = new Size(231, 21);

                cb3.Properties.DisplayFormat.FormatString = "n4";
                cb3.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                cb3.Properties.EditFormat.FormatString    = "n4";
                cb3.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                //  cb3.Properties.Mask.EditMask = "#####0.####";
                cb3.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;

                groupBox1.Controls.Add(cb3);

                i++;

                lt7.Text     = "建 设 形 式 :";
                lt7.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt7);

                //tt6 = new TextEdit();
                cb4.Location = new Point(157, 26 + 33 * i);
                cb4.Size     = new Size(231, 21);

                cb4.Properties.DisplayFormat.FormatString = "n4";
                cb4.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                cb4.Properties.EditFormat.FormatString    = "n4";
                cb4.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                // cb4.Properties.Mask.EditMask = "#####0.####";
                cb4.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;

                groupBox1.Controls.Add(cb4);

                i++;

                lt8.Text     = "线路长度(KM):";
                lt8.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt8);

                //tt6 = new TextEdit();
                tt4.Location = new Point(157, 26 + 33 * i);
                tt4.Size     = new Size(231, 21);

                tt4.Properties.DisplayFormat.FormatString = "n4";
                tt4.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                tt4.Properties.EditFormat.FormatString    = "n4";
                tt4.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                //  tt4.Properties.Mask.EditMask = "#####0.####";
                tt4.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;

                groupBox1.Controls.Add(tt4);

                i++;

                lt9.Text     = "导 线 型 号 :";
                lt9.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt9);

                //tt6 = new TextEdit();
                cb5.Location = new Point(157, 26 + 33 * i);
                cb5.Size     = new Size(231, 21);

                cb5.Properties.DisplayFormat.FormatString = "n4";
                cb5.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.None;
                cb5.Properties.EditFormat.FormatString    = "n4";
                cb5.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.None;
                // cb5.Properties.Mask.EditMask = "#####0.####";
                cb5.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.None;

                groupBox1.Controls.Add(cb5);

                i++;

                Project_Sum sum = new Project_Sum();
                sum.S5 = islineflag;
                sum.S1 = q4;
                IList <Project_Sum> list = Services.BaseService.GetList <Project_Sum>("SelectProject_SumByS1andS5", sum);
                upedit.Properties.DataSource = list;
                LookUpColumnInfo a = new LookUpColumnInfo();
                a.FieldName = "T3";
                a.Caption   = "接线形式";
                LookUpColumnInfo c = new LookUpColumnInfo();
                c.FieldName = "T2";
                c.Caption   = "出线规模";
                LookUpColumnInfo b = new LookUpColumnInfo();
                b.FieldName = "T1";
                b.Caption   = "主变台数及数量";
                LookUpColumnInfo d = new LookUpColumnInfo();
                d.Caption   = "静态投资";
                d.FieldName = "Num";
                LookUpColumnInfo nn = new LookUpColumnInfo();
                nn.FieldName = "Name";
                nn.Caption   = "编号";
                LookUpColumnInfo f = new LookUpColumnInfo();
                f.FieldName = "Type";
                f.Caption   = "类型";
                upedit.Properties.Columns.Add(f);
                upedit.Properties.Columns.Add(nn);
                upedit.Properties.Columns.Add(b);
                upedit.Properties.Columns.Add(c);
                upedit.Properties.Columns.Add(a);
                upedit.Properties.Columns.Add(d);
                upedit.Properties.DisplayMember = "Num";
                //upedit.Properties.SearchMode = SearchMode.AutoComplete;
                //upedit.Properties.AutoSearchColumnIndex = 5;
                upedit.Properties.DropDownRows = 5;
                upedit.Properties.PopupWidth   = 500;
                upedit.Properties.ShowHeader   = true;

                lt10.Text     = "投 资 造 价 :";
                lt10.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt10);
                upedit.Location = new Point(157, 26 + 33 * i);
                upedit.Size     = new Size(231, 21);
                upedit.Properties.DisplayFormat.FormatString = "n4";
                upedit.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                upedit.Properties.EditFormat.FormatString    = "n4";
                upedit.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                upedit.Properties.Mask.EditMask  = "###############0.####";
                upedit.Properties.Mask.MaskType  = DevExpress.XtraEditors.Mask.MaskType.Numeric;
                upedit.Properties.AllowNullInput = DevExpress.Utils.DefaultBoolean.True;
                upedit.TextChanged += new EventHandler(upedit_TextChanged);
                groupBox1.Controls.Add(upedit);

                i++;

                lt11.Text     = "造 价 比 列 :";
                lt11.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt11);

                //tt6 = new TextEdit();
                tt6.Location = new Point(157, 26 + 33 * i);
                tt6.Size     = new Size(231, 21);

                tt6.Properties.DisplayFormat.FormatString = "n4";
                tt6.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                tt6.Properties.EditFormat.FormatString    = "n4";
                tt6.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                tt6.Properties.Mask.EditMask = "###############0.####";
                tt6.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
                tt6.TextChanged += new EventHandler(tt6_TextChanged);
                groupBox1.Controls.Add(tt6);

                i++;

                lt12.Text     = "工 程 总 价 :";
                lt12.Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lt12);

                //tt6 = new TextEdit();
                tt5.Location = new Point(157, 26 + 33 * i);
                tt5.Size     = new Size(231, 21);

                tt5.Properties.DisplayFormat.FormatString = "n4";
                tt5.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Numeric;
                tt5.Properties.EditFormat.FormatString    = "n4";
                tt5.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Numeric;
                tt5.Properties.Mask.EditMask = "###############0.####";
                tt5.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;

                groupBox1.Controls.Add(tt5);

                i++;
            }

            int j = 0;

            foreach (PowerProYears ppy in li)
            {
                lb[j]          = new Label();
                lb[j].Name     = "Label" + ppy.Year;
                lb[j].Text     = ppy.Year + ":";
                lb[j].Location = new Point(52, 27 + 33 * i);
                groupBox1.Controls.Add(lb[j]);

                te[j]          = new TextEdit();
                te[j].Name     = "Text" + ppy.Year;
                te[j].Location = new Point(157, 26 + 33 * i);
                te[j].Size     = new Size(231, 21);
                groupBox1.Controls.Add(te[j]);

                foreach (PowerProValues ppy1 in listValues)
                {
                    if (ppy.Year == ppy1.Year)
                    {
                        te[j].Text = ppy1.Value;
                    }
                }
                j++;
                i++;
            }

            if (isline)
            {
                try
                {
                    // cb5.Properties.Items.Contains(q9.ToString());

                    //tt1.Text = q3.ToString();
                    //tt2.Text = q4.ToString();

                    //if (li22 != null)
                    //{
                    //    tt1.Text = li22.Length;
                    //    tt2.Text = li22.LineType;
                    //}
                }
                catch { }
            }
            if (isPower)
            {
                try
                {
                    ////tt3.Text = q1.ToString();
                    //tt4.Text = q4.ToString();
                    //tt5.Text = q5.ToString();
                    //tt6.Text = q6.ToString();

                    //if (sb != null)
                    //{
                    //    tt5.Text = sb.Number.ToString();
                    //    tt4.Text = sb.ObligateField2;
                    //    tt6.Text = sb.Burthen.ToString();
                    //}
                }
                catch { }
            }

            PSP_PowerProValues_LangFang pplf = new PSP_PowerProValues_LangFang();

            pplf.Flag2 = flag;

            IList <PSP_PowerProValues_LangFang> plfs = Common.Services.BaseService.GetList <PSP_PowerProValues_LangFang>("SelectPSP_PowerProValues_LangFangByFlag2OrderL3", pplf);

            tt4.Text = q8.ToString();
            tt5.Text = q10.ToString();
            tt6.Text = q12.ToString();

            if (plfs.Count == 0)
            {
                cb0.Text = "";
            }
            foreach (PSP_PowerProValues_LangFang pv in plfs)
            {
                if (pv.L3 != "" && pv.L3.Length > 0)
                {
                    cb0.Properties.Items.Add(pv.L3);
                }
            }
            cb0.Text   = q3.ToString();
            cb1.Text   = q4.ToString();
            cb2.Text   = q5.ToString();
            cb3.Text   = q6.ToString();
            cb4.Text   = q7.ToString();
            cb5.Text   = q9.ToString();
            lookupedit = q11;
            upedit.Properties.NullText = q11;
            groupBox1.Size             = new Size(434, 40 + 33 * i);
            simpleButton1.Location     = new Point(296, 60 + 33 * i);
            simpleButton2.Location     = new Point(389, 60 + 33 * i);
            this.Size = new Size(490, 130 + 33 * i);
        }