Beispiel #1
0
        private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            DataRowView v = this.bindingSource1.Current as DataRowView;

            if (v == null)
            {
                return;
            }
            _Entity_IncreaseCosts info = new _Entity_IncreaseCosts();

            _ObjectSource.GetObject(info, v.Row);
            _Methods_IncreaseInfo met = new _Methods_IncreaseInfo(this.Activitie, info);

            met.CurrentBegin(this.CurObj);
        }
Beispiel #2
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            switch (e.Item.Caption)

            {
            case "选择增加费":
                IncreaseCostsSelect s = new IncreaseCostsSelect();
                s.Activitie  = this.Activitie;
                s.DataSource = this.Activitie.Property.IncreaseCosts.DataSource.Copy();
                s.CurObj     = this.m_CurObj;
                DialogResult d = s.ShowDialog();
                if (d == DialogResult.OK)
                {
                    // (this.m_CurObj as _SubheadingsInfo).IncreaseCostsList.a
                    foreach (DataRowView item in s.treeListEx1.CheckNodes)
                    {
                        DataRow[] rows = this.Activitie.StructSource.ModelIncreaseCosts.Select(string.Format("ZMID={0} and SSLB={1}", this.m_CurObj.ID, this.m_CurObj.SSLB));
                        if (IsEsixtZJF(rows, item["Code"].ToString()))
                        {
                            _Entity_IncreaseCosts info1 = new _Entity_IncreaseCosts();
                            _Method_IncreaseCosts.SetInfo(item.Row, info1);
                            info1.EnID = this.m_CurObj.EnID;
                            info1.UnID = this.m_CurObj.UnID;
                            info1.ZMID = this.m_CurObj.ID;
                            info1.QDID = this.m_CurObj.PID;
                            this.Activitie.StructSource.ModelIncreaseCosts.Add(info1);
                            _Methods_IncreaseInfo minfo = new _Methods_IncreaseInfo(this.Activitie, info1);
                            minfo.CurrentBegin(this.m_CurObj);    //计算当前行
                        }
                    }
                }
                break;

            case "删除增加费":
                if (this.bindingSource1.Current == null)
                {
                    return;
                }
                this.bindingSource1.RemoveCurrent();
                break;

            default:
                break;
            }
        }
        public static void SetInfo(DataRow row, _Entity_IncreaseCosts info1)
        {
            info1.Name = row["Name"].ToString();
            info1.DH   = row["Code"].ToString();
            info1.JSJC = row["Calculation"].ToString();
            if (row["Additional"].ToString() == "|")
            {
                info1.FJJS = "0";
            }
            else
            {
                info1.FJJS = row["Additional"].ToString();
            }

            info1.XS = Convert.ToDecimal(row["Coefficient"] is DBNull ? 0 : row["Coefficient"]);

            if (row["Artificial"].ToString() == "")
            {
                info1.RGXS = 0m;
            }
            else
            {
                info1.RGXS = Convert.ToDecimal(row["Artificial"]);
            }
            if (row["Material"].ToString() == "")
            {
                info1.CLXS = 0m;
            }
            else
            {
                info1.CLXS = Convert.ToDecimal(row["Material"]);
            }

            if (row["Mechanical"].ToString() == "")
            {
                info1.JXXS = 0m;
            }
            else
            {
                info1.JXXS = Convert.ToDecimal(row["Mechanical"]);
            }
        }
