Пример #1
0
        /// <summary>
        /// 自动绑定
        /// </summary>
        /// <param name="bh"></param>
        /// <returns></returns>
        public void AutoBindingInfo(UseType p_UseType)
        {
            IEnumerable <YTLBSummaryInfo> re = this.Cast <YTLBSummaryInfo>().Where(p => p.BDBH.Trim() == string.Empty && p.YTLB == p_UseType.ToString());

            foreach (YTLBSummaryInfo item in re)
            {
                YTLBSummaryInfo m_info = GetBDBHInfo(item.BH);
                if (m_info == null)
                {
                    IEnumerable <_ObjectQuantityUnitInfo> m_ObjectQuantityUnitInfo = this.Parent.Property.GetAllQuantityUnit.Cast <_ObjectQuantityUnitInfo>().Where(p => p.BH == item.BH);
                    if (m_ObjectQuantityUnitInfo.Count() > 0)
                    {
                        _ObjectQuantityUnitInfo m_defanyl = m_ObjectQuantityUnitInfo.FirstOrDefault();
                        item.BDBH = m_defanyl.BH;
                        item.SLH  = m_defanyl.SLH;
                        item.SCDJ = m_defanyl.SCDJ;
                        item.DEDJ = m_defanyl.DEDJ;
                        item.GGXH = m_defanyl.GGXH;
                        foreach (_ObjectQuantityUnitInfo items in m_ObjectQuantityUnitInfo)
                        {
                            items.STATUS = Status.Update;
                            items.YTLB   = item.YTLB;
                        }
                    }
                    this.Parent.Property.TemporaryCalculate.Calculate();
                }
            }
            this.Parent.Property.YTLBSummaryList_BindingSource.ResetBindings(false);
        }
Пример #2
0
        /// <summary>
        /// 替换
        /// </summary>
        /// <param name="p_YTLB">原信息</param>
        /// <param name="p_info">新信息</param>
        /// <param name="iszd"></param>
        /// <returns></returns>
        public bool Replace(YTLBSummaryInfo p_YTLB, _ObjectQuantityUnitInfo p_info)
        {
            if (p_YTLB == null)
            {
                return(false);
            }
            if (p_info == null)
            {
                return(false);
            }
            this.CanceledBinding(p_YTLB);
            p_YTLB.BDBH = p_info.BH;
            p_YTLB.DEDJ = p_info.DEDJ;
            p_YTLB.SCDJ = p_info.SCDJ;
            p_YTLB.JSDJ = p_info.JSDJ;
            p_YTLB.SLH  = p_info.SLH;
            IEnumerable <_ObjectQuantityUnitInfo> list = this.Parent.Property.GetAllQuantityUnit.Cast <_ObjectQuantityUnitInfo>().Where(p => p.BH == p_info.BH);

            foreach (_ObjectQuantityUnitInfo item in list)
            {
                item.STATUS = Status.Update;
                item.YTLB   = p_YTLB.YTLB;
            }
            return(true);
        }
Пример #3
0
        /// <summary>
        /// 取消绑定
        /// </summary>
        /// <param name="p_info"></param>
        public void CanceledBinding(YTLBSummaryInfo p_info)
        {
            if (p_info == null)
            {
                return;
            }
            if (p_info.BDBH == string.Empty)
            {
                return;
            }
            IEnumerable <_ObjectQuantityUnitInfo> list = this.Parent.Property.GetAllQuantityUnit.Cast <_ObjectQuantityUnitInfo>().Where(p => p.BH == p_info.BDBH);

            foreach (_ObjectQuantityUnitInfo item in list)
            {
                item.STATUS = Status.Update;
                item.YTLB   = string.Empty;
            }
            p_info.BDBH = string.Empty;
        }
Пример #4
0
        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="p_Index">插入位置</param>
        /// <param name="p_Info">材料信息</param>
        /// <param name="p_Automatic">是否自动绑定</param>
        /// <returns>是否成功</returns>
        public YTLBSummaryInfo Insert(int p_Index, _ObjectQuantityUnitInfo p_Info, bool p_Automatic)
        {
            YTLBSummaryInfo m_info = this.GetBindingInfo(p_Info.BH);

            if (m_info != null)
            {
                return(m_info);
            }
            YTLBSummaryInfo new_info = new YTLBSummaryInfo(this.Parent);

            new_info.BDBH = p_Automatic ? p_Info.BH : string.Empty;
            new_info.BH   = p_Info.BH;
            new_info.MC   = p_Info.MC;
            new_info.DW   = p_Info.DW;
            new_info.GGXH = p_Info.GGXH;
            new_info.DEDJ = p_Info.DEDJ;
            new_info.SCDJ = p_Info.SCDJ;
            new_info.JSDJ = p_Info.JSDJ;
            new_info.SLH  = p_Info.SLH;
            new_info.YTLB = p_Info.YTLB;
            (this as System.Collections.ArrayList).Insert(p_Index, new_info);
            return(null);
        }
Пример #5
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="p_info"></param>
 public void Remove(YTLBSummaryInfo p_info)
 {
     this.CanceledBinding(p_info);
     base.Remove(p_info);
 }