示例#1
0
 public void PutWrkgrpBegin(WrkgrpObject wrkgrp, DateTime begin)
 {
     if (!_wrkgrp_begins.ContainsKey(wrkgrp._ID))
     {
         _wrkgrp_begins[wrkgrp._ID] = new SortedSet <DateTime>();
     }
     _wrkgrp_begins[wrkgrp._ID].Add(begin);
 }
示例#2
0
        // 虚拟一个设备
        public ResourceObject AddVirtualEq(WrkgrpObject wrkgrp, EquipmentObject eq, int index)
        {
            string _ID  = "v_eq:" + wrkgrp._ID + "," + eq._ID + "," + index;// 组内编号
            var    rslt = new ResourceObject();

            rslt._ID = _ID;
            Add(rslt);
            return(rslt);
        }
示例#3
0
        // 虚拟一个人
        public ResourceObject AddVirtualEmp(WrkgrpObject wrkgrp, int index)
        {
            string _ID  = "v_emp:" + wrkgrp._ID + "," + index;
            var    rslt = new ResourceObject();

            rslt._ID = _ID;
            Add(rslt);
            return(rslt);
        }
示例#4
0
        public IList <DateTime> GetDateArr(WrkgrpObject wrkgrp, DateTime lower, DateTime upper)
        {
            List <DateTime> rslt = new List <DateTime>();

            if (_wrkgrp_begins.ContainsKey(wrkgrp._ID))
            {
                rslt.AddRange(_wrkgrp_begins[wrkgrp._ID].GetViewBetween(lower, upper));
            }
            return(rslt);
        }
示例#5
0
        public List <WorkgroupObject> GetChildWorkgroups(WrkgrpObject wrkgrp)
        {
            List <WorkgroupObject> rslt = new List <WorkgroupObject>();

            if (_wrkgrp_workgroups.ContainsKey(wrkgrp._ID))
            {
                rslt.AddRange(_wrkgrp_workgroups[wrkgrp._ID]);
            }
            return(rslt);
        }
示例#6
0
        public List <ResourceTypeObject> GetWrkgrpEqs(WrkgrpObject wrkgrp)
        {
            var rslt = new List <ResourceTypeObject>();

            if (_wrkgrp_eqtypes.ContainsKey(wrkgrp._ID))
            {
                rslt.AddRange(_wrkgrp_eqtypes[wrkgrp._ID]);
            }
            return(rslt);
        }
示例#7
0
 public DateTime?GetLastBegin(WrkgrpObject wrkgrp)
 {
     if (_wrkgrp_begindates.ContainsKey(wrkgrp._ID))
     {
         if (_wrkgrp_begindates[wrkgrp._ID].Count > 0)
         {
             return(_wrkgrp_begindates[wrkgrp._ID].Max);
         }
     }
     return(null);
 }
示例#8
0
        public ResourceTypeObject GetEmpRs(WrkgrpObject wrkgrp)
        {
            string             _ID  = "类型:" + wrkgrp._ID + ",人力";
            ResourceTypeObject rslt = GetByID(_ID);

            if (rslt == null)
            {
                rslt     = new ResourceTypeObject();
                rslt._ID = _ID;
                this.Add(rslt);
            }
            return(rslt);
        }
        public IList <WrkgrpEquipmentObject> GetEquipments(WrkgrpObject wrkgrp)
        {
            List <WrkgrpEquipmentObject> rslt = new List <WrkgrpEquipmentObject>();

            if (_wrkgrp_eqs.ContainsKey(wrkgrp._ID))
            {
                foreach (var eq in _wrkgrp_eqs[wrkgrp._ID])
                {
                    rslt.Add(eq);
                }
            }
            return(rslt);
        }
示例#10
0
        public ResourceTypeObject GetEqRs(WrkgrpObject wrkgrp, EquipmentObject eq)
        {
            string _ID = "类型:" + wrkgrp._ID + "," + eq._ID;

            ResourceTypeObject rslt = GetByID(_ID);

            if (rslt == null)
            {
                rslt           = new ResourceTypeObject();
                rslt._ID       = _ID;
                rslt.Wrkgrp_ID = wrkgrp._ID;
                rslt.Eq_ID     = eq._ID;
                this.Add(rslt);
            }
            return(rslt);
        }
示例#11
0
        public ResourceTypeObject GetEqRs(WrkgrpObject wrkgrp, IEnumerable <EquipmentObject> eqs)
        {
            string _ID = "类型:" + wrkgrp._ID;

            foreach (var eq in eqs)
            {
                _ID += "," + eq._ID;
            }

            ResourceTypeObject rslt = GetByID(_ID);

            if (rslt == null)
            {
                rslt     = new ResourceTypeObject();
                rslt._ID = _ID;
                this.Add(rslt);
            }
            return(rslt);
        }
示例#12
0
        public List <WrkgrpDateObject> GetDates(WrkgrpObject wrkgrp, DateTime dt)
        {
            var rslt = new List <WrkgrpDateObject>();

            if (_wrkgrp_dates.ContainsKey(wrkgrp._ID) && _wrkgrp_dates[wrkgrp._ID].ContainsKey(dt.Date))
            {
                foreach (var date in _wrkgrp_dates[wrkgrp._ID][dt.Date])
                {
                    int i = 0;
                    for (i = 0; i < rslt.Count; i++)
                    {
                        if (date.begintime < rslt[i].begintime)
                        {
                            break;
                        }
                    }
                    rslt.Insert(i, date);
                }
            }
            return(rslt);
        }
示例#13
0
 public WkpObject GetParent(WrkgrpObject wrkgrp)
 {
     return(GetByID(wrkgrp.Wkp_ID));
 }