private void SetTestUser(OrgUserItem objItem, ref List <string> listObjectState) { try { foreach (CheckableItemBase checkableItemBase in objItem.Children) { OrgUserItem child = checkableItemBase as OrgUserItem; if (child == null) { continue; } if (child.ObjType == ConstValue.RESOURCE_AGENT || child.ObjType == ConstValue.RESOURCE_REALEXT || child.ObjType == ConstValue.RESOURCE_EXTENSION) { if (child.IsChecked == true) { listObjectState.Add(string.Format("{0}{1}{2}{3}{4}{5}{6}", child.ObjID, ConstValue.SPLITER_CHAR, "1", ConstValue.SPLITER_CHAR, child.Name, ConstValue.SPLITER_CHAR, child.Description)); } else if (child.IsChecked == false) { listObjectState.Add(string.Format("{0}{1}{2}{3}{4}{5}{6}", child.ObjID, ConstValue.SPLITER_CHAR, "0", ConstValue.SPLITER_CHAR, child.Name, ConstValue.SPLITER_CHAR, child.Description)); } } SetTestUser(child, ref listObjectState); } } catch (Exception ex) { ShowException(ex.Message); } }
private void SetScoreSheetUser(OrgUserItem objItem, ref List <string> listObjectState) { try { for (int i = 0; i < objItem.Children.Count; i++) { OrgUserItem child = objItem.Children[i] as OrgUserItem; if (child == null) { continue; } if (child.ObjType == ConstValue.RESOURCE_AGENT || child.ObjType == ConstValue.RESOURCE_REALEXT || child.ObjType == ConstValue.RESOURCE_EXTENSION) { if (child.IsChecked == true) { listObjectState.Add(string.Format("{0}{1}{2}", child.ObjID, ConstValue.SPLITER_CHAR, "1")); } else if (child.IsChecked == false) { listObjectState.Add(string.Format("{0}{1}{2}", child.ObjID, ConstValue.SPLITER_CHAR, "0")); } } SetScoreSheetUser(child, ref listObjectState); } } catch (Exception ex) { ShowException(ex.Message); } }
private void SetObjectCheckState(OrgUserItem parentItem) { if (parentItem == null) { return; } try { if (parentItem.Children.Count > 0) { for (int i = 0; i < parentItem.Children.Count; i++) { SetObjectCheckState(parentItem.Children[i] as OrgUserItem); } } else { if (mListScoreSheetUsers.Contains(parentItem.ObjID.ToString())) { parentItem.IsChecked = true; } } } catch (Exception ex) { ShowException(ex.Message); } }
private void SetObjectCheckState(OrgUserItem parentItem) { if (parentItem == null) { return; } try { if (parentItem.Children.Count > 0) { foreach (CheckableItemBase checkableItemBase in parentItem.Children) { SetObjectCheckState(checkableItemBase as OrgUserItem); } } else { if (_mListTestUsers.Contains(parentItem.ObjID.ToString())) { parentItem.IsChecked = true; } } } catch (Exception ex) { ShowException(ex.Message); } }
private void LoadAvaliableAgent(OrgUserItem parentItem, string parentId) { try { WebRequest webRequest = new WebRequest { Session = CurrentApp.Session, Code = (int)S3603Codes.OptGetCtrolAgent }; webRequest.ListData.Add(CurrentApp.Session.UserID.ToString()); webRequest.ListData.Add(parentId); Service36031Client client = new Service36031Client( WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress( CurrentApp.Session.AppServerInfo, "Service36031")); //var client = new Service36031Client(); WebReturn webReturn = client.UmpTaskOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { ShowException("Fail.\tListData is null"); return; } foreach (string strInfo in webReturn.ListData) { string[] arrInfo = strInfo.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.RemoveEmptyEntries); if (arrInfo.Length < 3) { continue; } string strId = arrInfo[0]; string strName = arrInfo[1]; string strFullName = arrInfo[2]; OrgUserItem item = new OrgUserItem { ObjType = ConstValue.RESOURCE_AGENT, ObjID = Convert.ToInt64(strId), Name = strName, Description = strFullName, Data = strInfo, Icon = "Images/user_suit.png" }; Dispatcher.Invoke(new Action(() => parentItem.AddChild(item))); _mListOrgUserItems.Add(item); } } catch (Exception ex) { ShowException(ex.Message); } }
public ScoreUserManagement() { InitializeComponent(); mRootItem = new OrgUserItem(); mListOrgUserItems = new List <OrgUserItem>(); mListScoreSheetUsers = new List <string>(); Loaded += ScoreUserManagement_Loaded; }
private void LoadAvaliableUsers(OrgUserItem parentItem, string parentID) { try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.WSGetUserObjList; webRequest.ListData.Add(CurrentApp.Session.UserID.ToString()); webRequest.ListData.Add("0"); webRequest.ListData.Add(ConstValue.RESOURCE_USER.ToString()); webRequest.ListData.Add(parentID); Service11012Client client = new Service11012Client( WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress( CurrentApp.Session.AppServerInfo, "Service11012")); WebReturn webReturn = client.DoOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { ShowException(string.Format("Fail.\tListData is null")); return; } for (int i = 0; i < webReturn.ListData.Count; i++) { string strInfo = webReturn.ListData[i]; string[] arrInfo = strInfo.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.RemoveEmptyEntries); if (arrInfo.Length < 3) { continue; } string strID = arrInfo[0]; string strName = arrInfo[1]; string strFullName = arrInfo[2]; OrgUserItem item = new OrgUserItem(); item.ObjType = ConstValue.RESOURCE_USER; item.ObjID = Convert.ToInt64(strID); item.Name = strName; item.Description = strFullName; item.Data = strInfo; item.Icon = "Images/user.ico"; Dispatcher.Invoke(new Action(() => parentItem.AddChild(item))); mListOrgUserItems.Add(item); } } catch (Exception ex) { ShowException(ex.Message); } }
public UserManagement() { InitializeComponent(); MRootItem = new OrgUserItem(); _mListOrgUserItems = new List <OrgUserItem>(); _mListTestUsers = new List <string>(); Loaded += TestUserManagement_Loaded; Loaded += UCCustomSetting_Loaded; }
public UCRegionManagement() { InitializeComponent(); mRootItem = new OrgUserItem(); mListOrgUserItems = new List <OrgUserItem>(); mListRegionUserIDs = new List <long>(); Loaded += UCRegionManagement_Loaded; BtnConfirm.Click += BtnConfirm_Click; BtnClose.Click += BtnClose_Click; }
private void AddChild(OrgUserItem parent, OrgUserItem child) { Dispatcher.Invoke(new Action(() => parent.AddChild(child))); }
private void LoadUserUserInfos(OrgUserItem parentItem, long parentID) { try { WebRequest webRequest = new WebRequest(); webRequest.Session = CurrentApp.Session; webRequest.Code = (int)RequestCode.WSGetUserCtlObjList; webRequest.ListData.Add(CurrentApp.Session.UserID.ToString()); webRequest.ListData.Add("0"); webRequest.ListData.Add(ConstValue.RESOURCE_USER.ToString()); webRequest.ListData.Add(parentID.ToString()); Service11012Client client = new Service11012Client( WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11012")); WebReturn webReturn = client.DoOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("WSFail\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { ShowException(string.Format("Fail.\tListData is null")); return; } OperationReturn optReturn; int count = webReturn.ListData.Count; for (int i = 0; i < count; i++) { string strInfo = webReturn.ListData[i]; optReturn = XMLHelper.DeserializeObject <ResourceObject>(strInfo); if (!optReturn.Result) { ShowException(string.Format("Fail\t{0}\t{1}", optReturn.Code, optReturn.Message)); return; } ResourceObject info = optReturn.Data as ResourceObject; if (info == null) { ShowException(string.Format("Fail.\tResourceObject is null")); return; } OrgUserItem item = new OrgUserItem(); item.ObjType = info.ObjType; item.ObjID = info.ObjID; item.Name = info.Name; item.Description = info.FullName; item.Icon = "Images/00002.png"; item.Data = info; mListOrgUserItems.Add(item); AddChild(parentItem, item); } CurrentApp.WriteLog("LoadUserOrgInfos", string.Format("Load end.\t{0}", count)); } catch (Exception ex) { ShowException(ex.Message); } }
private void LoadAvaliableOrgs(OrgUserItem parentItem, string parentId) { try { WebRequest webRequest = new WebRequest { Session = CurrentApp.Session, Code = (int)RequestCode.WSGetUserObjList }; webRequest.ListData.Add(CurrentApp.Session.UserID.ToString()); webRequest.ListData.Add("0"); webRequest.ListData.Add(ConstValue.RESOURCE_ORG.ToString()); webRequest.ListData.Add(parentId); Service11012Client client = new Service11012Client( WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress( CurrentApp.Session.AppServerInfo, "Service11012")); WebReturn webReturn = client.DoOperation(webRequest); client.Close(); if (!webReturn.Result) { ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message)); return; } if (webReturn.ListData == null) { ShowException("Fail.\tListData is null"); return; } foreach (string strInfo in webReturn.ListData) { string[] arrInfo = strInfo.Split(new[] { ConstValue.SPLITER_CHAR }, StringSplitOptions.RemoveEmptyEntries); if (arrInfo.Length < 2) { continue; } string strId = arrInfo[0]; string strName = arrInfo[1]; OrgUserItem item = new OrgUserItem { ObjType = ConstValue.RESOURCE_ORG, ObjID = Convert.ToInt64(strId), Name = strName, Data = strInfo, Icon = strId == ConstValue.ORG_ROOT.ToString() ? "Images/rootorg.ico" : "Images/org.ico" }; LoadAvaliableOrgs(item, strId); //LoadAvaliableUsers(item, strID); if (S3603App.GroupingWay.Contains("A")) { LoadAvaliableAgent(item, strId); } Dispatcher.Invoke(new Action(() => parentItem.AddChild(item))); _mListOrgUserItems.Add(item); } } catch (Exception ex) { ShowException(ex.Message); } }