Exemplo n.º 1
0
        //加载该用户3106的权限3108
        private void InitParam()
        {
            try
            {
                WebRequest webRequest = new WebRequest();

                webRequest.Code    = (int)S3108Codes.GetAuthorityParam;
                webRequest.Session = CurrentApp.Session;
                Service31081Client client = new Service31081Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                   WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31081"));
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("InitParam:WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    //OperationReturn optReturn = XMLHelper.DeserializeObject<OperationInfo>(webReturn.ListData[i]);
                    //if (!optReturn.Result)
                    //{
                    //    ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    //    return;
                    //}
                    //OperationInfo SPInfo = optReturn.Data as OperationInfo;
                    //string Code = SPInfo.ID.ToString();
                    string Code = webReturn.ListData[i];
                    if (Code.Length > 4)
                    {
                        ObjectItem item = new ObjectItem();
                        //Code = webReturn.ListData[i];
                        item.ItemID      = Code;
                        item.Name        = CurrentApp.GetLanguageInfo(string.Format("FO{0}", Code), Code);
                        item.Description = CurrentApp.GetLanguageInfo(string.Format("3108D{0}", Code), Code);
                        Code             = Code.Substring(4);
                        item.ObjID       = Code.Substring(1);
                        switch (Code.Count())
                        {
                        case 2:
                            item.ObjType     = 1;
                            item.ObjParentID = "0";
                            item.Data        = item;
                            break;

                        case 4:
                            item.ObjType     = 2;
                            item.ObjParentID = Code.Substring(1, 1);
                            item.Data        = item;
                            break;

                        case 7:
                            item.ObjType     = 3;
                            item.ObjParentID = Code.Substring(1, 3);
                            QualityParam tempQP = ListQP.Find(p => p.ParentTreeID == item.ItemID);
                            item.Data = tempQP;
                            break;

                        default:
                            break;
                        }
                        mListObjectItems.Add(item);
                    }
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Exemplo n.º 2
0
        private void InitQualityParam()
        {
            ListQP.Clear();
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)S3108Codes.GetQualityParam;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add("31");
                webRequest.ListData.Add("0");
                webRequest.ListData.Add("310101");
                Service31081Client client = new Service31081Client(WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                                                                   WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service31081"));
                //Service31061Client client = new Service31061Client();
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("InitQualityParam:WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }
                List <QualityParam> listGlobalParam = new List <QualityParam>();
                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    OperationReturn optReturn = XMLHelper.DeserializeObject <QualityParam>(webReturn.ListData[i]);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    QualityParam GlobalParamInfo = optReturn.Data as QualityParam;
                    //将获取的数据一条条加入ListQP,并且获取name和description
                    string LanguageCode = string.Empty; string GroupCode = string.Empty;
                    GetGroupID(GlobalParamInfo.GroupID.ToString().Substring(4), out GroupCode);
                    GetParamID(GlobalParamInfo.GroupID.ToString().Substring(4), out LanguageCode);

                    LanguageCode               += GlobalParamInfo.SortID.ToString();
                    GlobalParamInfo.Name        = CurrentApp.GetLanguageInfo(string.Format("3108{0}", LanguageCode), "");
                    GlobalParamInfo.Description = CurrentApp.GetLanguageInfo(string.Format("3108D{0}", LanguageCode), "");
                    switch (GlobalParamInfo.GroupID - 310100)
                    {
                    case 1:
                        GlobalParamInfo.ParentTreeID = "31080101001";
                        break;

                    case 2:
                        GlobalParamInfo.ParentTreeID = "31080101002";
                        break;

                    case 3:
                        GlobalParamInfo.ParentTreeID = "31080101003";
                        break;

                    case 4:
                        GlobalParamInfo.ParentTreeID = "31080101004";
                        break;
                    }
                    ListQP.Add(GlobalParamInfo);
                }
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Exemplo n.º 3
0
        public override void ChangeLanguage()
        {
            base.ChangeLanguage();
            //PageHead.AppName = CurrentApp.GetLanguageInfo("3108000", "UMP Statistical Param Configuration");
            CurrentApp.AppTitle = CurrentApp.GetLanguageInfo(string.Format("FO{0}", CurrentApp.ModuleID), "Advance Configuration");

            LbLeft.Text          = CurrentApp.GetLanguageInfo("3108L001", "Statistical Param List");
            LbCurrentObject.Text = CurrentApp.GetLanguageInfo("3108L002", "参数");
            LbRight.Text         = CurrentApp.GetLanguageInfo("3108L003", "操作");
            LbDescriptions.Text  = CurrentApp.GetLanguageInfo("3108L004", "描述");

            for (int i = 0; i < ListQP.Count; i++)
            {
                string ID = string.Empty;
                //GetParamID(ListQP[i].GroupID.ToString().Substring(4), out ID);
                ID                    = ListQP[i].ParamID.ToString().Substring(5).Replace("0", "");
                ListQP[i].Name        = CurrentApp.GetLanguageInfo(string.Format("31081{0}", ID), ListQP[i].GroupID.ToString());
                ListQP[i].Description = CurrentApp.GetLanguageInfo(string.Format("3108D1{0}", ID), ListQP[i].GroupID.ToString());
            }
            //更新左边树的语言
            for (int i = 0; i < mListObjectItems.Count; i++)
            {
                ObjectItem item = mListObjectItems[i];
                item.Name = CurrentApp.GetLanguageInfo(string.Format("FO{0}", item.ItemID), "change lang");
            }
            //更新操作的语言
            InitOperation();
            InitBasicOperations();
            //更新Border语言
            if (this.PanelPropertyList.Child != null)
            {
                string Code            = objectItemTree.ItemID;
                string tempDescription = string.Format("{0}:\r\n", objectItemTree.Name);
                switch (Code)
                {
                //查询质检参数配置
                case "31080101001":
                case "31080101002":
                case "31080101003":
                    QPCPage.ChangeLanguage();
                    QualityParam        QPTemp     = objectItemTree.Data as QualityParam;
                    List <QualityParam> QPTempList = (from LQP in ListQP
                                                      where LQP.GroupID == QPTemp.GroupID
                                                      orderby LQP.SortID
                                                      select LQP).ToList();

                    TxtDescription.Text = string.Format("{0}:\n\n{1}\n\n{2}", QPTemp.Name, QPTempList[0].Description, QPTempList[1].Description);
                    break;

                case "31080101004":
                    QPTCPage.ChangeLanguage();
                    List <QualityParam> QPTTempList = (from LQP in ListQP
                                                       where LQP.ParentTreeID == objectItemTree.ItemID
                                                       orderby LQP.SortID
                                                       select LQP).ToList();
                    //TxtDescription.Text = string.Format("  {0}:\n\n  {1}\n\n  {2}", objectItemTree.Name, QPTTempList[0].Description, QPTTempList[1].Description);
                    foreach (QualityParam info in QPTTempList)
                    {
                        tempDescription += string.Format("{0}\r\n", info.Description);
                    }
                    TxtDescription.Text = tempDescription;
                    break;

                //abcd参数配置
                case "31080102001":
                case "31080102002":
                    paramsItemsconfigPage.ChangeLanguage();
                    //combStatiParaItemsDesigner.ChangeLanguage();
                    TxtDescription.Text = objectItemTree.Name;
                    CreatButton();
                    break;

                case "":
                    break;

                //机构和技能组
                case "31080201":
                case "31080202":
                    Orgpage.ChangeLanguage();
                    TxtDescription.Text = objectItemTree.Name;
                    CreatButton();
                    break;

                default:
                    if (Code.Length > 8)
                    {
                        paramsItemsconfigPage.ChangeLanguage();
                        TxtDescription.Text = objectItemTree.Name;
                    }
                    break;
                }
            }
            //更新panel语言
            if (PopupPanel.Content != null)
            {
                string Code = objectItemTree.ItemID;
                switch (Code)
                {
                //abcd参数配置
                case "31080102001":
                case "31080102002":
                    break;

                case "":
                    break;

                //机构和技能组
                case "31080201":
                case "31080202":
                    ABCDConfigPage abcdPage = PopupPanel.Content as ABCDConfigPage;
                    abcdPage.CurrentApp = CurrentApp;
                    abcdPage.ChangeLanguage();
                    break;

                default:
                    if (Code.Length > 8)
                    {
                    }
                    break;
                }
            }
        }