Exemplo n.º 1
0
 public _Engineering(_COBJECTS p_Info)
     : base(p_Info)
 {
     //主目录对象(单项工程不在独立创建取消此方法)
     this.ImageIndex = 1;
     this.Directory  = new _Directory(this);
 }
Exemplo n.º 2
0
        /// <summary>
        /// 添加一个已经存在的单项工程对象到当前项目下
        /// </summary>
        /// <param name="p_Info"></param>
        /// <returns></returns>
        public override _COBJECTS Add(_COBJECTS p_Info)
        {
            p_Info.Parent = this;
            this.Clone(p_Info);
            p_Info.PID  = this.ID;
            p_Info.Deep = 1;
            //初始化项目编码
            p_Info.CODE = this.CODE + p_Info.Sort.ToString().PadLeft(3, '0');
            p_Info.Sort = (this.Parent as _Projects).UnSort++;
            this.Parent.StructSource.ModelProject.Add(p_Info);
            return(p_Info);

            /*p_Info.Directory = new _Directory(p_Info);
             * p_Info.Parent = this;
             * p_Info.ObjectState = EObjectState.Created;
             * p_Info.Directory.PKey = this.Directory.Key;
             * //项目是唯一的每个新项目都从当前0开始标识
             * p_Info.Directory.ImageIndex = 2;
             * p_Info.Directory.Deep = 2;
             * //通过项目创建单项工程对象时候自动继承项目的属性数据
             * string name = p_Info.Property.Basis.Name;
             * p_Info.Property.Basis = this.Property.Basis.Copy() as _CBasis;
             * p_Info.Property.Name = name;
             * //初始化项目编码
             * p_Info.Property.Code = this.Property.Basis.CODE + p_Info.Directory.Sort.ToString().PadLeft(3, '0');
             * return base.Add(p_Info);*/
        }
