Beispiel #1
0
 private void SettingPage_Loaded(object sender, RoutedEventArgs e)
 {
     TxtbRent.Text            = resource.TenantName;
     TxtbResource.Text        = resource.ToString();
     this.dtValidTime.Value   = DateTime.Now;
     this.dtInValidTime.Value = DateTime.MaxValue;
     ChangeLanguage();
 }
Beispiel #2
0
        //初始化Listresources
        public void LoadVCLogServerInfo()
        {
            Listresources.Clear();
            WebRequest webRequest = new WebRequest();

            webRequest.Session = CurrentApp.Session;
            webRequest.Code    = (int)WebCodes.GetVoiceIP_Name201;
            Service11111Client client = new Service11111Client(
                WebHelper.CreateBasicHttpBinding(CurrentApp.Session),
                WebHelper.CreateEndpointAddress(
                    CurrentApp.Session.AppServerInfo,
                    "Service11111"));

            //Service1111Client client = new Service1111Client();
            WebHelper.SetServiceClient(client);
            WebReturn webReturn = client.DoOperation(webRequest);

            client.Close();
            if (!webReturn.Result)
            {
                CurrentApp.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                return;
            }
            if (webReturn.ListData == null)
            {
                CurrentApp.ShowExceptionMessage(string.Format("WSFail.\t{0}\t{1}", webReturn.Code, webReturn.Message));
                return;
            }
            OperationReturn optReturn;

            for (int i = 0; i < webReturn.ListData.Count; i++)
            {
                optReturn = XMLHelper.DeserializeObject <ResourceInfo>(webReturn.ListData[i]);
                if (!optReturn.Result)
                {
                    CurrentApp.ShowExceptionMessage(string.Format("Fail.\t{0}\t{1}", optReturn.Code, optReturn.Message));
                    return;
                }
                ResourceInfo info = optReturn.Data as ResourceInfo;
                if (info == null)
                {
                    CurrentApp.ShowExceptionMessage(string.Format("ResourcePropertyInfo is null"));
                    return;
                }

                long InfoID = info.ResourceID;
                for (int j = 0; j < ListRelation.Count; j++)
                {
                    if (ListRelation[j].ResourceID == InfoID)
                    {
                        info.IsUsed   = true;
                        info.TenantID = ListRelation[j].UserID;
                        for (int k = 0; k < ListTenant.Count; k++)
                        {
                            if (ListTenant[k].RentID == ListRelation[j].UserID)
                            {
                                info.TenantName = ListTenant[k].RentName;
                            }
                        }
                    }
                }
                info.Description = info.ToString();
                Listresources.Add(info);
            }
            CurrentApp.WriteLog("PageLoad", string.Format("Init ResourceInfo"));
        }