Ejemplo n.º 1
0
        public void InitControledAgentAndOrg(string OrgID)
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = Session;
                webRequest.Code    = (int)S3106Codes.GetControlOrgInfoList;
                webRequest.ListData.Add(Session.UserID.ToString());
                webRequest.ListData.Add(OrgID);
                //Service31061Client client = new Service31061Client();
                Service31061Client client    = new Service31061Client(WebHelper.CreateBasicHttpBinding(Session), WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service31061"));
                WebReturn          webReturn = client.UMPTreeOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData == null)
                {
                    ShowExceptionMessage(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;
                    }
                    CtrolOrg ctrolOrg = new CtrolOrg();
                    ctrolOrg.ID          = arrInfo[0];
                    ctrolOrg.OrgName     = arrInfo[1];
                    ctrolOrg.OrgParentID = arrInfo[2];

                    if (OrgID.Equals("-1"))
                    {
                        CurrentOrg = ctrolOrg.OrgParentID;
                    }


                    if (ListCtrolOrgInfos.Where(p => p.ID == ctrolOrg.ID).Count() == 0)
                    {
                        ListCtrolOrgInfos.Add(ctrolOrg);
                    }
                    InitControledAgentAndOrg(arrInfo[0]);
                    InitControlAgents(arrInfo[0]);
                    InitControlQA(arrInfo[0]);
                }
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void GetBrowseHistory()
        {
            mListBrowseInfo.Clear();
            string strSql = string.Empty;

            if (mFileInto != null)
            {
                strSql = string.Format("SELECT * FROM T_31_059_{0} WHERE C001={1}  ORDER BY C002,C006", CurrentApp.Session.RentInfo.Token, mFileInto.FileID);
            }
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S3106Codes.GetBrowseHistory;
                webRequest.ListData.Add(strSql);
                Service31061Client client = new Service31061Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session), WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31061"));
                //Service31061Client client = new Service31061Client();
                WebReturn webReturn = client.UMPTreeOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    return;
                }
                if (webReturn.ListData.Count <= 0)
                {
                    return;
                }
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    OperationReturn optReturn = XMLHelper.DeserializeObject <FilesItemInfo>(webReturn.ListData[i]);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        continue;
                    }
                    FilesItemInfo filesItem = optReturn.Data as FilesItemInfo;
                    if (filesItem == null)
                    {
                        ShowException(string.Format("Fail. filesItem is null"));
                        return;
                    }
                    filesItem.RowNumber = i + 1;
                    mListBrowseInfo.Add(filesItem);
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Ejemplo n.º 3
0
        //得到当前用所有角色的权限并集
        public void InitControledOperations(string modelId, string parentId)
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Code = (int)S3106Codes.GetUserOperationList;
                //webRequest.Code = (int)RequestCode.WSGetUserOptList;
                webRequest.Session = Session;
                webRequest.ListData.Add(Session.UserInfo.UserID.ToString());
                webRequest.ListData.Add(modelId);
                webRequest.ListData.Add(parentId);

                //Service11012Client client = new Service31031Client();
                Service31061Client client = new Service31061Client(WebHelper.CreateBasicHttpBinding(Session), WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service31061"));
                //WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.UMPTreeOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                ListOperationInfos.Clear();
                if (webReturn.ListData.Count > 0)
                {
                    for (int i = 0; i < webReturn.ListData.Count; i++)
                    {
                        OperationReturn optReturn = XMLHelper.DeserializeObject <OperationInfo>(webReturn.ListData[i]);
                        if (!optReturn.Result)
                        {
                            ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                            return;
                        }
                        OperationInfo optInfo = optReturn.Data as OperationInfo;
                        if (optInfo != null)
                        {
                            optInfo.Display     = GetLanguageInfo(string.Format("FO{0}", optInfo.ID), optInfo.ID.ToString());
                            optInfo.Description = optInfo.Display;
                            ListOperationInfos.Add(optInfo);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex.Message);
            }
        }
Ejemplo n.º 4
0
        private void InitControlQA(string parentID)
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = Session;
                webRequest.Code    = (int)S3106Codes.GetQA;
                webRequest.ListData.Add(parentID);
                //Service31061Client client = new Service31061Client();
                Service31061Client client    = new Service31061Client(WebHelper.CreateBasicHttpBinding(Session), WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service31061"));
                WebReturn          webReturn = client.UMPTreeOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                if (webReturn.ListData == null)
                {
                    ShowExceptionMessage(string.Format("Fail.\tListData is null"));
                    return;
                }
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    string          strInfo   = webReturn.ListData[i];
                    OperationReturn optReturn = XMLHelper.DeserializeObject <CtrolQA>(webReturn.ListData[i]);
                    if (!optReturn.Result)
                    {
                        ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    CtrolQA ctrolQa = optReturn.Data as CtrolQA;

                    if (ctrolQa != null)
                    {
                        ListCtrolQAInfos.Add(ctrolQa);
                    }
                }
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex.Message);
            }
        }