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); }
// 虚拟一个设备 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); }
// 虚拟一个人 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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
public WkpObject GetParent(WrkgrpObject wrkgrp) { return(GetByID(wrkgrp.Wkp_ID)); }