Example #1
0
        /// <summary>
        /// 为指定单位工程重新设置关系数据(导入单位工程的时候使用)
        /// </summary>
        /// <param name="p_ObjectKey"></param>
        /// <param name="p_Info"></param>
        public virtual void SetNewFiled(ref int p_ObjectKey, _UnitProject p_Info)
        {
            foreach (_ObjectSource table in p_Info.StructSource.Tables)
            {
                if (!table.TableName.Equals("项目结构表"))
                {
                    try
                    {
                        table.SetNewFiled(ref p_ObjectKey, p_Info);
                    }
                    catch (Exception e)
                    {
                        throw e;
                    }
                }
            }
            //同步定单位工程的关系数据
            //分部分项处理

            /*this.ModelSubSegments.SetNewFiled(ref p_ObjectKey, p_Info);
             * //措施项目
             * this.ModelMeasures.SetNewFiled(ref p_ObjectKey, p_Info);
             * //其他项目
             * this.ModelOtherProject.SetNewFiled(ref p_ObjectKey, p_Info);
             * //工料机
             * this.ModelQuantity.SetNewFiled(ref p_ObjectKey, p_Info);
             * //单位工程变量
             * this.ModelProjVariable.SetNewFiled(p_Info);*/
            //
        }
Example #2
0
        public string GetRepairBH(_UnitProject p_CUnitProject, string p_LB)
        {
            DataRow[] list = p_CUnitProject.StructSource.ModelQuantity.Select(string.Format("BH like '%补充{0}%'", p_LB), "BH");
            if (list.Count() == 0)
            {
                return("补充" + p_LB + "0001");
            }
            for (int i = 0, j = 1; j < list.Count(); i++, j++)
            {
                int info_i = ToolKit.ParseInt(list[i]["BH"].ToString().Substring(4));
                int info_j = ToolKit.ParseInt(list[j]["BH"].ToString().Substring(4));
                if ((info_j - info_i) > 1)
                {
                    return("补充" + p_LB + (info_i + 1).ToString("0000"));
                }
            }

            int info_b = ToolKit.ParseInt(list.First()["BH"].ToString().Substring(4));

            if (info_b == 1)
            {
                return("补充" + p_LB + (ToolKit.ParseInt(list.Last()["BH"].ToString().Substring(4)) + 1).ToString("0000"));
            }
            else
            {
                return("补充" + p_LB + "0001");
            }
        }
Example #3
0
 public _ParameterSettings(_UnitProject p_Parent)
 {
     this.m_Parent = p_Parent;
     this.m_YSSubheadingsFeeList = new _YSSubheadingsFeeList(this);
     this.m_YSUnitFeeList        = new _UnitFeeList(this);
     this.m_UnitFeeList          = new _UnitFeeList(this);
 }
Example #4
0
        /// <summary>
        /// 为指定单位工程重新设置关系数据(导入单位工程的时候使用)
        /// </summary>
        /// <param name="p_ObjectKey"></param>
        /// <param name="p_Info"></param>
        public override void SetNewFiled(ref int p_ObjectKey, _UnitProject p_Info)
        {
            //同步定单位工程的关系数据
            //分部分项处理
            int      i    = 0;
            DataView view = this.DefaultView;

            view.Sort = "ID asc";
            foreach (DataRowView row in view)
            {
                ///设置为新增的对象
                row.Row.SetAdded();
                if (row["LB"].Equals("分部-章") || row["LB"].Equals("分部-节") || row["LB"].Equals("分部-专业"))
                {
                }
                else
                {
                    row["Key"]  = p_ObjectKey + ToolKit.ParseInt(row["ID"]);
                    row["PKey"] = p_ObjectKey + ToolKit.ParseInt(row["FPARENTID"]);
                }
                row["UnID"] = p_Info.ID;
                row["EnID"] = p_Info.PID;
                if (i == 0)
                {
                    row["PKey"] = p_Info.PKey;
                }
                i++;
            }
            p_ObjectKey = ToolKit.ParseInt(view[view.Count - 1]["Key"]);
            view.Sort   = string.Empty;
        }
