Ejemplo n.º 1
0
        /// <summary>
        /// 获取清单ID
        /// </summary>
        /// <param name="p_info"></param>
        /// <param name="p_BH"></param>
        /// <returns></returns>
        private string GetQDID(_SubSegmentsSource p_info, string p_BH)
        {
            string str = "-1";

            DataRow[] drs = p_info.Select(string.Format("{0}={1}", p_BH, this.m_Methods_Subheadings.Current.ID));
            foreach (DataRow item in drs)
            {
                if (str == "-1")
                {
                    str = string.Empty;
                }
                str += item["ID"].ToString() + ",";
            }
            if (str != "-1")
            {
                str = str.Substring(0, str.Length - 1);
            }
            return(str);
        }
Ejemplo n.º 2
0
        private void RemoveParent(DataRow row)
        {
            _SubSegmentsSource source = this.Unit.StructSource.ModelSubSegments;

            DataRow[] rows = source.Select(string.Format(" PID = {0}", row["PID"]), string.Empty, DataViewRowState.CurrentRows);
            if (rows.Length < 2)
            {
                DataRow row1 = source.GetRowByOther(row["PID"].ToString());
                if (row1 != null)
                {
                    if (row1["PID"].Equals(0))
                    {
                        row.Delete();
                        _Entity_SubInfo info = new _Entity_SubInfo();
                        _ObjectSource.GetObject(info, row1);
                        GLODSOFT.QDJJ.BUSINESS._Methods mets = GLODSOFT.QDJJ.BUSINESS._Methods.CreateIntace(this.CurrentBusiness, this.Unit, info);
                        mets.Begin(null);
                    }
                    else
                    {
                        this.RemoveParent(row1);
                    }
                }
            }
            else
            {
                DataRow r = source.GetRowByOther(row["ID"].ToString());
                if (r != null)
                {
                    if (!r["PID"].Equals(0))
                    {
                        string id = r["PID"].ToString();
                        r.Delete();
                        DataRow         r1   = source.GetRowByOther(id);
                        _Entity_SubInfo info = new _Entity_SubInfo();
                        _ObjectSource.GetObject(info, r1);
                        GLODSOFT.QDJJ.BUSINESS._Methods mets = GLODSOFT.QDJJ.BUSINESS._Methods.CreateIntace(this.CurrentBusiness, this.Unit, info);
                        mets.Begin(null);
                    }
                }
            }
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 删除子目包括当前清单
        /// </summary>
        public override void RemoveAllChild()
        {
            DataRow[] gljRows    = null;
            DataRow[] scRows     = null;
            DataRow[] zmqfRows   = null;
            DataRow[] cszmqfRows = null;
            DataRow[] azzjfRows  = null;

            _SubSegmentsSource source = this.Unit.StructSource.ModelSubSegments;

            DataRow[] rows = source.Select(string.Format("PID = {0}", this.Current.ID));
            foreach (DataRow row in rows)
            {
                gljRows    = this.Unit.StructSource.ModelQuantity.Select("ZMID = " + row["id"].ToString());
                scRows     = this.Unit.StructSource.ModelStandardConversion.Select("ZMID = " + row["id"].ToString());
                zmqfRows   = this.Unit.StructSource.ModelSubheadingsFee.Select("ZMID = " + row["id"].ToString());
                cszmqfRows = this.Unit.StructSource.ModelPSubheadingsFee.Select("ZMID = " + row["id"].ToString());
                azzjfRows  = this.Unit.StructSource.ModelIncreaseCosts.Select("ZMID = " + row["id"].ToString());
                foreach (DataRow glj in gljRows)
                {
                    glj.Delete();
                }
                foreach (DataRow sc in scRows)
                {
                    sc.Delete();
                }
                foreach (DataRow zmqf in zmqfRows)
                {
                    zmqf.Delete();
                }
                foreach (DataRow cszmqf in cszmqfRows)
                {
                    cszmqf.Delete();
                }
                foreach (DataRow azzjf in azzjfRows)
                {
                    azzjf.Delete();
                }

                row.Delete();
            }


            DataRow r = source.GetRowByOther(this.Current.ID.ToString());

            if (r != null)
            {
                this.RemoveParent(r);
            }
            //DataRow[] rows = source.Select(string.Format("UnId = {0} and SSLB ={1} and PID = {2}", this.Current.UnID, this.Current.SSLB, this.Current.PID), string.Empty, DataViewRowState.CurrentRows);
            //if (rows.Length < 2)
            //{
            //    DataRow row = source.GetRowByOther(this.Current.PID.ToString());
            //    if(row!=null)
            //    this.RemoveParent(row);

            //}
            //else
            //{
            //   DataRow r= source.GetRowByOther(this.Current.ID.ToString());
            //   if (r != null) r.Delete();
            //}
        }