public static void SelDepartment(JqTreeModel _jqxTree, DObject _param) { List <JqTreeModel> items = new List <JqTreeModel>(); DObject tmpDepartment = null; DRelationshipRepository.SelRelationship(new DRelationship { Type = CommonConstant.RELATIONSHIP_DEPARTMENT, FromOID = _param.OID }).ForEach(item => { if (tmpDepartment != null) { tmpDepartment = null; } JqTreeModel innerJqTreeModel = new JqTreeModel(); tmpDepartment = DObjectRepository.SelDObject(new DObject { Type = CommonConstant.TYPE_DEPARTMENT, OID = item.ToOID }); innerJqTreeModel.id = tmpDepartment.OID; innerJqTreeModel.label = tmpDepartment.Name; innerJqTreeModel.icon = CommonConstant.ICON_DEPARTMENT; innerJqTreeModel.iconsize = CommonConstant.DEFAULT_ICONSIZE; innerJqTreeModel.expanded = true; innerJqTreeModel.type = CommonConstant.TYPE_DEPARTMENT; SelDepartment(innerJqTreeModel, tmpDepartment); items.Add(innerJqTreeModel); }); _jqxTree.items = items; }
public static int InsDObject(DObject _param) { int result = -1; _param.CreateUs = 1; if (_param.BPolicyOID == null) { _param.BPolicyOID = BPolicyRepository.SelBPolicy(new BPolicy { Type = _param.Type }).First().OID; } if (_param.Revision == null) { BPolicy tmpBPolicy = BPolicyRepository.SelBPolicy(new BPolicy { OID = _param.BPolicyOID }).First(); if (tmpBPolicy.IsRevision != null && tmpBPolicy.IsRevision.Equals("Y")) { _param.TdmxOID = DObjectRepository.SelTdmxOID(new DObject { Type = _param.Type }); _param.Revision = CommonConstant.REVISION_PREFIX + CommonConstant.INIT_REVISION; } } _param.IsLatest = 1; _param.IsReleasedLatest = 0; result = DaoFactory.SetInsert("Comm.InsDObject", _param); return(result); }
public static int DelDObject(DObject _param) { int result = -1; _param.DeleteUs = 1; result = DaoFactory.SetUpdate("Comm.DelDObject", _param); return(result); }
public static int UdtDObject(DObject _param) { int result = -1; _param.ModifyUs = 1; result = DaoFactory.SetUpdate("Comm.UdtDObject", _param); return(result); }
public static int CloneDObject(DObject _param) { int result = -1; DObject targetDobj = DObjectRepository.SelDObject(new DObject { OID = _param.OID }); result = DObjectRepository.InsDObject(targetDobj); return(result); }
public static List <DObject> SelDObjects(DObject _param) { List <DObject> lDObject = DaoFactory.GetList <DObject>("Comm.SelDObject", _param); lDObject.ForEach(dObj => { dObj.BPolicy = BPolicyRepository.SelBPolicy(new BPolicy { Type = dObj.Type, OID = dObj.BPolicyOID }).First(); }); return(lDObject); }
public static DObject SelDObject(DObject _param) { DObject dObject = DaoFactory.GetData <DObject>("Comm.SelDObject", _param); if (dObject != null) { dObject.BPolicy = BPolicyRepository.SelBPolicy(new BPolicy { Type = dObject.Type, OID = dObject.BPolicyOID }).First(); } return(dObject); }
public static void SelDepartmentWithPerson(JqTreeModel _jqxTree, DObject _param, List <string> _checkitemtypes) { List <JqTreeModel> items = new List <JqTreeModel>(); DObject tmpDepartment = null; DRelationshipRepository.SelRelationship(new DRelationship { Type = CommonConstant.RELATIONSHIP_DEPARTMENT, FromOID = _param.OID }).ForEach(item => { if (tmpDepartment != null) { tmpDepartment = null; } JqTreeModel innerJqTreeModel = new JqTreeModel(); tmpDepartment = DObjectRepository.SelDObject(new DObject { Type = CommonConstant.TYPE_DEPARTMENT, OID = item.ToOID }); innerJqTreeModel.id = tmpDepartment.OID; innerJqTreeModel.label = tmpDepartment.Name; innerJqTreeModel.icon = CommonConstant.ICON_DEPARTMENT; innerJqTreeModel.iconsize = CommonConstant.DEFAULT_ICONSIZE; innerJqTreeModel.expanded = true; innerJqTreeModel.type = CommonConstant.TYPE_DEPARTMENT; innerJqTreeModel.checkitemtypes = _checkitemtypes; List <Person> personItems = PersonRepository.SelPersons(new Person { DepartmentOID = tmpDepartment.OID }); personItems.ForEach(personItem => { JqTreeModel personJqTreeModel = new JqTreeModel(); personJqTreeModel.id = personItem.OID; personJqTreeModel.label = personItem.Name; personJqTreeModel.icon = CommonConstant.ICON_PERSON; personJqTreeModel.iconsize = CommonConstant.DEFAULT_ICONSIZE; personJqTreeModel.type = CommonConstant.TYPE_PERSON; personJqTreeModel.checkitemtypes = _checkitemtypes; personJqTreeModel.value = personItem.DepartmentNm; if (innerJqTreeModel.items == null) { innerJqTreeModel.items = new List <JqTreeModel>(); } innerJqTreeModel.items.Add(personJqTreeModel); }); SelDepartmentWithPerson(innerJqTreeModel, tmpDepartment, _checkitemtypes); items.Add(innerJqTreeModel); }); if (_jqxTree.items == null) { _jqxTree.items = new List <JqTreeModel>(); } _jqxTree.items.AddRange(items); }
public static int ReviseDObject(DObject _param) { int result = -1; DObject targetDobj = DObjectRepository.SelDObject(new DObject { OID = _param.OID }); DObjectRepository.UdtReleaseLatestDObject(new DObject { OID = _param.OID, IsReleasedLatest = 0 }); targetDobj.BPolicyOID = null; targetDobj.Revision = SemsUtil.MakeMajorRevisonUp(targetDobj.Revision); result = DObjectRepository.InsDObject(targetDobj); return(result); }
public static int CopyDObject(DObject _param) { int result = -1; DObject targetDobj = DObjectRepository.SelDObject(new DObject { OID = _param.OID }); targetDobj.BPolicyOID = null; targetDobj.Revision = null; if (_param.Name != null) { targetDobj.Name = _param.Name; } result = DObjectRepository.InsDObject(targetDobj); return(result); }
public static JqTreeModel SelOrganizationWithPerson(List <string> checkitemtypes) { DObject dCompany = DObjectRepository.SelDObject(new DObject { Type = CommonConstant.TYPE_COMPANY }); JqTreeModel jqTreeModel = new JqTreeModel(); jqTreeModel.id = dCompany.OID; jqTreeModel.label = dCompany.Name; jqTreeModel.icon = CommonConstant.ICON_COMPANY; jqTreeModel.iconsize = CommonConstant.DEFAULT_ICONSIZE; jqTreeModel.expanded = true; jqTreeModel.type = CommonConstant.TYPE_COMPANY; jqTreeModel.checkitemtypes = checkitemtypes; List <JqTreeModel> items = new List <JqTreeModel>(); DObject tmpDepartment = null; DRelationshipRepository.SelRelationship(new DRelationship { Type = CommonConstant.RELATIONSHIP_DEPARTMENT, FromOID = dCompany.OID }).ForEach(item => { if (tmpDepartment != null) { tmpDepartment = null; } JqTreeModel innerJqTreeModel = new JqTreeModel(); tmpDepartment = DObjectRepository.SelDObject(new DObject { Type = CommonConstant.TYPE_DEPARTMENT, OID = item.ToOID }); innerJqTreeModel.id = tmpDepartment.OID; innerJqTreeModel.label = tmpDepartment.Name; innerJqTreeModel.icon = CommonConstant.ICON_DEPARTMENT; innerJqTreeModel.iconsize = CommonConstant.DEFAULT_ICONSIZE; innerJqTreeModel.expanded = true; innerJqTreeModel.type = CommonConstant.TYPE_DEPARTMENT; innerJqTreeModel.checkitemtypes = checkitemtypes; SelDepartmentWithPerson(innerJqTreeModel, tmpDepartment, checkitemtypes); items.Add(innerJqTreeModel); }); jqTreeModel.items = items; return(jqTreeModel); }
public static int SelNameSeq(DObject _param) { return(DaoFactory.GetData <int>("Comm.SelNameSeq", _param)); }
public static string SelTdmxOID(DObject _param) { return(DaoFactory.GetData <string>("Comm.SelMaxTDMXOID", new DObject { Type = _param.Type })); }