private void LoadGroupingMethodParams()
        {
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Code    = (int)RequestCode.WSGetGlobalParamList;
                webRequest.Session = CurrentApp.Session;
                webRequest.ListData.Add("11");
                webRequest.ListData.Add("12010401");
                webRequest.ListData.Add("120104");
                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;
                }
                //List<GlobalParamInfo> listGlobalParam = new List<GlobalParamInfo>();

                for (int i = 0; i < webReturn.ListData.Count; i++)
                {
                    string str = webReturn.ListData[i];
                    str = str.Replace("&#x1B;", "");
                    OperationReturn optReturn = XMLHelper.DeserializeObject <GlobalParamInfo>(str);
                    if (!optReturn.Result)
                    {
                        ShowException(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                        return;
                    }
                    GlobalParamInfo GlobalParamInfo = optReturn.Data as GlobalParamInfo;
                    if (GlobalParamInfo == null)
                    {
                        return;
                    }
                    string tempGroupWay = GlobalParamInfo.ParamValue.Substring(8);
                    //string tempIsScore = GlobalParamInfo.ParamValue.Substring(GlobalParamInfo.ParamValue.Length - 1, 1);
                    //ScoreParamsInfo tempThisClass = new ScoreParamsInfo();
                    //tempThisClass.Value = tempGroupWay;
                    //tempThisClass.Value = tempIsScore;
                    //mScoreParams.Add(tempThisClass);
                    GroupingWay = tempGroupWay;
                }
                //MessageBox.Show(GroupingWay);
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }
Exemple #2
0
 private void LoadGroupingMethodParams()
 {
     try
     {
         WebRequest webRequest = new WebRequest();
         webRequest.Code    = (int)RequestCode.WSGetGlobalParamList;
         webRequest.Session = Session;
         webRequest.ListData.Add("11");
         webRequest.ListData.Add("12010401");
         webRequest.ListData.Add("120104");
         Service11012Client client = new Service11012Client(WebHelper.CreateBasicHttpBinding(Session),
                                                            WebHelper.CreateEndpointAddress(Session.AppServerInfo, "Service11012"));
         WebReturn webReturn = client.DoOperation(webRequest);
         client.Close();
         if (!webReturn.Result)
         {
             ShowExceptionMessage(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
             return;
         }
         if (webReturn.ListData.Count <= 0)
         {
             return;
         }
         string str = webReturn.ListData[0];
         str = str.Replace("&#x1B;", "");
         OperationReturn optReturn = XMLHelper.DeserializeObject <GlobalParamInfo>(str);
         if (!optReturn.Result)
         {
             ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
             return;
         }
         GlobalParamInfo GlobalParamInfo = optReturn.Data as GlobalParamInfo;
         if (GlobalParamInfo == null)
         {
             return;
         }
         string tempGroupWay = GlobalParamInfo.ParamValue.Substring(8);
         GroupingWay = tempGroupWay;
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex.Message);
     }
 }
Exemple #3
0
        private void ModifyAgentPassword()
        {
            GlobalParamInfo GlobalParam = new GlobalParamInfo();

            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)RequestCode.WSGetGlobalParamList;
                webRequest.ListData.Add("11");
                webRequest.ListData.Add("11010501");
                webRequest.ListData.Add(string.Empty);

                Service11012Client client = new Service11012Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11012"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (!webReturn.Result)
                {
                    ShowException(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                    return;
                }

                OperationReturn optReturn = XMLHelper.DeserializeObject <GlobalParamInfo>(webReturn.ListData[0]);
                if (!optReturn.Result)
                {
                    ShowException(string.Format("InitColumnData Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return;
                }
                GlobalParam = optReturn.Data as GlobalParamInfo;
                if (GlobalParam == null)
                {
                    return;
                }
            }
            catch (Exception ex) { ShowException(ex.Message); }
            try
            {
                WebRequest webRequest = new WebRequest();
                webRequest.Session = CurrentApp.Session;
                webRequest.Code    = (int)S1103Codes.UPAgentPwd;
                webRequest.ListData.Add(mCurrentItem.ObjID.ToString());
                //  webRequest.ListData.Add(mCurrentItem.Name.ToString());
                webRequest.ListData.Add(GlobalParam.ParamValue.Substring(8));//新密码
                //  Service11031Client client = new Service11031Client();
                Service11031Client client = new Service11031Client(
                    WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                    WebHelper.CreateEndpointAddress(CurrentApp.Session.AppServerInfo, "Service11031"));
                WebHelper.SetServiceClient(client);
                WebReturn webReturn = client.DoOperation(webRequest);
                client.Close();
                if (webReturn.Result)
                {
                    CurrentApp.ShowInfoMessage(CurrentApp.GetLanguageInfo("S1103030", "Modify Sucessed"));
                    #region 写操作日志
                    string msg_success = string.Format("{0} {1} :{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString("FO1103004"), mCurrentItem.Name);
                    CurrentApp.WriteOperationLog("1103004", ConstValue.OPT_RESULT_SUCCESS, msg_success);
                    #endregion
                }
                else//失败
                {
                    ShowException(string.Format("{0}:{1}", CurrentApp.GetLanguageInfo("S1103031", webReturn.Message), webReturn.Message));
                    #region 写操作日志
                    string msg_Fail = string.Format("{0} {1} :{2}", CurrentApp.Session.UserInfo.UserName, Utils.FormatOptLogString("FO1103004"), mCurrentItem.Name);
                    CurrentApp.WriteOperationLog("1103004".ToString(), ConstValue.OPT_RESULT_FAIL, msg_Fail);
                    #endregion
                }
            }
            catch (Exception ex) { ShowException(ex.Message); }
        }