Example #5
0
        /// <summary>
        /// 保存措施项目
        /// </summary>
        /// <param name="path"></param>
        public void MeasuresProjectSave(string path)
        {
            //SetTYQD();
            _UnitProject u = this.MeasuresProject.Parent;

            this.MeasuresProject.Parent = null;
            CFiles.BinarySerialize(this.MeasuresProject, path);
            this.MeasuresProject.Parent = u;
        }
Example #6
0
 /// <summary>
 /// 删除指定单位工程中的数据(当前业务计算使用 删除不包含ID是-1的数据)
 /// </summary>
 /// <param name="info"></param>
 public void ProjClearCalculate(_UnitProject info)
 {
     //工料机
     this.ModelQuantity.DeleteData(info);
     this.ModelSubSegments.DeleteData(info);
     this.ModelMeasures.DeleteData(info);
     this.ModelOtherProject.DeleteData(info);
     //this.ModelProjVariable.DeleteData(info);
 }
Example #7
0
 public _OtherProject(_UnitProject m_Parent)
 {
     this.m_Parent = m_Parent;
     //this.Activitie = m_Parent;
     //  this.m_Statistics = new _OtherProject_Statistics(this);
     this.m_Source = new DataTable();
     //this.init();
     // init();
 }
Example #8
0
 /// <summary>
 /// 措施项目的构造 父类为单位工程
 /// </summary>
 /// <param name="p_Parent"></param>
 public _MeasuresProject(_UnitProject p_Parent)
 {
     //当前父类
     this.m_Parent = p_Parent;
     //this.Activitie = p_Parent;
     m_ObjectsList = new _List();
     //当前措施项目下的所有通用项目集合
     this.Statistics = new _Measures_Statistics(this);
     init();
     //Load();
 }
Example #9
0
        /// <summary>
        /// 添加新的保存记录对象
        /// </summary>
        public string NewSave(_UnitProject p_info)
        {
            DataRow row = this.m_HistoryTable.NewRow();

            row["Name"]     = p_info.Property.Basis.Name;
            row["Date"]     = DateTime.Now;
            row["FileName"] = p_info.Property.Basis.Name + "-" + DateTime.Now.ToString("yyyyMMdd") + "_" + row["Key"] + _Files.单位工程备份扩展名;
            row["IsUse"]    = true;
            this.m_HistoryTable.Rows.Add(row);
            return(row["FileName"].ToString());
        }