Exemplo n.º 3
0
        /// <summary>
        /// 指定项目统计结果汇总到当前对象中
        /// </summary>
        /// <param name="info"></param>
        public void Add(_COBJECTS info)
        {
            if (info == null)
            {
                return;
            }
            DataTable table = info.Property.Statistics.ResultVarable.DataSource;

            if (table == null)
            {
                return;
            }
            //循环集合为当前对象添加
            string key = string.Empty;

            foreach (DataRow row in table.Rows)
            {
                key = row["Key"].ToString();
                //新加入的值
                decimal ovalue = info.Property.Statistics.ResultVarable.GetDecimal(key);
                //原来的值
                decimal cvalue = this.ResultVarable.GetDecimal(key);
                this.ResultVarable.Set(key, cvalue + ovalue, row["Remark"].ToString());
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 初始化单位工程
        /// </summary>
        /// <param name="p_info"></param>
        public override void InitDataObject(GOLDSOFT.QDJJ.COMMONS._COBJECTS p_Info)
        {
            //初始化属性
            p_Info.Property.DLibraries.FixedLibrary.Rule    = p_Info.DEGZ;
            p_Info.Property.DLibraries.FixedLibrary.LibName = p_Info.DELibName;
            p_Info.Property.DLibraries.AtlasGallery.LibName = p_Info.TJLibName;
            p_Info.Property.DLibraries.ListGallery.Rule     = p_Info.QDGZ;
            p_Info.Property.DLibraries.ListGallery.LibName  = p_Info.QDLibName;
            //_Library
            //初始化库
            p_Info.Property.DLibraries.Init(APP.Application);
            //初始化新的临时对象(不参与序列化此对象每次使用需要呗初始化)
            p_Info.Property.Temporary = new _Temporary();
            //默认同步临时库对象
            p_Info.Property.Temporary.Libraries = p_Info.Property.DLibraries.Copy();
            p_Info.Property.Temporary.Libraries.Init(APP.Application);
            p_Info.Property.IncreaseCosts.init();//初始化子目取费
            _UnitProject m_UnitProject = p_Info as _UnitProject;

            if (m_UnitProject != null)
            {
                if (m_UnitProject.StructSource.ModelUnitFee.Rows.Count == 0 || m_UnitProject.StructSource.ModelPSubheadingsFee.Rows.Count == 0)
                {
                    _Methods_ParamsSeting m_Methods_ParamsSeting = new _Methods_ParamsSeting(m_UnitProject);
                    m_Methods_ParamsSeting.Init();
                    DataRow[] m_MRGCQF = m_UnitProject.StructSource.ModelUnitFee.Select(string.Format("GCLB='{0}'", m_UnitProject.ProType));
                    if (m_MRGCQF.Length == 0)
                    {
                        m_UnitProject.ProType = m_UnitProject.StructSource.ModelUnitFee.Rows[0]["GCLB"].ToString();
                    }
                }
            }
        }
Exemplo n.º 5
0
        public override void UpDate(object p_Info)
        {
            _COBJECTS obj = p_Info as _COBJECTS;

            if (obj != null)
            {
                DataRow row = this.Rows.Find(obj.ID);
                Type    tp  = p_Info.GetType();
                if (row != null)
                {
                    row.BeginEdit();
                    //循环列添加数据对象
                    foreach (DataColumn col in this.Columns)
                    {
                        PropertyInfo info = tp.GetProperty(col.ColumnName);
                        if (info != null)
                        {
                            if (info.Name != "ID")
                            {
                                row[col] = Convert.ChangeType(info.GetValue(p_Info, null), info.PropertyType);
                            }
                        }
                    }
                    row.EndEdit();
                }
            }
        }
Exemplo n.º 6
0
        public _Reveal(_COBJECTS p_Info)
        {
            if (p_Info is _Projects)
            {
                //1.汇总分析 2.分部分项 3.措施项目
                m_Result = new _List[4] { new _List(), new _List(), new _List(), new _List() };
                this.m_ObjMetaanalysis = new _ProMetaanalysis(p_Info);
                this.m_ProSubSegment = new _Pro_SubSegment(p_Info);
                this.m_ProMeasures = new _ProMeasures(p_Info);
                this.m_Attributes = new _Pro_Attr(p_Info);
            }

            if (p_Info is _Engineering)
            {
                this.m_ObjMetaanalysis = new _EngMetaanalysis(p_Info);
                this.m_ProSubSegment = new _En_SubSegment(p_Info);
                this.m_ProMeasures = new _EnMeasures(p_Info);
                this.m_Attributes = new _En_Attr(p_Info);
            }

            if (p_Info is _UnitProject)
            {
                this.m_ObjMetaanalysis = new _UnMetaanalysis(p_Info);
                this.m_ProSubSegment = new _Un_SubSegment(p_Info);
                this.m_ProMeasures = new _UnMeasures(p_Info);
                this.m_Attributes = new _Un_Attr(p_Info);
            }
        }
Exemplo n.º 7
0
 public _Projects(_COBJECTS p_Info)
     : base(p_Info)
 {
     //项目的状态默认为已经创建结束,自身并不属于某个容器中
     this.ImageIndex  = 0;
     this.ObjectState = EObjectState.Created;
 }
Exemplo n.º 8
0
 /// <summary>
 /// 克隆当前基础数据成员
 /// </summary>
 public virtual void Clone(_COBJECTS p_Info)
 {
     p_Info.QDGZ   = this._qdgz;
     p_Info.DEGZ   = this._degz;
     p_Info._pgcdd = this._pgcdd;
     p_Info._pjfcx = this._pjfcx;
     p_Info._pnsdd = this._pnsdd;
 }
Exemplo n.º 9
0
 /// <summary>
 /// 删除当前单位工程数据(删除后自动提交)
 /// </summary>
 /// <param name="p_Info"></param>
 public virtual void DeleteData(_COBJECTS p_Info)
 {
     DataRow[] rows = this.Select(string.Format(" UnID = {0} and ID <> -1", p_Info.ID));
     foreach (DataRow row in rows)
     {
         this.Rows.Remove(row);
     }
     this.AcceptChanges();
 }
Exemplo n.º 10
0
 /// <summary>
 /// 项目中删除调用
 /// </summary>
 /// <param name="p_Info"></param>
 public override void DeleteData(_COBJECTS p_Info)
 {
     DataRow[] rows = this.Select(string.Format(" ID = {0} ", p_Info.ID));
     foreach (DataRow row in rows)
     {
         this.Rows.Remove(row);
     }
     //this.AcceptChanges();
 }
Exemplo n.º 11
0
        /// <summary>
        /// 如果单位工程是项目中取得此处同步基础属性的值
        /// </summary>
        /// <param name="p_Info"></param>
        public virtual void Synchronous(_COBJECTS p_Info)
        {
            DataRow row = this.Rows.Find(p_Info.ID);

            if (row != null)
            {
                _ObjectSource.GetObject(p_Info, row);
            }
        }
Exemplo n.º 12
0
 /// <summary>
 /// 添加一个已经存在的单项工程对象到当前项目下
 /// </summary>
 /// <param name="p_Info"></param>
 /// <returns></returns>
 public override _COBJECTS Add(_COBJECTS p_Info)
 {
     this.Clone(p_Info);
     p_Info.PID  = this.ID;
     p_Info.Deep = 1;
     //初始化项目编码
     p_Info.Property.Basis.CODE = this.Property.Basis.CODE + p_Info.Directory.Sort.ToString().PadLeft(3, '0');
     this.StructSource.ModelProject.Add(p_Info);
     return(p_Info);
 }
Exemplo n.º 13
0
        /// <summary>
        /// 获取当前对象的一个副本
        /// </summary>
        /// <param name="p_Info">获取的副本必须重新设置所属数据对象</param>
        /// <returns></returns>
        public _Directory Copy(_COBJECTS p_Info)
        {
            _Directory info = new _Directory(p_Info);

            info.m_Key        = this.m_Key;
            info.m_PKey       = this.m_PKey;
            info.m_NodeName   = p_Info.Property.Name;
            info.m_ImageIndex = this.m_ImageIndex;
            info.m_Deep       = this.m_Deep;
            info.m_Sort       = this.m_Sort;
            return(info);
        }
Exemplo n.º 14
0
        /// <summary>
        /// 给当前数据行追加单位工程对象
        /// </summary>
        /// <param name="p_Info"></param>
        public virtual void AppendUnit(_COBJECTS p_Info)
        {
            DataRow row = this.Rows.Find(p_Info.ID);

            //DataRowState rs = row.RowState;

            row["UnitProject"] = p_Info;

            /*if (rs == DataRowState.Unchanged)
             * {
             *  row.AcceptChanges();
             * }*/
        }
Exemplo n.º 15
0
 /// <summary>
 /// 项目中删除单位工程(项目使用)
 /// </summary>
 /// <param name="p_Info">要删除的单位工程</param>
 public void DeleteUnit(_COBJECTS p_Info)
 {
     //删除项目解表
     if (ModelProject != null)
     {
         this.ModelProject.Delete(p_Info);
     }
     //清空数据对象
     p_Info.StructSource.UnitClear();
     if (ModelSubSegments != null)
     {
         this.ModelSubSegments.DeleteData(p_Info);
     }
     if (ModelMeasures != null)
     {
         this.ModelMeasures.DeleteData(p_Info);
     }
     if (ModelOtherProject != null)
     {
         this.ModelOtherProject.DeleteData(p_Info);
     }
     if (ModelProjVariable != null)
     {
         this.ModelProjVariable.DeleteData(p_Info);
     }
     if (ModelQuantity != null)
     {
         this.ModelQuantity.DeleteData(p_Info);
     }
     if (ModelQuantity != null)
     {
         this.ModelQuantity.DeleteData(p_Info);
     }
     if (ModelMetaanalysis != null)
     {
         this.ModelMetaanalysis.DeleteData(p_Info);
     }
     if (ModelPSubheadingsFee != null)
     {
         this.ModelPSubheadingsFee.DeleteData(p_Info);
     }
     if (ModelProjVariable != null)
     {
         this.ModelProjVariable.DeleteRows("ID", p_Info.ID + "");
     }
 }
Exemplo n.º 16
0
        /// <summary>
        /// 为指定单位工程重新设置关系数据(导入单位工程的时候使用)
        /// </summary>
        /// <param name="p_Info"></param>
        public void SetNewFiled(_COBJECTS p_Info)
        {
            //同步定单位工程的关系数据
            //分部分项处理
            int      i    = 0;
            DataView view = this.DefaultView;

            view.Sort = "ID asc";
            foreach (DataRowView row in view)
            {
                ///设置为新增的对象
                row.Row.SetAdded();
                row["ID"]   = p_Info.ID;
                row["EnID"] = p_Info.PID;
                i++;
            }
            view.Sort = string.Empty;
        }
Exemplo n.º 17
0
 public _StatusInfo(_COBJECTS p_obj)
 {
     this.Current = p_obj;
 }
Exemplo n.º 18
0
 /// <summary>
 /// 构造一个源数据对象
 /// </summary>
 /// <param name="p_info">此数据对象所属创造类型</param>
 public _COBJECTS(_COBJECTS p_info)
 {
     m_Parent = p_info;
     this.Init();
 }
Exemplo n.º 19
0
        /// <summary>
        /// 直接添加到项目数据源中
        /// </summary>
        /// <returns></returns>
        public virtual _COBJECTS Add(_COBJECTS p_Info)
        {
            this.StrustObject.Add(p_Info.Directory.Key, p_Info);

            return(p_Info);
        }
Exemplo n.º 20
0
 public _ProjectObjectInfo(_COBJECTS p_Info)
 {
     this.m_Parent = p_Info;
 }
Exemplo n.º 21
0
 public TemporaryCalculate(_COBJECTS p_Parent)
 {
     this.m_Parent = p_Parent;
 }
Exemplo n.º 22
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="p_info"></param>
 public _ObjMetaanalysis(_COBJECTS p_info)
 {
     this.m_Parent = p_info;
 }
Exemplo n.º 23
0
 public _En_Attr(_COBJECTS p_Info)
 {
     this.m_Parent = p_Info;
 }
Exemplo n.º 24
0
 public _Property(_COBJECTS p_Info)
 {
     this.m_Parent = p_Info;
 }
Exemplo n.º 25
0
 public _En_Property(_COBJECTS p_Info) : base(p_Info)
 {
 }
Exemplo n.º 26
0
 public _EngMetaanalysis(_COBJECTS p_Info) : base(p_Info)
 {
 }
Exemplo n.º 27
0
 public _En_SubSegment(_COBJECTS p_Info)
     : base(p_Info)
 {
 }
Exemplo n.º 28
0
 /// <summary>
 /// 数据配置对象的构造函数
 /// </summary>
 public _Setting(_COBJECTS p_Info)
 {
     this.m_Parent = p_Info;
     //this.m_ColumnLayout = new _ColumnLayout();
 }
Exemplo n.º 29
0
 public _EnMeasures(_COBJECTS p_Info)
     : base(p_Info)
 {
 }
Exemplo n.º 30
0
 public _UnitProject(_COBJECTS p_Info)
     : base(p_Info)
 {
     this.ImageIndex = 2;
     this.Directory  = new _Directory(this);
 }