Beispiel #4
0
        public bool BeginExtension()
        {
            //计算子目增加费
            var rows = this.GetDataSource.Select("LB = '子目-增加费' AND PID = '+" + Current.ID + "'");

            foreach (var row in rows)
            {
                var entity       = _Entity_SubInfo.Parse(row);
                var increaseRows = this.Unit.StructSource.ModelIncreaseCosts.Select("DH = '" + row["XMBM"] + "' AND QDID = '" + Current.ID + "'");

                if (increaseRows != null && increaseRows.Length > 0)
                {
                    var increaseRow = increaseRows[0];
                    var increase    = new _Entity_IncreaseCosts()
                    {
                        EnID = Current.EnID,
                        UnID = Current.UnID,
                        ZMID = Current.ID,
                        QDID = Current.PID
                    };

                    _ObjectSource.GetObject(increase, increaseRow);
                    _Methods_IncreaseInfo increaseMethod = new _Methods_IncreaseInfo(Unit, increase);
                    increaseMethod.CurrentBegin(Current);
                }

                var subStatictics = new _Subheadings_Statistics(entity, this.Unit);
                subStatictics.Begin();

                //计算子目经过子目取费
                _ResultSubheadings_Statictics resultStatictics = new _ResultSubheadings_Statictics(entity, this.Unit)
                {
                    DataSource = this.GetDataSource
                };
                resultStatictics.Begin();
            }

            return(rows != null && rows.Length > 0);
        }
        /// <summary>
        /// 关联到项目
        /// </summary>
        public void Build(_Business m_Currentbus)
        {
            if (this.m_DataSource.Rows.Count < 1)
            {
                return;
            }

            //增加之前先删除增加费
            DataRow[] subsegments = this.m_Parent.StructSource.ModelSubSegments.Select(" LB='子目-增加费'");
            DataRow[] measures    = this.m_Parent.StructSource.ModelMeasures.Select(" LB='子目-增加费'");

            using (var calculator = new Calculator(m_Currentbus, m_Parent))
            {
                for (int i = 0; i < subsegments.Length; i++)
                {
                    var entity = new _Entity_SubInfo();
                    _ObjectSource.GetObject(entity, subsegments[i]);
                    calculator.Entities.Add(entity);
                    subsegments[i].Delete();
                }

                for (int i = 0; i < measures.Length; i++)
                {
                    var entity = new _Entity_SubInfo();
                    _ObjectSource.GetObject(entity, measures[i]);
                    calculator.Entities.Add(entity);
                    measures[i].Delete();
                }
            }

            this.m_Parent.StructSource.ModelIncreaseCosts.Clear();

            DataRow[] checkedRows = this.m_DataSource.Select("Check=True");
            DataRow[] subItems    = this.m_Parent.StructSource.ModelSubSegments.Select("LB='子目'");

            using (var calculator = new Calculator(m_Currentbus, Parent))
            {
                foreach (DataRow subItem in subItems)
                {
                    _Entity_SubInfo subInfo = new _Entity_SubInfo();
                    _ObjectSource.GetObject(subInfo, subItem);
                    foreach (DataRow row in checkedRows)
                    {
                        //若定额范围在指定范围之内
                        if (GLODSOFT.QDJJ.BUSINESS._Methods.ExistsBH(row["Fixed"].ToString(), subInfo))
                        {
                            DataRow[] rwoss = this.m_Parent.StructSource.ModelIncreaseCosts.Select(string.Format("ZMID={0}", subInfo.ID));
                            if (IsEsixtZJF(rwoss, row["Code"].ToString()))
                            {
                                _Entity_IncreaseCosts info1 = new _Entity_IncreaseCosts();
                                _Method_IncreaseCosts.SetInfo(row, info1);
                                info1.EnID = subInfo.EnID;
                                info1.UnID = subInfo.UnID;
                                info1.ZMID = subInfo.ID;
                                info1.QDID = subInfo.PID;
                                this.m_Parent.StructSource.ModelIncreaseCosts.Add(info1);
                                _Methods_IncreaseInfo minfo = new _Methods_IncreaseInfo(this.Parent, info1);
                                minfo.CurrentBegin(subInfo);//计算当前行
                            }
                        }
                    }
                }

                foreach (DataRow row in checkedRows)
                {
                    Create(m_Currentbus, GetLocation(Convert.ToInt32(row["ParentID"])), row, calculator);
                }
            }
        }
 public _Methods_IncreaseInfo(_UnitProject p_un, _Entity_IncreaseCosts p_info)
 {
     this.m_Unit    = p_un;
     this.m_Current = p_info;
 }