Esempio n. 1
0
        public static _Methods CreateIntace(_Business m_Currentbus, _UnitProject p_un, _Entity_SubInfo info)
        {
            _Methods m = new _Methods(m_Currentbus, p_un, info);

            switch (info.LB)
            {
            case "分部-专业":
                m = new _Methods_Pro(m_Currentbus, p_un, info);
                break;

            case "分部-章":
                m = new _Method_Chapt(m_Currentbus, p_un, info);
                break;

            case "分部-节":
                m = new _Method_Fest(m_Currentbus, p_un, info);
                break;

            case "清单":
                m = new _Methods_Fixed(m_Currentbus, p_un, info);
                break;

            case "子目":
                m = new _Methods_Subheadings(m_Currentbus, p_un, info);
                break;

            default:
                break;
            }
            return(m);
        }
Esempio n. 2
0
        private void CreateZM(DataRow row, _Entity_SubInfo info, bool Is_th, string strBEIZHU)
        {
            APP.UserPriceLibrary.AllQuantityUnit = this.Unit.StructSource.ModelQuantity;
            APP.UserPriceLibrary.UnName          = this.Unit.Name;
            APP.UserPriceLibrary.Range           = 1;

            _Entity_SubInfo sinfo = new _Entity_SubInfo();

            //sinfo.ISXSHS = false;
            SetZM(row, sinfo, strBEIZHU);
            //info.Create(sinfo);
            if (row["WZLX"].Equals("措施项目"))
            {
                if (_Constant.超高定额号.IndexOf("'" + sinfo.OLDXMBM + "'") != -1)
                {
                    ChangeDECJ(sinfo);
                }
                //根据位置找清单
                DataRow[] rows = this.Unit.StructSource.ModelMeasures.Select("XMBM='" + row["WZ"] + "'", "id desc");
                if (rows.Length > 0)
                {
                    _Entity_SubInfo info1 = new _Entity_SubInfo();
                    _ObjectSource.GetObject(info1, rows[0]);
                    DataRow[] rowsDE = this.Unit.StructSource.ModelMeasures.Select(string.Format(" ZDSC=True and XMBM='{0}' and PID='{1}'", row["DEBH"], info1.ID), "id desc");
                    int       m_Sort = -1;
                    if (Is_th && rowsDE.Length > 0)
                    {
                        m_Sort = ToolKit.ParseInt(rowsDE[0]["Sort"]);
                        rowsDE[0].Delete();
                    }
                    this.methods_Fixed = new _Mothods_MFixed(this.CurrentBusiness, this.Unit, info1);
                    sinfo.ZDSC         = true;
                    this.methods_Fixed.Create(m_Sort, sinfo);
                }
            }
            else
            {
                this.methods_Fixed.Current = info;
                this.methods_Fixed.CreateByGCXX(-1, sinfo);
            }
            if (!string.IsNullOrEmpty(row["ZCMCTH"].ToString()))
            {
                DataRow[] drs = this.Unit.StructSource.ModelQuantity.Select(string.Format("SSLB={0} AND ZMID={1} AND LB='主材'", sinfo.SSLB, sinfo.ID));
                foreach (DataRow item in drs)
                {
                    item.BeginEdit();
                    item["MC"] = row["ZCMCTH"];
                    APP.UserPriceLibrary.Update("MC", item["MC", DataRowVersion.Current], item);
                    item.EndEdit();
                }
            }
        }
