public override void Rec_Replace(ActionAttribute p_attr)
        {
            _SubheadingsQuantityUnitInfo m_info = p_attr.Source as _SubheadingsQuantityUnitInfo;
            _SubheadingsQuantityUnitInfo p_info = p_attr.TagValue as _SubheadingsQuantityUnitInfo;

            if (m_info != null && p_info != null)
            {
                if (this.Activitie.Property.RepeatInfo(m_info))
                {
                    if ((this.Parent.SubheadingsQuantityUnitList.GetCount(m_info) == 0 || p_info.BH == m_info.BH))
                    {
                        int index = this.Parent.SubheadingsQuantityUnitList.IndexOf(p_info);
                        this.Parent.SubheadingsQuantityUnitList.Remove(p_info);
                        this.Parent.SubheadingsQuantityUnitList.Add(index, m_info, false);
                        foreach (_QuantityUnitComponentInfo item in m_info.QuantityUnitComponentList)
                        {
                            m_info.QuantityUnitComponentList.AddGLJHZ(item);
                        }
                        //引发计算
                        this.Parent.Subheadings_Statistics.Begin();
                        //刷新数据
                        this.Parent.SubheadingsQuantityUnitList_BindingSource.ResetBindings(false);
                        //对象设置为创建中状态
                        this.Activitie.BeginEdit(this);
                    }
                }
            }
        }
        public override void Rec_Delete(ActionAttribute p_attr)
        {
            _SubheadingsQuantityUnitInfo p_info = p_attr.Source as _SubheadingsQuantityUnitInfo;

            if (p_info != null)
            {
                this.Parent.SubheadingsQuantityUnitList.Remove(p_info);
                //引发计算
                this.Parent.Subheadings_Statistics.Begin();
                //刷新数据
                this.Parent.SubheadingsQuantityUnitList_BindingSource.ResetBindings(false);
                //对象设置为创建中状态
                this.Activitie.BeginEdit(this);
            }
        }
Exemple #3
0
        /// <summary>
        /// 删除 子目工料机对象
        /// </summary>
        /// <param name="info">子目工料机对象</param>
        public void Remove(_ObjectQuantityUnitInfo info)
        {
            _SubheadingsQuantityUnitInfo infos = info as _SubheadingsQuantityUnitInfo;

            if (infos.IFKFJ)
            {
                object[] s_info = infos.QuantityUnitComponentList.ToArray();
                foreach (_ObjectQuantityUnitInfo item in s_info)
                {
                    infos.QuantityUnitComponentList.RemoveGLJHZ(item);
                }
            }
            this.Parent.SetOpera("//删:" + info.MC);
            base.Remove(info);
            this.Parent.Subheadings_Statistics.Begin();
            this.Parent.Activitie.BeginEdit(this);
        }
        /// <summary>
        /// 计算百分号材料合计
        /// </summary>
        /// <param name="p_list"></param>
        private void JSBFH(_SubheadingsQuantityUnitList p_list)
        {
            m_BaseResultValue.CLBFHHJ = 0m;
            m_BaseResultValue.JXBFHHJ = 0m;
            m_BaseResultValue.RGBFHHJ = 0m;
            IEnumerable <_SubheadingsQuantityUnitInfo> list   = p_list.Cast <_SubheadingsQuantityUnitInfo>();
            IEnumerable <_SubheadingsQuantityUnitInfo> tslist = list.Where(p => p.YSBH == "11705");

            if (tslist.Count() == 1)
            {
                IEnumerable <_SubheadingsQuantityUnitInfo> tslists = list.Where(p => p.BH == "10088" || p.BH == "10087" || p.BH == "10544");
                decimal mcbfb = 0;
                foreach (_SubheadingsQuantityUnitInfo item in tslists)
                {
                    mcbfb += item.SCHJ;
                }
                _SubheadingsQuantityUnitInfo tsinfo = tslist.First();
                m_BaseResultValue.CLBFHHJ = mcbfb / 100 * tsinfo.XHL;
            }

            IEnumerable <_SubheadingsQuantityUnitInfo> bfhlist = list.Where(p => p.LB.Contains("%") && p.YSBH != "11705");

            foreach (_SubheadingsQuantityUnitInfo item in bfhlist)
            {
                switch (item.LB)
                {
                case "材料%":
                    m_BaseResultValue.CLBFHHJ = list.Where(p => p.LB == "材料").Sum(p => p.SCHJ) / 100 * item.XHL;
                    break;

                case "机械%":
                    m_BaseResultValue.JXBFHHJ = list.Where(p => p.LB == "机械").Sum(p => p.SCHJ) / 100 * item.XHL;
                    break;

                case "人工%":
                    m_BaseResultValue.RGBFHHJ = list.Where(p => p.LB == "人工").Sum(p => p.SCHJ) / 100 * item.XHL;
                    break;

                default:
                    break;
                }
            }
        }
