public Form_SalaryAppend() { InitializeComponent(); ShopID = GlobalParams.ShopID; if (ShopID < 0) { MessageBox.Show("您不属于任何店铺,请联系系统管理员分配您的店铺所属!", "错误!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); this.Close(); } UserSummery_Client = (UserSummeryClient)ClientFactory.GetClient(ClientType.Type.UserSummery); UserManager_Client = (UserManagerClient)ClientFactory.GetClient(ClientType.Type.UserManager); SalaryInfoSummery_Client = (SalaryInfoSummeryClient)ClientFactory.GetClient(ClientType.Type.SalaryInfoSummery); WorkRAP_Client = (WorkRAPClient)ClientFactory.GetClient(ClientType.Type.WorkRAP); SalaryAppend_Client = (SalaryAppendClient)ClientFactory.GetClient(ClientType.Type.SalaryAppend); List_SalaryAppend = SalaryInfoSummery_Client.SelectSalaryAppend().Where(P => P.SalaryAppend_Time.Year == DateTime.Now.Year && P.SalaryAppend_Time.Month == DateTime.Now.Month).ToList(); LB_User.DisplayMember = "UserName"; LB_User.ValueMember = "UserId"; LB_User.DataSource = UserManager_Client.GetAllShops(null, null, ShopID).ToList(); mark = true; BT_Change_Click(null, null); }
/// <summary> /// 删除按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BT_DeletCity_Click(object sender, EventArgs e) { if (CB_Province.SelectedIndex <= 0) { MessageBox.Show("请先指定省份!"); return; } if (LB_City.SelectedIndex < 0) { MessageBox.Show("请选择您要删除的城市!"); return; } DialogResult res = MessageBox.Show("该操作会将您选定的城市信息连同该城市的所有店铺等信息全部删除,该操作是不可逆的,是否继续进行?", "警告!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, 0); if (res == DialogResult.OK) { UserManager_Client = (UserManagerClient)ClientFactory.GetClient(ClientType.Type.UserManager); Shop_Client = (ShopClient)ClientFactory.GetClient(ClientType.Type.Shop); int ProvinceID = Province_Client.SelectProvince_Name(CB_Province.SelectedItem.ToString()).Province_ID; int CityID = City_Client.SelectCity_Name(LB_City.SelectedItem.ToString(), ProvinceID).City_ID; if (Shop_Client.SelectShop_CityID(CityID).Count() != 0) { List <WFpart.ShopService.Car_Shop> List_Shop = Shop_Client.SelectShop_CityID(CityID).ToList(); //删除店铺和店铺关系 foreach (WFpart.ShopService.Car_Shop temp in List_Shop) { UserManager_Client.UserDropShop_ShopID(temp.Shop_ID); Shop_Client.DeleteShop(temp.Shop_ID); } } City_Client.DeleteCity(CityID); } List_City = City_Client.SelectAllCitys().ToList(); LB_CityBind(); }
//on Click function. allow the access at the program to the user creating new referencies private void signUp(object sender, EventArgs e) { try { UserManagerClient userManager = new UserManagerClient(); //initialize //check if the Email is just used for another account, if the email is valid try to create and save into the databse the account if (this.CheckEmail(EmailBoxSignUp.Text)) { //control of the good account's creation if (userManager.CreateUser(NameBoxSignUp.Text, EmailBoxSignUp.Text, EasyEncryption.MD5.ComputeMD5Hash(PasswordBoxSignUp.Text), false, null, 20)) //account's creation { MessageBox.Show("Utente creato.", "Loggati pure.", MessageBoxButtons.OK); //affermative message } else { MessageBox.Show("Sicuro?", "Temo che ci sia qualcosa che non va.", MessageBoxButtons.OK); //negative message } } else // if the Email isin't valid the program show an errore message { MessageBox.Show("Sicuro?", "Controlla l'email.", MessageBoxButtons.OK); } } catch (Exception exc) { MessageBox.Show("Errore nella connessione al server.", "Proprio non riesco.", MessageBoxButtons.OK); } }
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_ShopManage() { InitializeComponent(); Shop_Client = (ShopClient)ClientFactory.GetClient(ClientType.Type.Shop); UserManager_Client = (UserManagerClient)ClientFactory.GetClient(ClientType.Type.UserManager); List_ShopInfo = UserManager_Client.GetAllShops(null, null, null).ToList(); CB_ProviceBind(); }
public Form_UserInRole() { InitializeComponent(); UserManager_Client = (UserManagerClient)ClientFactory.GetClient(ClientType.Type.UserManager); LB_UserNameComplet(); LB_UserName_SelectedIndexChanged(null, null); LB_RoleComplet(); }
public Form_UserManage() { InitializeComponent(); this.Width = 320; UserSummery_Client = (UserSummeryClient)ClientFactory.GetClient(ClientType.Type.UserSummery); UserManager_Client = (UserManagerClient)ClientFactory.GetClient(ClientType.Type.UserManager); List_UserEX = UserManager_Client.SelectUserEXInfo_All().ToList(); List_User = UserManager_Client.SelectUserInfo_All().ToList(); }
public bool Connect() { var bizService = new UserManagerClient(); try { if (bizService.ClientCredentials != null) { bizService.ClientCredentials.UserName.UserName = UserName; bizService.ClientCredentials.UserName.Password = Password; } bizService.Open(); Connected = bizService.TryConnect(); if (Connected) { Info = bizService.GetUserInfo(); UserId = Info.Id; } return(Connected); } catch (Exception e) { try { using (var writer = new StreamWriter("c:\\distr\\cissa\\ConnectionErrors.log", true)) { writer.WriteLine("{0}: \"{1}\"; message: \"{2}\"", DateTime.Now, UserName, e.Message); if (e.InnerException != null) { writer.WriteLine(" - inner exception: \"{0}\"", e.InnerException.Message); } writer.WriteLine(" -- Stack: {0}", e.StackTrace); } } catch (Exception) { } } finally { try { bizService.Close(); } catch { bizService.Abort(); throw; } } return(false); }
protected UserManagerClient GetUserManager() { var um = new UserManagerClient(); if (um.ClientCredentials != null) { um.ClientCredentials.UserName.UserName = Connection.UserName; um.ClientCredentials.UserName.Password = Connection.Password; } um.Open(); return(um); }
//constructor public UserProfileEdit(string Email, string PassHash) { try { this.userManager = new UserManagerClient(); } catch (Exception exc) { MessageBox.Show("Errore nella connessione al server.", "Proprio non riesco.", MessageBoxButtons.OK); } this.Email = Email; this.PassHash = PassHash; InitializeComponent(); this.HydrateFields(); }
public void GetUserInfo() { var client = new UserManagerClient(); client.ClientCredentials.UserName.UserName = "******"; client.ClientCredentials.UserName.Password = "******"; client.TryConnect(); Console.WriteLine("TryConnect - Ok."); var userInfo = client.GetUserInfo(); Assert.IsNotNull(userInfo); Console.WriteLine("username: {0}, firstName: {1}", userInfo.UserName, userInfo.FirstName); }
public Form_SalaryResult() { InitializeComponent(); ShopID = GlobalParams.ShopID; if (ShopID < 0) { MessageBox.Show("您不属于任何店铺,请联系系统管理员分配您的店铺所属!", "错误!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); this.Close(); } SalaryLog_Client = (SalaryLogClient)ClientFactory.GetClient(ClientType.Type.SalaryLog); UserManager_Client = (UserManagerClient)ClientFactory.GetClient(ClientType.Type.UserManager); WorkRAP_Client = (WorkRAPClient)ClientFactory.GetClient(ClientType.Type.WorkRAP); List_Log = SalaryLog_Client.SelectAllSalaryLogs().Where(P => P.SalaryLog_Time.Month == DateTime.Now.Month && P.SalaryLog_Time.Year == DateTime.Now.Year).ToList(); }
public signinForm() { this.userManager = new UserManagerClient(); InitializeComponent(); MaterialSkinManager materialUIManager = MaterialSkinManager.Instance; materialUIManager.AddFormToManage(this); materialUIManager.Theme = MaterialSkinManager.Themes.LIGHT; materialUIManager.ColorScheme = new ColorScheme( Primary.Blue400, Primary.Blue500, Primary.Blue500, Accent.DeepOrange400, TextShade.WHITE ); }
//on Click function. this show a new child form which allow the admin to modify the user of the booking private void EditUser(object sender, EventArgs e) { try { UserManagerClient userManager = new UserManagerClient(); var selectedUser = bookingManager.GetBookingByID(Convert.ToInt32(bookingsListView.SelectedItems[0].Text), this.Email, this.PassHash).Booker; AdminUserEdit bookingFormChild = new AdminUserEdit(userManager.GetUserByEmail(selectedUser.Email, this.Email, this.PassHash), this.Email, this.PassHash); bookingFormChild.MdiParent = this.ParentForm; bookingFormChild.FormBorderStyle = FormBorderStyle.None; bookingFormChild.Dock = DockStyle.Fill; bookingFormChild.Show(); } catch (Exception exc) { MessageBox.Show("Errore nella connessione al server.", "Proprio non riesco a mostrare l'utente della prenotazione.", MessageBoxButtons.OK); } }
//ProvinceClient Province_Client; //CityClient City_Client; //ShopClient Shop_Client; //List<Car_Province> List_Province; //List<WFpart.CityService.Car_City> List_City; //List<WFpart.ShopService.Car_Shop> List_Shop; #endregion #region 构造方法 public Form_Money() { InitializeComponent(); ShopID = 0; CityID = 0; ProvinceID = 0; UserManager_Client = (UserManagerClient)ClientFactory.GetClient(ClientType.Type.UserManager); Account_Client = (AccountClient)ClientFactory.GetClient(ClientType.Type.Account); List_ShopInfo = UserManager_Client.GetAllShops(null, null, null).ToList(); List_Account = Account_Client.SelectAllAccounts().ToList(); //Province_Client = (ProvinceClient)ClientFactory.GetClient(ClientType.Type.Province); //City_Client = (CityClient)ClientFactory.GetClient(ClientType.Type.City); //Shop_Client = (ShopClient)ClientFactory.GetClient(ClientType.Type.Shop); Bind_Province(); Bind_Year(); }
public userHome(User.User loggedUser) { this.loggedUser = loggedUser; this.productManager = new ProductManagerClient(); this.orderManager = new OrderManagerClient(); this.userManager = new UserManagerClient(); InitializeComponent(); this.Text = "Ciao " + this.loggedUser.name; MaterialSkinManager materialUIManager = MaterialSkinManager.Instance; materialUIManager.AddFormToManage(this); materialUIManager.Theme = MaterialSkinManager.Themes.LIGHT; materialUIManager.ColorScheme = new ColorScheme( Primary.Blue400, Primary.Blue500, Primary.Blue500, Accent.Orange200, TextShade.WHITE ); productListView.Clear(); productListView.View = View.Details; productListView.Columns.Add("ID", 150, HorizontalAlignment.Left); productListView.Columns.Add("Nome", 250, HorizontalAlignment.Left); productListView.Columns.Add("Barcode", 200, HorizontalAlignment.Left); productListView.Columns.Add("prezzo", 150, HorizontalAlignment.Left); cartListView.View = View.Details; cartListView.Columns.Add("ID", 150, HorizontalAlignment.Left); cartListView.Columns.Add("Prodotto", 300, HorizontalAlignment.Left); cartListView.Columns.Add("prezzo", 200, HorizontalAlignment.Left); cartListView.Columns.Add("Quantita", 200, HorizontalAlignment.Left); ordersListView.View = View.Details; ordersListView.Columns.Add("ID", 150, HorizontalAlignment.Left); ordersListView.Columns.Add("Data Ordine", 300, HorizontalAlignment.Center); ordersListView.Columns.Add("Totale", 200, HorizontalAlignment.Left); this.loadProducts(); this.loadOrders(); this.loadProfile(); }
//overloaded constructor. in this case the admin add a user public AdminUserEdit(string Email, string PassHash) { InitializeComponent(); this.newUser = true; this.Email = Email; this.PassHash = PassHash; NameUsertextBox.Text = ""; EmailUserTextBox.Text = ""; EmailUserTextBox.ReadOnly = false; LicenseUserTextBox.Text = ""; PointsUpDown.Value = 0; AdminCheckbox.Checked = false; DeleteButton.Visible = false; try { this.userManager = new UserManagerClient(); } catch (Exception exc) { MessageBox.Show("Errore nella connessione al server.", "Proprio non riesco.", MessageBoxButtons.OK); } }
public WXMPClient( string appId, TicketClient ticketClient, BasisServiceClient basisServiceClient, CustomServiceClient customServiceClient, TemplateServiceClient templateServiceClient, MenuClient menuClient, UserManagerClient userManagerClient, AccountManagerClient accountManagerClient, MaterialClient materialClient, AccessTokenManager tokenManager) { AppId = appId; TicketClient = ticketClient; BasisServiceClient = basisServiceClient; CustomServiceClient = customServiceClient; TemplateServiceClient = templateServiceClient; MenuClient = menuClient; UserManagerClient = userManagerClient; AccountManagerClient = accountManagerClient; MaterialClient = materialClient; TokenManager = tokenManager; }
//constructor public AdminUserList(string Email, string PassHash) { this.Email = Email; this.PassHash = PassHash; InitializeComponent(); usersListView.Clear(); usersListView.View = View.Details; usersListView.Columns.Add("Email", 230, HorizontalAlignment.Left); usersListView.Columns.Add("Nome", 200, HorizontalAlignment.Left); usersListView.Columns.Add("Scadenza", 150, HorizontalAlignment.Left); usersListView.Columns.Add("Punti", 50, HorizontalAlignment.Left); usersListView.Columns.Add("Admin", 50, HorizontalAlignment.Left); try { this.userManager = new UserManagerClient();//initilize connection this.UpdateUsers(); } catch (Exception exc) { MessageBox.Show("Errore nella connessione al server.", "Proprio non riesco.", MessageBoxButtons.OK); } }
private void loginSubmit(object sender, EventArgs e) { try { // get data from inputs UserManagerClient userManager = new UserManagerClient(); //initialize string mail = email.Text; string passwordMD5 = GenerateMd5Hash(password.Text); //call user manager fuction to login if (userManager.Login(mail, passwordMD5)) { User.User loggedUser = userManager.getUserByEmail(mail); this.Hide();//i am logged in so i don't need the login form if (!loggedUser.isAdmin) { userHome userPanel = new userHome(loggedUser); //initialize a new user form userPanel.Show(); } else { adminPanel adminPanel = new adminPanel(loggedUser); //initialize a new admin form adminPanel.Show(); //send to the new form } } else { MessageBox.Show("Credenziali", "Utente/Password errati.", MessageBoxButtons.OK);//Error Message } } catch (Exception exc) { MessageBox.Show("Errore", "Errore nella connessione al server.", MessageBoxButtons.OK); } }
//constructor public AdminUserEdit(User.User user, string Email, string PassHash) { InitializeComponent(); this.newUser = false; this.editingUser = user; this.Email = Email; this.PassHash = PassHash; NameUsertextBox.Text = user.Name; EmailUserTextBox.Text = user.Email; EmailUserTextBox.ReadOnly = true; LicenseUserTextBox.Text = user.License; expirationPicker.Value = user.LicenseExpiration; PointsUpDown.Value = user.LicensePoints; AdminCheckbox.Checked = user.isAdmin; try { this.userManager = new UserManagerClient(); } catch (Exception exc) { MessageBox.Show("Errore nella connessione al server.", "Proprio non riesco.", MessageBoxButtons.OK); } }
// on click function. Check if the access refericies are good and then give the access at the program. Otherwise show an error message private void loginNow(object sender, EventArgs e) { try { //take the data of the textBox UserManagerClient userManager = new UserManagerClient(); //initialize string UserMail = EmailBoxLogin.Text; string PassHash = EasyEncryption.MD5.ComputeMD5Hash(PasswordBoxLogin.Text); //encode the password //apply the funcition control on the referencies if (userManager.LoginChecker(UserMail, PassHash)) { loggingIn = true; //set the user logged this.Hide(); //hide the control to the user //verify if the user is an admin or not if (userManager.IsAdmin(UserMail, PassHash)) { AdminDashboard main = new AdminDashboard(UserMail, PassHash); //initialize a new admin form main.Show(); //send to the new form } else { UserDashboard main = new UserDashboard(UserMail, PassHash); //initialize a new user form main.Show(); } this.Close();// End of the control Hiding } else { MessageBox.Show("Utente/Password errati.", "Non è così che si fa.", MessageBoxButtons.OK);//Error Message } }catch (Exception exc) { MessageBox.Show("Errore nella connessione al server.", "Proprio non riesco.", MessageBoxButtons.OK); } }
/// <summary> /// 登陆按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BT_Login_Click(object sender, EventArgs e) { UserSummery_Client = new UserSummeryClient(); UNPCC_UserSummery = UserSummery_Client.ClientCredentials.UserName; UNPCC_UserSummery.UserName = TB_UserName.Text; UNPCC_UserSummery.Password = TB_Password.Text; try { GlobalParams.UserID = Guid.Parse(UserSummery_Client.UserLogOn(TB_UserName.Text, TB_Password.Text)); GlobalParams.UserName = TB_UserName.Text; GlobalParams.Password = TB_Password.Text; } catch (Exception) { MessageBox.Show("账号或密码错误,请检查拼写"); return; } UserManager_Client = new UserManagerClient(); UNPCC_UserManager = UserManager_Client.ClientCredentials.UserName; UNPCC_UserManager.UserName = GlobalParams.UserName; UNPCC_UserManager.Password = GlobalParams.Password; ClientFactory.AddClient <UserManagerClient>(ClientType.Type.UserManager, UserManager_Client); List <String> List_Role = UserManager_Client.RoleSelect_UserName(GlobalParams.UserName).ToList(); GlobalParams.ShopID = UserManager_Client.SelectShopID_UserID(GlobalParams.UserID); if (List_Role.Count != 0) { bool mark = false; foreach (String rolename in List_Role) { if (rolename == "普通员工" || rolename == "管理员" || rolename == "超级管理员") { mark = true; continue; } } if (mark) { Form_LoginRole form = new Form_LoginRole(List_Role); form.Owner = this; form.OnSave += new Form_LoginRole.Save(Show_Work); form.ShowDialog(); } else { MessageBox.Show("您的账号不适用于操作本系统!!!", "错误!", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); this.Close(); } } else { Show_Work(List_Role.First()); } //UserSummery_Client.UserReg( //new User_ViewModel() //{ UserName = "******", // UserPassword="******", // Question="what's my name?", // Answer="dutianhang", // Email="*****@*****.**" //}, //new aspnet_UsersEX() //{User_RealName="杜天行", // User_Validation="51390119900410021x", // User_Phone="13882821913", // User_Adress="no have" }); }
public adminPanel(User.User loggedUser) { this.loggedUser = loggedUser; //manager refs this.productManager = new ProductManagerClient(); this.orderManager = new OrderManagerClient(); this.userManager = new UserManagerClient(); this.BrandManager = new BrandManagerClient(); this.CategoryManager = new CategoryManagerClient(); InitializeComponent(); //materialskin stuff MaterialSkinManager materialUIManager = MaterialSkinManager.Instance; materialUIManager.AddFormToManage(this); materialUIManager.Theme = MaterialSkinManager.Themes.LIGHT; materialUIManager.ColorScheme = new ColorScheme( Primary.Blue400, Primary.Blue500, Primary.Blue500, Accent.Orange200, TextShade.WHITE ); //product list productListView.Clear(); productListView.View = View.Details; productListView.Columns.Add("ID", 150, HorizontalAlignment.Left); productListView.Columns.Add("Nome", 250, HorizontalAlignment.Left); productListView.Columns.Add("Barcode", 200, HorizontalAlignment.Left); productListView.Columns.Add("prezzo", 150, HorizontalAlignment.Left); productListView.Columns.Add("quantita", 150, HorizontalAlignment.Left); //order list ordersListView.View = View.Details; ordersListView.Columns.Add("ID", 150, HorizontalAlignment.Left); ordersListView.Columns.Add("Cliente", 150, HorizontalAlignment.Left); ordersListView.Columns.Add("Data Ordine", 300, HorizontalAlignment.Center); ordersListView.Columns.Add("Totale", 200, HorizontalAlignment.Left); //customer list customerListView.View = View.Details; customerListView.Columns.Add("ID", 150, HorizontalAlignment.Left); customerListView.Columns.Add("Cognome", 150, HorizontalAlignment.Left); customerListView.Columns.Add("Nome", 300, HorizontalAlignment.Center); customerListView.Columns.Add("Data Nascita", 200, HorizontalAlignment.Left); customerListView.Columns.Add("Codice Fiscale", 200, HorizontalAlignment.Left); customerListView.Columns.Add("Ruolo", 200, HorizontalAlignment.Left); brandListView.View = View.Details; brandListView.Columns.Add("ID", 150, HorizontalAlignment.Left); brandListView.Columns.Add("Nome", 300, HorizontalAlignment.Center); categoryListView.View = View.Details; categoryListView.Columns.Add("ID", 150, HorizontalAlignment.Left); categoryListView.Columns.Add("Nome", 300, HorizontalAlignment.Center); this.loadProducts(); this.loadOrders(); this.loadCustomers(); this.loadBrands(); this.loadCategories(); }
/// <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); }