Beispiel #1
0
        //#region IComparer<_Entity_SubInfo> 成员

        //public int Compare(_Entity_SubInfo x, _Entity_SubInfo y)
        //{
        //    if (x.LB.Equals(y.LB).Equals("清单") || x.LB.Equals(y.LB).Equals("子目"))
        //    {
        //        return 0;
        //    }
        //    else if(x.LB.Equals("清单"))
        //    {
        //        return
        //    }
        //}

        //#endregion

        //#region IComparable<_Entity_SubInfo> 成员

        //public int CompareTo(_Entity_SubInfo other)
        //{
        //    if (this.LB.Equals(other.LB).Equals("清单") || this.LB.Equals(other.LB).Equals("子目"))
        //    {
        //        return 0;
        //    }
        //    else if (this.LB.Equals("清单") && other.LB.Equals("子目"))
        //    {
        //        return 1;
        //    }
        //    //else if (this.LB.Equals("子目") && other.LB.Equals("清单"))
        //    //{
        //        return -1;
        //    //}
        //}

        //#endregion

        public static _Entity_SubInfo Parse(DataRow row)
        {
            var entity = new _Entity_SubInfo();

            _ObjectSource.GetObject(entity, row);

            return(entity);
        }
Beispiel #2
0
        /// <summary>
        /// 通过图集库给子目赋值
        /// </summary>
        /// <param name="info"></param>
        /// <param name="dr"></param>
        /// <param name="Libname"></param>
        public void SetSubheadingsInfoByTJ(_Entity_SubInfo info, DataRow dr, string Libname)
        {
            info.XMBM    = dr["DEBH"].ToString();
            info.XMMC    = dr["DEMC"].ToString();
            info.OLDXMBM = dr["DEBH"].ToString();
            info.DW      = dr["DEDW"].ToString();
            info.LB      = "子目";
            info.XMTZ    = "";
            info.GCLJSS  = "";
            info.HL      = 1.00m;
            string dw = dr["DEDW"].ToString().Replace("m2", "").Replace("m3", "");

            if (dw == "")
            {
                dw = "1";
            }
            decimal xs = ToolKit.ParseDecimal(dr["GCXS"]);

            if (xs <= 0)
            {
                xs = 1m;
            }

            decimal c = ToolKit.ParseDecimal(dw) * xs;

            if (c == 0)
            {
                c = 1m;
            }
            info.GCL         = 1 / c;
            info.LibraryName = Libname;
            _Library.GetLibrary(Libname);
            DataTable dt = (_Library.Libraries[Libname] as DataSet).Tables["定额表"];

            if (dt != null)
            {
                DataRow[] rows = dt.Select(string.Format("DINGEH='{0}'", info.XMBM));
                if (rows.Length > 0)
                {
                    info.DECJ = rows[0]["DECJ"].ToString();
                    string oldvalue = dr["HSQ"].ToString();
                    string newvalue = dr["HSH"].ToString();
                    if (oldvalue.Length > 0)
                    {
                        info.XMBM = info.XMBM + "换";
                        info.DECJ = info.DECJ.Replace(oldvalue, newvalue);
                    }
                    //
                }
            }
            //info.DECJ = dr["DECJ"].ToString();
        }
Beispiel #3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public _Subheadings_Statisticss(_Entity_SubInfo p_info)
 {
     //this.m_Parent = p_Parent;
     this.Create();
 }