Exemple #5
0
        /// <summary>
        /// 是否重复
        /// </summary>
        /// <returns></returns>
        public bool RepeatInfo(_ObjectQuantityUnitInfo p_Info)
        {
            IEnumerable <_SubheadingsQuantityUnitInfo> list = this.Cast <_SubheadingsQuantityUnitInfo>().Where(p => p.BH == p_Info.BH);

            if (list.Count() == 0)
            {
                return(true);
            }
            else
            {
                _SubheadingsQuantityUnitInfo m_Info = list.FirstOrDefault();
                if (m_Info.MC == p_Info.MC && m_Info.DW == p_Info.DW && m_Info.SCDJ == p_Info.SCDJ)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Exemple #6
0
        /// <summary>
        /// 计算百分号材料合计
        /// </summary>
        /// <param name="p_list"></param>
        private void JSBFH(_SubheadingsQuantityUnitList p_list)
        {
            m_ResultValue.CLBFHHJ = 0m;
            m_ResultValue.JXBFHHJ = 0m;
            m_ResultValue.RGBFHHJ = 0m;
            _SubheadingsQuantityUnitInfo m_TSInfo = p_list.Cast <_SubheadingsQuantityUnitInfo>().Where(p => p.YSBH == "11705" && p.LB.Contains("%")).FirstOrDefault();

            if (m_TSInfo != null)
            {
                m_ResultValue.CLBFHHJ += p_list.Cast <_SubheadingsQuantityUnitInfo>().Where(p => p.BH == "10088" || p.BH == "10087" || p.BH == "10544").Sum(p => p.SCDJ * p.XHL) / 100 * m_TSInfo.XHL;
            }

            IEnumerable <_SubheadingsQuantityUnitInfo> bfhlist = p_list.Cast <_SubheadingsQuantityUnitInfo>().Where(p => p.LB.Contains("%") && p.YSBH != "11705");

            foreach (_SubheadingsQuantityUnitInfo item in bfhlist)
            {
                switch (item.LB)
                {
                case "材料%":
                    m_ResultValue.CLBFHHJ += (p_list.Parent.GetAllQuantityUnit.Cast <_ObjectQuantityUnitInfo>().Where(p => p.LB == "材料").Sum(p => p.GetType() == typeof(_QuantityUnitComponentInfo) ? p.SCHJ * (p as _QuantityUnitComponentInfo).Parent.XHL : p.SCHJ) / 100 * item.XHL);
                    break;

                case "机械%":
                    m_ResultValue.JXBFHHJ += (p_list.Parent.GetAllQuantityUnit.Cast <_ObjectQuantityUnitInfo>().Where(p => p.LB == "机械").Sum(p => p.GetType() == typeof(_QuantityUnitComponentInfo) ? p.SCHJ * (p as _QuantityUnitComponentInfo).Parent.XHL : p.SCHJ) / 100 * item.XHL);
                    break;

                case "人工%":
                    m_ResultValue.RGBFHHJ += (p_list.Parent.GetAllQuantityUnit.Cast <_ObjectQuantityUnitInfo>().Where(p => p.LB == "人工").Sum(p => p.GetType() == typeof(_QuantityUnitComponentInfo) ? p.SCHJ * (p as _QuantityUnitComponentInfo).Parent.XHL : p.SCHJ) / 100 * item.XHL);
                    break;

                default:
                    break;
                }
            }
            m_ResultValue.RGFDJ   += m_ResultValue.RGBFHHJ;
            m_ResultValue.CLFDJ   += m_ResultValue.CLBFHHJ;
            m_ResultValue.JXFDJ   += m_ResultValue.JXBFHHJ;
            m_ResultValue.HHJXFDJ += m_ResultValue.JXBFHHJ;
        }
Exemple #7
0
 /// <summary>
 /// 初始化:工料机组成对象
 /// </summary>
 /// <param name="p_Parent">所属:子目工料机对象</param>
 public _QuantityUnitComponentInfo(_SubheadingsQuantityUnitInfo p_Parent)
 {
     this.m_Parent = p_Parent;
 }