Example #10
0
        /// <summary>
        /// 跟换单位工程关系
        /// </summary>
        /// <param name="p_ObjectKey"></param>
        /// <param name="p_Info"></param>
        public virtual void SetNewFiled(ref int p_ObjectKey, _UnitProject p_Info)
        {
            try
            {
                //同步定单位工程的关系数据
                //分部分项处理
                //int i = 0;
                DataView view = this.DefaultView;

                /*
                 * 田楠
                 * 获取当前打开表名字
                 * 如果是{项目变量表}
                 * 则更换ID
                 * **/
                string tableName = view.Table.TableName.ToString();
                if (tableName == "项目变量表")
                {
                    view.Sort = "ID asc";
                    foreach (DataRowView row in view)
                    {
                        row["ID"] = p_Info.ID;
                    }
                    view.Sort = string.Empty;
                }

                if (view.Table.Columns.Contains("UnID") && view.Table.Columns.Contains("EnID"))
                {
                    view.Sort = "ID asc";
                    foreach (DataRowView row in view)
                    {
                        ///设置为新增的对象
                        row.Row.SetAdded();
                        //row["Key"] = p_ObjectKey + ToolKit.ParseInt(row["ID"]);
                        //row["PKey"] = p_ObjectKey + ToolKit.ParseInt(row["ParentID"]);
                        row["UnID"] = p_Info.ID;
                        row["EnID"] = p_Info.PID;
                        //if (i == 0)
                        //{
                        //    row["PKey"] = p_Info.Key;
                        //}
                        //i++;
                    }
                    //p_ObjectKey = ToolKit.ParseInt(view[view.Count - 1]["Key"]);
                    view.Sort = string.Empty;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #11
0
        /// <summary>
        /// 读取文件
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static _Projects BinaryDeserializeByProject(string fileName)
        {
            try
            {
                using (FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
                {
                    BinaryFormatter formater = new BinaryFormatter();
                    long            lenth    = stream.Length;
                    ArrayList       list11   = new ArrayList();
                    _Projects       proj     = null;
                    _Engineering    en       = null;

                    while (stream.Position != lenth)
                    {
                        object obj = formater.Deserialize(stream);
                        if (obj is _Projects)
                        {
                            proj = obj as _Projects;
                            proj.StrustObject = new _DataObjectList();
                        }
                        if (proj != null)
                        {
                            if (obj is _Engineering)
                            {
                                en              = obj as _Engineering;
                                en.Parent       = proj;
                                en.StrustObject = new _DataObjectList();
                                proj.StrustObject.Add(en.Directory.Key, en);
                            }
                            if (obj is _UnitProject)
                            {
                                _UnitProject un = obj as _UnitProject;
                                un.Parent = en;
                                en.StrustObject.Add(un.Directory.Key, un);
                            }
                        }
                    }
                    return(proj);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Example #12
0
        //private _Statistics m_Statistics = null;
        ///// <summary>
        ///// 获取或设置:分部分项计算结果
        ///// </summary>
        //public _Statistics Statistics
        //{
        //    get { return m_Statistics; }
        //    set { m_Statistics = value; }
        //}


        /// <summary>
        /// 分部分项构造函数
        /// </summary>
        /// <param name="p_Parent">所属于单位工程</param>
        public _SubSegments(_UnitProject p_Parent)
        {
            //当前父类
            this.m_Parent = p_Parent;
            //this.Activitie = p_Parent;
            //用于处理分部分项方法集
            this.m_Methods = new _Methods(this);
            //返回所有的对象集合
            this.m_ObjectsList = new _List();
            //清单集合
            //this.m_FixedList = new _FixedsList(this);
            m_BindingSource = new BindingSource();
            //计算类
            Statistics         = new _SubSegment_Statistics(this);
            m_FixedList        = new List <_FFixedListInfo>();
            m_ProfessionalList = new List <_ProfessionalInfo>();
            //第一次创建分部分项的时候需要初始化当前对象
            init();
            //测试
            //_FixedListInfo info = new _FixedListInfo();
            //this.m_FixedList.Add(info);
        }
Example #13
0
        /// <summary>
        /// 创建一个子对象(仅获取一个新的单位工程对象)
        /// 如果单位工程是此方法调用获得说明单位工程属于项目中的单位工程
        /// </summary>
        /// <returns></returns>
        public new _UnitProject Create()
        {
            _UnitProject info = new _UnitProject(this);

            this.Clone(info);
            info.PID  = this.ID;
            info.Deep = 2;
            //此处添加可能的排序
            info.Sort = (this.Parent as _Projects).UnSort + 1;
            this.Clone(info);
            //初始化项目编码
            info.CODE = this.CODE + info.Sort.ToString().PadLeft(3, '0');
            return(info);

            /*info.ObjectState = EObjectState.Creating;
             * info.Directory.PKey = this.Directory.Key;
             * info.Directory.ImageIndex = 2;
             * info.Directory.Deep = 2;
             * //通过项目创建单项工程对象时候自动继承项目的属性数据
             * info.Property.Basis = this.Property.Basis.Copy() as _CBasis;
             * //初始化项目编码
             * info.Property.Code = this.Property.Basis.CODE + info.Directory.Sort.ToString().PadLeft(3, '0');
             * return info;*/
        }
Example #14
0
 public _IncreaseCosts(_UnitProject p_Parent)
 {
     this.m_Parent = p_Parent;
     //this.Activitie = p_Parent;
 }
Example #15
0
 public YTLBSummaryInfo(_UnitProject p_Parent)
 {
     this.m_Parent = p_Parent;
 }
Example #16
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public _Metaanalysis(_UnitProject p_Parent)
 {
     this.m_Parent = p_Parent;
     //this.builder();
 }
Example #17
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="p_Parent"></param>
 public _Project_Statistics(_UnitProject p_Parent)
     : base()
 {
     this.m_Parent = p_Parent;
 }
Example #18
0
 public void RemoveParent()
 {
     this.m_Parent = null;
 }
Example #19
0
 public void SetParent(_UnitProject p_Parent)
 {
     this.m_Parent = p_Parent;
 }