private void DoEditUser() { if (!validationEmptyErrorMessage() || !validateEmailAndPassword()) { return; } if (seller) { UserSellerWSClient ws = new UserSellerWSClient(); user.userData.companyId = ((CompanyComboboxItem)user_company.SelectedItem).Id; createUserData(user.userData.userData, user_document_type.SelectedItem); ws.editSeller(new SellerWS.Security { BinarySecurityToken = authToken }, new editSeller { arg1 = user }); } else { UserAdminWSClient ws = new UserAdminWSClient(); createUserData(user.userData, user_document_type.SelectedItem); ws.editAdmin(new AdminWS.Security { BinarySecurityToken = authToken }, new editAdmin { arg1 = user }); } parentForm.FilterUsersTable(); this.Close(); }
private void EditUser(dynamic sender, EventArgs e) { long id = sender.Tag.id; UserWS.UserRole role = sender.Tag.role; dynamic user = null; if (role == UserWS.UserRole.SELLER) { UserSellerWSClient ws = new UserSellerWSClient(); findSellerResponse res = ws.findSeller(new SellerWS.Security { BinarySecurityToken = authToken }, new findSeller { arg1 = id, arg1Specified = true }); user = res.@return; } else { UserAdminWSClient ws = new UserAdminWSClient(); findAdminResponse res = ws.findAdmin(new AdminWS.Security { BinarySecurityToken = authToken }, new findAdmin { arg1 = id, arg1Specified = true }); user = res.@return; } UserForm form = new UserForm(role == UserWS.UserRole.SELLER, authToken, this, user); form.Show(); }
private void DoSaveUser() { if (!validationEmptyErrorMessage() || !validateEmailAndPassword()) { return; } if (seller) { SellerWS.userData ud = new SellerWS.userData(); createUserData(ud, user_document_type.SelectedItem); UserSellerWSClient ws = new UserSellerWSClient(); ws.createSeller(new SellerWS.Security { BinarySecurityToken = authToken }, new createSeller { arg1 = new userSellerData { companyId = ((CompanyComboboxItem)user_company.SelectedItem).Id, companyIdSpecified = true, userData = ud } }); } else { UserAdminWSClient ws = new UserAdminWSClient(); AdminWS.userData ud = new AdminWS.userData(); createUserData(ud, user_document_type.SelectedItem); ws.createAdmin(new AdminWS.Security { BinarySecurityToken = authToken }, new createAdmin { arg1 = ud }); } parentForm.FilterUsersTable(); this.Close(); }