public LauncherForm() { this.InitializeComponent(); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); // Set window title this.Text = GameName; // Read newer file-based game settings this.config = new Config(); this.config.Read(); string baseUrl = this.config.GetString(ConfigSections.Network, ConfigKeys.MasterServerHostName); this.httpClient = new HttpClient( new HttpClientHandler() { UseProxy = false }); this.versionHttpClient = new VersionClient(this.httpClient) { BaseUrl = baseUrl }; this.communityHttpClient = new CommunityClient(this.httpClient) { BaseUrl = baseUrl }; }
public CloudServiceClientBase( ILogger logger, IHttpClientFactory clientFactory, IHttpPlatformHelperService http_helper, IToast toast, IAuthHelper authHelper, ICloudServiceSettings settings, IModelValidator validator) : base(logger, http_helper, clientFactory) { this.authHelper = authHelper; this.toast = toast; this.settings = settings; ApiBaseUrl = string.IsNullOrWhiteSpace(settings.ApiBaseUrl) ? throw new ArgumentNullException(nameof(ApiBaseUrl)) : settings.ApiBaseUrl; connection = new ApiConnection(logger, this, http_helper, validator); #region SetClients Account = new AccountClient(connection); Manage = new ManageClient(connection); AuthMessage = new AuthMessageClient(connection); Version = new VersionClient(connection); ActiveUser = new ActiveUserClient(connection); Accelerate = new AccelerateClient(connection); Script = new ScriptClient(connection); DonateRanking = new DonateRankingClient(connection); #endregion }
public Form_ShopVerison() { InitializeComponent(); ShopID = GlobalParams.ShopID; if (ShopID < 0) { MessageBox.Show("您不属于任何店铺,请联系系统管理员分配您的店铺所属!", "错误!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); this.Close(); } CarSummery_Client = (CarSummeryClient)ClientFactory.GetClient(ClientType.Type.CarSummery); Brand_Client = (BrandClient)ClientFactory.GetClient(ClientType.Type.Brand); Type_Client = (TypeClient)ClientFactory.GetClient(ClientType.Type.Type); Version_Client = (VersionClient)ClientFactory.GetClient(ClientType.Type.Version); List_Brand = Brand_Client.SelectAllBrands().ToList(); List_Type = Type_Client.SelectAllTypes().ToList(); List_VersionInfo = CarSummery_Client.SelectAllCar().ToList(); Mark = false; LB_VersionBind(); CB_BrandBind(); CB_TypeBind(); BT_UpdateVersion.Visible = false; }
public Form_OrderManage() { InitializeComponent(); UserManager_Client = (UserManagerClient)ClientFactory.GetClient(ClientType.Type.UserManager); Type_Client = (TypeClient)ClientFactory.GetClient(ClientType.Type.Type); Action_Client = (ActionClient)ClientFactory.GetClient(ClientType.Type.Action); Version_Client = (VersionClient)ClientFactory.GetClient(ClientType.Type.Version); Order_Client = (OrderClient)ClientFactory.GetClient(ClientType.Type.Order); OrderSummery_Client = (OrderSummeryClient)ClientFactory.GetClient(ClientType.Type.OrderSummery); ShopID = GlobalParams.ShopID; if (ShopID < 0) { MessageBox.Show("您不属于任何店铺,请联系系统管理员分配您的店铺所属!", "错误!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); this.Close(); } else { List_Version = Version_Client.SelectAllVersions().Where(P => P.Version_Shop == ShopID).ToList(); } List_Action = Action_Client.SelectAllActions().ToList(); List_Type = Type_Client.SelectAllTypes().ToList(); List_UserEX = UserManager_Client.SelectUserEXInfo_All().ToList(); List_User = UserManager_Client.SelectUserInfo_All().ToList(); PL_NewUser.Visible = false; PL_UserResult.Visible = false; Bind_Action(); Bind_Type(); Bind_Version(); }
public Form_PayDeposit(int Order_ID) { InitializeComponent(); this.Order_ID = Order_ID; Order_Client = (OrderClient)ClientFactory.GetClient(ClientType.Type.Order); Version_Client = (VersionClient)ClientFactory.GetClient(ClientType.Type.Version); Order = Order_Client.SelectOrder_ID(Order_ID); Version = Version_Client.SelectVersion_ID(Order.Order_Version); this.LB_Number.Text = Order.Order_Count.ToString(); this.LB_EveryPrice.Text = Version.Version_Price_Deposit.ToString(); this.LB_TotalPrice.Text = (Version.Version_Price_Deposit * Order.Order_Count).ToString(); }
private void btnLogin_Click(object sender, EventArgs e) { try { string text1 = this.txtUname.Text; if (string.IsNullOrWhiteSpace(text1)) { int num1 = (int) this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("youxiangbunengweikong"), MessageBoxIcon.Exclamation, MessageBoxButtons.OK); } else { string text2 = this.txtUpwd.Text; if (string.IsNullOrWhiteSpace(text2)) { int num2 = (int) this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("yanzhengmabunengweikong"), MessageBoxIcon.Exclamation, MessageBoxButtons.OK); } else { string id = Common.GetID(); using (VersionClient versionClient = new VersionClient()) { string version = versionClient.GetVersion(text1, text2, id); versionClient.Close(); if (string.IsNullOrWhiteSpace(version)) { int num3 = (int) this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("qinghedui"), MessageBoxIcon.Exclamation, MessageBoxButtons.OK); } else { int num4 = (int) this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("jihuochenggong"), MessageBoxIcon.Asterisk, MessageBoxButtons.OK); this.btnClose_Click(sender, e); } } } } } catch (Exception ex) { int num = (int) this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("CheckNetwork") + "\r\n" + ex.Message, MessageBoxIcon.Exclamation, MessageBoxButtons.OK); } }
private void btnLogin_Click(object sender, EventArgs e) { try { string text1 = this.txtUname.Text; if (string.IsNullOrWhiteSpace(text1)) { int num1 = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("youxiangbunengweikong"), MessageBoxIcon.Exclamation, MessageBoxButtons.OK); } else { string text2 = this.txtUpwd.Text; if (string.IsNullOrWhiteSpace(text2)) { int num2 = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("yanzhengmabunengweikong"), MessageBoxIcon.Exclamation, MessageBoxButtons.OK); } else { string id = Common.GetID(); using (VersionClient versionClient = new VersionClient()) { string version = versionClient.GetVersion(text1, text2, id); versionClient.Close(); if (string.IsNullOrWhiteSpace(version)) { int num3 = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("qinghedui"), MessageBoxIcon.Exclamation, MessageBoxButtons.OK); } else { int num4 = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("jihuochenggong"), MessageBoxIcon.Asterisk, MessageBoxButtons.OK); this.btnClose_Click(sender, e); } } } } } catch (Exception ex) { int num = (int)this.m_FrmStart.MessageBoxShow(BaseBusiness.GetResourceValue("CheckNetwork") + "\r\n" + ex.Message, MessageBoxIcon.Exclamation, MessageBoxButtons.OK); } }
public Form_VersionManage() { InitializeComponent(); Mark = false; CarSummery_Client = (CarSummeryClient)ClientFactory.GetClient(ClientType.Type.CarSummery); Province_Client = (ProvinceClient)ClientFactory.GetClient(ClientType.Type.Province); City_Client = (CityClient)ClientFactory.GetClient(ClientType.Type.City); Shop_Client = (ShopClient)ClientFactory.GetClient(ClientType.Type.Shop); Brand_Client = (BrandClient)ClientFactory.GetClient(ClientType.Type.Brand); Type_Client = (TypeClient)ClientFactory.GetClient(ClientType.Type.Type); Version_Client = (VersionClient)ClientFactory.GetClient(ClientType.Type.Version); List_VersionInfo = CarSummery_Client.SelectAllCar().ToList(); List_Car_Province = Province_Client.SelectAllProvinces().ToList(); List_City = City_Client.SelectAllCitys().ToList(); List_Shop = Shop_Client.SelectAllShops().ToList(); List_Brand = Brand_Client.SelectAllBrands().ToList(); List_Type = Type_Client.SelectAllTypes().ToList(); CB_ProviceBind(); CB_BrandBind(); CB_TypeBind(); BT_UpdateVersion.Visible = false; }
private void LoadServer() { this.treeView1.Nodes.Clear(); TreeNode node1 = new TreeNode(BaseBusiness.GetResourceValue("shujuku")); node1.Tag = (object) "serverlist"; node1.ImageIndex = 2; node1.SelectedImageIndex = 2; node1.Checked = true; this.treeView1.Nodes.Add(node1); TreeNode node2 = new TreeNode(BaseBusiness.GetResourceValue("biao")); node2.Tag = (object) "serverlist"; node2.ImageIndex = 3; node2.SelectedImageIndex = 4; node2.Checked = true; node1.Nodes.Add(node2); TreeNode node3 = new TreeNode(BaseBusiness.GetResourceValue("shitu")); node3.Tag = (object) "serverlist"; node3.ImageIndex = 3; node3.SelectedImageIndex = 4; node3.Checked = true; node1.Nodes.Add(node3); node1.ExpandAll(); try { IData dataSource = new DataFactory().CreateDataSource(this.m_FrmStart.MyDataType); if (dataSource == null) return; DataSourse data = dataSource.GetData(this.m_FrmStart.GetPdmConn()); if (!string.IsNullOrWhiteSpace(data.m_ErrorMessage)) { int num = (int) this.m_FrmStart.MessageBoxShow(data.m_ErrorMessage, MessageBoxIcon.Asterisk, MessageBoxButtons.OK); } else { List<Table> list1 = Common.ConvertT(data.ListTable); List<View> list2 = Common.ConvertT(data.ListView); if (list1 != null) { foreach (Table table1 in list1) { Table table = table1; if (!Enumerable.Any<string>((IEnumerable<string>) this.WorkflowTableAndSys, (Func<string, bool>) (a => a.ToLower() == table.Code.ToLower()))) node2.Nodes.Add(new TreeNode(table.Name) { ImageIndex = 5, SelectedImageIndex = 5, Tag = (object) table.Id, Checked = true }); } } if (list2 != null) { foreach (View view1 in list2) { View view = view1; if (!Enumerable.Any<string>((IEnumerable<string>) this.WorkflowView, (Func<string, bool>) (a => a.ToLower() == view.Code.ToLower()))) node3.Nodes.Add(new TreeNode(view.Name) { ImageIndex = 6, SelectedImageIndex = 6, Tag = (object) view.Id, Checked = true }); } } } } catch (Exception ex) { try { using (VersionClient versionClient = new VersionClient()) { versionClient.WriteExceptions(new SysException() { ComputerInfo = Common.GetID(), Message = ex.Message, StackTrace = ex.StackTrace }); versionClient.Close(); int num = (int) this.m_FrmStart.MessageBoxShow(ex.Message, MessageBoxIcon.Hand, MessageBoxButtons.OK); } } catch { } } }
/// <summary> /// 客户端服务实例产生器 /// </summary> /// <param name="type">产生的服务类型</param> /// <returns></returns> private static object build(ClientType.Type type) { switch (type) { case ClientType.Type.Account: { AccountClient temp = new AccountClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <AccountClient>(type, temp); return(temp); } case ClientType.Type.Action: { ActionClient temp = new ActionClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <ActionClient>(type, temp); return(temp); } case ClientType.Type.Brand: { BrandClient temp = new BrandClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <BrandClient>(type, temp); return(temp); } case ClientType.Type.CarSummery: { CarSummeryClient temp = new CarSummeryClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <CarSummeryClient>(type, temp); return(temp); } case ClientType.Type.Checkout: { CheckoutClient temp = new CheckoutClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <CheckoutClient>(type, temp); return(temp); } case ClientType.Type.City: { CityClient temp = new CityClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <CityClient>(type, temp); return(temp); } case ClientType.Type.Order: { OrderClient temp = new OrderClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <OrderClient>(type, temp); return(temp); } case ClientType.Type.OrderSummery: { OrderSummeryClient temp = new OrderSummeryClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <OrderSummeryClient>(type, temp); return(temp); } case ClientType.Type.Province: { ProvinceClient temp = new ProvinceClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <ProvinceClient>(type, temp); return(temp); } case ClientType.Type.RAP: { RAPClient temp = new RAPClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <RAPClient>(type, temp); return(temp); } case ClientType.Type.Salary: { SalaryClient temp = new SalaryClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <SalaryClient>(type, temp); return(temp); } case ClientType.Type.SalaryAppend: { SalaryAppendClient temp = new SalaryAppendClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <SalaryAppendClient>(type, temp); return(temp); } case ClientType.Type.SalaryInfoSummery: { SalaryInfoSummeryClient temp = new SalaryInfoSummeryClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <SalaryInfoSummeryClient>(type, temp); return(temp); } case ClientType.Type.SalaryLog: { SalaryLogClient temp = new SalaryLogClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <SalaryLogClient>(type, temp); return(temp); } case ClientType.Type.Shop: { ShopClient temp = new ShopClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <ShopClient>(type, temp); return(temp); } case ClientType.Type.Type: { TypeClient temp = new TypeClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <TypeClient>(type, temp); return(temp); } case ClientType.Type.Version: { VersionClient temp = new VersionClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <VersionClient>(type, temp); return(temp); } case ClientType.Type.WorkRAP: { WorkRAPClient temp = new WorkRAPClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <WorkRAPClient>(type, temp); return(temp); } case ClientType.Type.UserManager: { UserManagerClient temp = new UserManagerClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <UserManagerClient>(type, temp); return(temp); } case ClientType.Type.UserSummery: { UserSummeryClient temp = new UserSummeryClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <UserSummeryClient>(type, temp); return(temp); } case ClientType.Type.GetCar: { GetCarClient temp = new GetCarClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <GetCarClient>(type, temp); return(temp); } } ; return(null); }
public UtilsController(VersionClient versionClient) { _versionClient = versionClient; }
private void ConnectToService() { if (!string.IsNullOrWhiteSpace(hostTextbox.Text) && !string.IsNullOrWhiteSpace(portTextbox.Text) && portTextbox.Text.All(c => "0123456789".Contains(c))) { var uri = new Uri($"http://{hostTextbox.Text}:{portTextbox.Text}"); LOGGER.Info($"Trying to connect to '{uri}'"); VersionClient client = new VersionClient(uri); if (!string.IsNullOrWhiteSpace(usernameTextbox.Text) && !string.IsNullOrWhiteSpace(passwordTextbox.Text)) { LOGGER.Info($"Using username and password authentification"); LOGGER.Debug($"username: '******', password: '******'"); client = new VersionClient(new Uri($"http://{hostTextbox.Text}:{portTextbox.Text}"), usernameTextbox.Text, passwordTextbox.Text); } IsConnected = client.IsAvailable(); if (IsConnected) { LOGGER.Info($"Connection could be established!"); connectionStatusLabel.BackColor = Color.LightGreen; connectionStatusLabel.ForeColor = Color.DarkGreen; connectionStatusLabel.Text = "Erfolgreich verbunden"; Host = hostTextbox.Text; Port = portTextbox.Text; Username = usernameTextbox.Text; Password = passwordTextbox.Text; LOGGER.Info($"Creating account client"); AccountClient = new AccountClient(new Uri($"http://{Host}:{Port}")); if (!string.IsNullOrWhiteSpace(Username) && !string.IsNullOrWhiteSpace(Password)) { AccountClient = new AccountClient(new Uri($"http://{Host}:{Port}"), Username, Password); } LOGGER.Info($"Creating task client"); TaskClient = new TaskClient(new Uri($"http://{Host}:{Port}")); if (!string.IsNullOrWhiteSpace(Username) && !string.IsNullOrWhiteSpace(Password)) { TaskClient = new TaskClient(new Uri($"http://{Host}:{Port}"), Username, Password); } ReloadAccounts(); } else { LOGGER.Error($"Connection could not be established!"); connectionStatusLabel.BackColor = Color.FromArgb(255, 192, 192); connectionStatusLabel.ForeColor = Color.DarkRed; connectionStatusLabel.Text = "Verbindung fehlgeschlagen"; } mainSplitContainer.Enabled = IsConnected; } else { LOGGER.Warn($"User did not provide valid host and port => connection can't be established!"); MessageBox.Show(this, "Bitte einen gültigen Host und Port angeben!"); } }
private void LoadServer() { this.treeView1.Nodes.Clear(); TreeNode node1 = new TreeNode(BaseBusiness.GetResourceValue("shujuku")); node1.Tag = (object)"serverlist"; node1.ImageIndex = 2; node1.SelectedImageIndex = 2; node1.Checked = true; this.treeView1.Nodes.Add(node1); TreeNode node2 = new TreeNode(BaseBusiness.GetResourceValue("biao")); node2.Tag = (object)"serverlist"; node2.ImageIndex = 3; node2.SelectedImageIndex = 4; node2.Checked = true; node1.Nodes.Add(node2); TreeNode node3 = new TreeNode(BaseBusiness.GetResourceValue("shitu")); node3.Tag = (object)"serverlist"; node3.ImageIndex = 3; node3.SelectedImageIndex = 4; node3.Checked = true; node1.Nodes.Add(node3); node1.ExpandAll(); try { IData dataSource = new DataFactory().CreateDataSource(this.m_FrmStart.MyDataType); if (dataSource == null) { return; } DataSourse data = dataSource.GetData(this.m_FrmStart.GetPdmConn()); if (!string.IsNullOrWhiteSpace(data.m_ErrorMessage)) { int num = (int)this.m_FrmStart.MessageBoxShow(data.m_ErrorMessage, MessageBoxIcon.Asterisk, MessageBoxButtons.OK); } else { List <Table> list1 = Common.ConvertT(data.ListTable); List <View> list2 = Common.ConvertT(data.ListView); if (list1 != null) { foreach (Table table1 in list1) { Table table = table1; if (!Enumerable.Any <string>((IEnumerable <string>) this.WorkflowTableAndSys, (Func <string, bool>)(a => a.ToLower() == table.Code.ToLower()))) { node2.Nodes.Add(new TreeNode(table.Name) { ImageIndex = 5, SelectedImageIndex = 5, Tag = (object)table.Id, Checked = true }); } } } if (list2 != null) { foreach (View view1 in list2) { View view = view1; if (!Enumerable.Any <string>((IEnumerable <string>) this.WorkflowView, (Func <string, bool>)(a => a.ToLower() == view.Code.ToLower()))) { node3.Nodes.Add(new TreeNode(view.Name) { ImageIndex = 6, SelectedImageIndex = 6, Tag = (object)view.Id, Checked = true }); } } } } } catch (Exception ex) { try { using (VersionClient versionClient = new VersionClient()) { versionClient.WriteExceptions(new SysException() { ComputerInfo = Common.GetID(), Message = ex.Message, StackTrace = ex.StackTrace }); versionClient.Close(); int num = (int)this.m_FrmStart.MessageBoxShow(ex.Message, MessageBoxIcon.Hand, MessageBoxButtons.OK); } } catch { } } }
public HomeController(VersionClient versionClient) { _versionClient = versionClient; }