Esempio n. 3
0
        public override void Calculate()
        {
            DataRow[] rows = this.GetDataSource.Select(string.Format("PID={0}", this.Current.ID), "", DataViewRowState.CurrentRows);

            foreach (DataRow item in rows)
            {
                _Entity_SubInfo info = new _Entity_SubInfo();
                _ObjectSource.GetObject(info, item);
                _Methods_Fixed met = new _Methods_Fixed(this.CurrentBusiness, this.Unit, info);
                met.Calculate();
            }
            _SubSegment_Statistics sta = new _SubSegment_Statistics(this.Current, this.Unit);

            sta.DataSource = this.GetDataSource;
            sta.Begin();
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="IsTh">0替换1增加</param>
        /// <param name="type">0复用含量1复用工程量</param>
        /// <param name="p_frominfo"></param>
        /// <param name="p_Toinfo"></param>
        private void SubhendingToFix(int IsTh, int type, _Entity_SubInfo p_frominfo, _Entity_SubInfo p_Toinfo)
        {
            DataRow[] zrs = this.Unit.StructSource.ModelSubSegments.Select(string.Format(" PID={0}", p_frominfo.ID));
            if (IsTh == 0)
            {
                this.DeleteRows(p_Toinfo);
            }
            for (int i = 0; i < zrs.Length; i++)
            //foreach (DataRow row in zrs)
            {
                DataRow row = zrs[i];

                _Entity_SubInfo info = new _Entity_SubInfo();
                _ObjectSource.GetObject(info, row);
                _Methods_Fixed fix = new _Methods_Fixed(this.CurrentBusiness, this.Unit, p_Toinfo);
                SetGCLandHL(p_Toinfo, info, type);
                fix.Create(-1, info, false);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 刷新到措施项目
        /// </summary>
        /// <param name="row"></param>
        /// <param name="info"></param>
        /// <param name="Is_th"></param>
        /// <param name="strBEIZHU"></param>
        public void CreateCSZM(DataRow[] ZMRows, bool Is_th)
        {
            foreach (DataRow row in ZMRows)
            {
                APP.UserPriceLibrary.AllQuantityUnit = this.Unit.StructSource.ModelQuantity;
                APP.UserPriceLibrary.UnName          = this.Unit.Name;
                APP.UserPriceLibrary.Range           = 1;

                _Entity_SubInfo sinfo = new _Entity_SubInfo();
                SetZM(row, sinfo, "");
                if (_Constant.超高定额号.IndexOf("'" + sinfo.OLDXMBM + "'") != -1)
                {
                    try
                    {
                        ChangeDECJ(sinfo);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }

                //根据位置找清单
                DataRow[] rows = this.Unit.StructSource.ModelMeasures.Select("XMBM='" + row["WZ"] + "'", "id desc");
                if (rows.Length > 0)
                {
                    _Entity_SubInfo info1 = new _Entity_SubInfo();
                    _ObjectSource.GetObject(info1, rows[0]);
                    DataRow[] rowsDE = this.Unit.StructSource.ModelMeasures.Select(string.Format(" ZDSC=True and XMBM='{0}' and PID='{1}'", row["DEBH"], info1.ID), "id desc");
                    int       m_Sort = -1;
                    if (Is_th && rowsDE.Length > 0)
                    {
                        m_Sort = ToolKit.ParseInt(rowsDE[0]["Sort"]);
                        rowsDE[0].Delete();
                    }
                    this.methods_Fixed = new _Mothods_MFixed(this.CurrentBusiness, this.Unit, info1);
                    sinfo.ZDSC         = true;
                    this.methods_Fixed.Create(m_Sort, sinfo);
                }
            }
        }
Esempio n. 6
0
 public _Methods_Infomation(_UnitProject p_Unit, _Business p_bus)
 {
     m_Unit                 = p_Unit;
     this._UnInfo           = APP.UnInformation;
     this.m_CurrentBusiness = p_bus;
     method_Sub             = _Method_Sub.GetSub(this.m_CurrentBusiness, this.m_Unit);
     methods_Fixed          = new _Methods_Fixed(this.m_CurrentBusiness, this.m_Unit, null);
     dt = this.Unit.Property.Libraries.FixedLibrary.LibraryDataSet.Tables["材机表"].Copy();
     if (!dt.Columns.Contains("fl"))
     {
         dt.Columns.Add("fl", typeof(double));
     }
     if (!dt.Columns.Contains("SCDJ"))
     {
         dt.Columns.Add("SCDJ", typeof(double));
     }
     if (dt.PrimaryKey.Length == 0)
     {
         dt.PrimaryKey = new DataColumn[] { dt.Columns["CAIJBH"] };
     }
 }
Esempio n. 7
0
        /// <summary>
        /// 子目取费计算
        /// </summary>
        public override void SubheadingsFeeCurrent()
        {
            //工料机计算(没经过子目取费)
            _Entity_SubInfo         info = null;
            DataRow                 row  = null;
            _Methods                met  = null;
            _Subheadings_Statistics stat = new _Subheadings_Statistics(this.Current, this.Unit);

            stat.FBegin();
            //计算子目经过子目取费
            _ResultSubheadings_Statictics sta = new _ResultSubheadings_Statictics(this.Current, this.Unit);

            sta.DataSource = this.GetDataSource;
            sta.Begin();
            //计算子目所属清单
            info = new _Entity_SubInfo();
            row  = this.Unit.StructSource.ModelSubSegments.GetRowByOther(this.Current.PID.ToString());
            _ObjectSource.GetObject(info, row);
            met = new _Methods_Fixed(this.CurrentBusiness, this.Unit, info);
            met.Begin(null);
        }
Esempio n. 8
0
        private void CreateZJF(_Business m_Currentbus, _Entity_SubInfo item, DataRow row, Calculator calculator)
        {
            if (calculator == null)
            {
                calculator = new Calculator(m_Currentbus, Parent);
            }

            _SubSegmentsSource sorce = null;

            GLODSOFT.QDJJ.BUSINESS._Methods_Fixed fix = null;

            if (item.SSLB == 0)
            {
                sorce = this.Parent.StructSource.ModelSubSegments;
                fix   = new _Methods_Fixed(m_Currentbus, this.Parent, item);
            }
            else
            {
                sorce = this.Parent.StructSource.ModelMeasures;
                fix   = new _Mothods_MFixed(m_Currentbus, this.Parent, item);
            }

            DataRow[] rows = sorce.Select(string.Format("PID={0} and LB='子目-增加费'", item.ID));
            if (IsEsixt(rows, row["Code"].ToString()))
            {
                List <_Entity_SubInfo> list = new List <_Entity_SubInfo>();
                _Entity_SubInfo        info = new _Entity_SubInfo();
                info.OLDXMBM = row["Code"].ToString();
                info.XMBM    = row["Code"].ToString();
                info.XMMC    = row["Name"].ToString();
                info.LB      = "子目-增加费";
                info.GCL     = 1;
                list.Add(info);

                fix.Create(list);
                calculator.Entities.Add(info);
            }
            fix.Begin(null);
            calculator.Entities.Add(item);
        }
Esempio n. 9
0
        /// <summary>
        /// 计算子目
        /// </summary>
        public override void Begin(List <int> session)
        {
            if (session != null)
            {
                if (session.Contains(Current.ID))
                {
                    return;
                }
                else
                {
                    session.Add(Current.ID);
                }
            }

            //工料机计算(没经过子目取费)
            _Entity_SubInfo info = null;
            DataRow         row  = null;
            _Methods        met  = null;

            if (Current.LB != "子目-增加费")
            {
                _Subheadings_Statistics stat = new _Subheadings_Statistics(this.Current, this.Unit);
                stat.Begin();
                //计算子目经过子目取费
                _ResultSubheadings_Statictics sta = new _ResultSubheadings_Statictics(this.Current, this.Unit);
                sta.DataSource = this.GetDataSource;
                sta.Begin();
            }

            //计算子目所属清单
            info = new _Entity_SubInfo();
            row  = this.Unit.StructSource.ModelSubSegments.GetRowByOther(this.Current.PID.ToString());
            var fix = _Entity_SubInfo.Parse(row);

            //var increase = new _Methods_IncreaseInfo(Current, new _Entity_IncreaseCosts());
            _ObjectSource.GetObject(info, row);
            met = new _Methods_Fixed(this.CurrentBusiness, this.Unit, info);
            met.Begin(session);
        }
Esempio n. 10
0
        public void Import(string filaname)
        {
            this.m_FileName = filaname;
            if (this.m_IsClear)
            {
                //this.ClerSub();
            }
            this.GetTable();
            bool            flag  = false;
            _Method_Sub     sub   = this.GetSub();
            _Entity_SubInfo info  = new _Entity_SubInfo();
            int             count = 1;

            foreach (DataRow item in this.table.Rows)
            {
                if (ToolKit.ParseInt(item[0]) > 0)
                {
                    flag = true;
                }
                if (flag)
                {
                    if (item[0] == DBNull.Value && item[1] == DBNull.Value && item[2] == DBNull.Value && item[3] == DBNull.Value)
                    {
                        return;
                    }
                    int     XH   = ToolKit.ParseInt(item[0]);
                    string  XMBM = item[1].ToString();
                    string  XMMC = item[2].ToString();
                    string  DW   = item[3].ToString();
                    decimal GCL  = ToolKit.ParseDecimal(item[4]);
                    if (XH > 0)//清单
                    {
                        if (XMBM.Length > 9)
                        {
                            string    xmbm = XMBM.Substring(0, 9);
                            DataRow[] rows = this.Unit.Property.Libraries.ListGallery.LibraryDataSet.Tables["清单表"].Select(string.Format("QINGDBH='{0}'", xmbm));
                            if (rows.Length > 0)
                            {
                                info = new _Entity_SubInfo();
                                _Methods.SetFixedInfo(info, rows[0], this.Unit.Property.Libraries.ListGallery.FullName, this.Unit.StructSource.ModelSubSegments, "ZYLB");
                                info.XH   = XH;
                                info.XMBM = XMBM;
                                info.XMMC = XMMC;
                                info.DW   = DW;
                                info.GCL  = GCL;
                                int m = GLODSOFT.QDJJ.BUSINESS._Methods.GetCountByBH(xmbm, this.Unit.StructSource.ModelSubSegments);
                                info.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetQDbeizhu(xmbm, m, "EXCL");
                                sub.Create(-1, info);
                            }
                            else//补充清单
                            {
                                info         = new _Entity_SubInfo();
                                info.XH      = XH;
                                info.XMBM    = XMBM;
                                info.OLDXMBM = xmbm;
                                info.XMMC    = XMMC;
                                info.DW      = DW;
                                info.LB      = "清单";
                                info.ZJWZ    = "999999";
                                info.GCL     = GCL;
                                int m = GLODSOFT.QDJJ.BUSINESS._Methods.GetCountByBH(xmbm, this.Unit.StructSource.ModelSubSegments);
                                info.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetQDbeizhu(xmbm, m, "EXCL");
                                sub.Create(-1, info);
                            }
                        }
                        else//补充清单
                        {
                            info         = new _Entity_SubInfo();
                            info.XH      = XH;
                            info.XMBM    = XMBM;
                            info.OLDXMBM = XMBM;
                            info.XMMC    = XMMC;
                            info.DW      = DW;
                            info.LB      = "清单";
                            info.ZJWZ    = "999999";
                            info.GCL     = GCL;
                            int m = GLODSOFT.QDJJ.BUSINESS._Methods.GetCountByBH(XMBM, this.Unit.StructSource.ModelSubSegments);
                            info.BEIZHU = GLODSOFT.QDJJ.BUSINESS._Methods.GetQDbeizhu(XMBM, m, "EXCL");
                            sub.Create(-1, info);
                        }
                    }
                    else//子目的处理
                    {
                        string xmbm = XMBM.Replace("换", "");
                        xmbm = xmbm.Split(' ')[0];
                        DataRow[]      rows = this.Unit.Property.Libraries.FixedLibrary.LibraryDataSet.Tables["定额表"].Select(string.Format("DINGEH='{0}'", xmbm));
                        _Methods_Fixed fix  = new _Methods_Fixed(this.CurrentBusiness, this.Unit, info);
                        if (rows.Length > 0)
                        {
                            _Entity_SubInfo sinfo = new _Entity_SubInfo();
                            _Methods.SetSubheadingsInfo(sinfo, rows[0], this.Unit.Property.Libraries.FixedLibrary.FullName);
                            // _ObjectSource.GetObject(sinfo, rows[0]);
                            sinfo.XH      = XH;
                            sinfo.XMBM    = XMBM;
                            sinfo.XMMC    = XMMC;
                            sinfo.DW      = DW;
                            sinfo.LB      = "子目";
                            sinfo.GCL     = GCL;
                            sinfo.OLDXMBM = xmbm;
                            sinfo.BEIZHU  = GLODSOFT.QDJJ.BUSINESS._Methods.GetDEbeizhu("EXCL", count, info.OLDXMBM);
                            fix.Create(false, -1, sinfo);
                            count++;
                        }
                        else
                        {
                            _Entity_SubInfo sinfo = new _Entity_SubInfo();
                            sinfo.XH      = XH;
                            sinfo.XMBM    = XMBM;
                            sinfo.OLDXMBM = xmbm;
                            sinfo.XMMC    = XMMC;
                            sinfo.DW      = DW;
                            sinfo.GCL     = GCL;
                            sinfo.LB      = "子目";
                            sinfo.BEIZHU  = GLODSOFT.QDJJ.BUSINESS._Methods.GetDEbeizhu("EXCL", count, info.OLDXMBM);
                            fix.Create(false, -1, sinfo);
                            count++;
                        }
                    }
                }
            }
        }