public DomainBillPosition(uint id, DomainItem item, uint count = 1) { this.id = id; this.item = item; Count = count; }
private bool Contains(DomainItem item) { return(FindById(item.Id) != null); }
public void Remove(DomainItem item, uint count = 1) { bill.UpdatePosition(item, count); }
public DomainItemModel(DomainItem item) { Key = item.Key; Value = item.Value; }
/// <summary> /// Event handler for Reset button click event /// </summary> private void btnReset_Click(object sender, System.EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; DomainItem domainItem = (DomainItem)this.DomainComboBox.SelectedItem; this.domainID = domainItem.ID; System.Resources.ResourceManager resManager = new System.Resources.ResourceManager(typeof(Connecting)); string publicKey = null; string ragent = null; //Check whether the current/old passphrase is valid before reseting the passphrase Status status = null; try { status = simws.ValidatePassPhrase(this.domainID, this.passPhrase.Text); } catch (Exception ex) { System.Resources.ResourceManager resMgr = new System.Resources.ResourceManager(typeof(VerifyPassphraseDialog)); MessageBox.Show(resMgr.GetString("ValidatePPError") /*"Unable to validate the Passphrase. {0}"*/, ex.Message); } if (status.statusCode == StatusCodes.PassPhraseInvalid) { Cursor.Current = Cursors.Default; MessageBox.Show(Resource.GetString("InvalidCurrentPPText") /*"Error resetting passphrase"*/, Resource.GetString("ResetTitle") /*"reset error"*/); this.success = false; return; } if (status.statusCode == StatusCodes.ServerUnAvailable) { Cursor.Current = Cursors.Default; MessageBox.Show(Resource.GetString("NoLoggedInDomainsText") /*"Error resetting passphrase"*/, Resource.GetString("ResetTitle") /*"reset error"*/); this.success = false; return; } if (this.recoveryAgentCombo.SelectedItem != null && (string)this.recoveryAgentCombo.SelectedItem != TrayApp.Properties.Resources.serverDefaultRA) { // Show the certificate..... byte[] CertificateObj = this.simws.GetRACertificateOnClient(this.DomainID, (string)this.recoveryAgentCombo.SelectedItem); System.Security.Cryptography.X509Certificates.X509Certificate cert = new System.Security.Cryptography.X509Certificates.X509Certificate(CertificateObj); MyMessageBox mmb = new MyMessageBox(string.Format(resManager.GetString("verifyCert"), (string)this.recoveryAgentCombo.SelectedItem), resManager.GetString("verifyCertTitle"), cert.ToString(true), MyMessageBoxButtons.YesNo, MyMessageBoxIcon.Question, MyMessageBoxDefaultButton.Button2); DialogResult messageDialogResult = mmb.ShowDialog(); mmb.Dispose(); mmb.Close(); if (messageDialogResult != DialogResult.Yes) { return; } else { ragent = (string)this.recoveryAgentCombo.SelectedItem; publicKey = Convert.ToBase64String(cert.GetPublicKey()); } } /*else // If recovery agent is not selected... * { * MyMessageBox mmb = new MyMessageBox( resManager.GetString("NoCertWarning"), resManager.GetString("NoCertTitle"), "", MyMessageBoxButtons.YesNo, MyMessageBoxIcon.Question, MyMessageBoxDefaultButton.Button2); * DialogResult messageDialogResult = mmb.ShowDialog(); * mmb.Dispose(); * mmb.Close(); * if( messageDialogResult != DialogResult.Yes ) * return; * }*/ else { ragent = "DEFAULT"; //DomainInformation domainInfo = new DomainInformation(this.domainID); DomainInformation domainInfo = (DomainInformation)this.simws.GetDomainInformation(this.DomainID); string memberUID = domainInfo.MemberUserID; publicKey = this.ifws.GetDefaultServerPublicKey(this.DomainID, memberUID); } status = this.simws.ReSetPassPhrase(this.DomainID, this.passPhrase.Text, this.newPassphrase.Text, ragent, publicKey); if (status.statusCode == StatusCodes.Success) { //clear the values simws.StorePassPhrase(this.DomainID, "", CredentialType.None, false); //set the values simws.StorePassPhrase(this.DomainID, this.newPassphrase.Text, CredentialType.Basic, this.rememberPassphrase.Checked); MyMessageBox mb = new MyMessageBox(string.Format(Resource.GetString("ResetSuccess")), Resource.GetString("ResetTitle"), "", MyMessageBoxButtons.OK, MyMessageBoxIcon.Information); mb.ShowDialog(); mb.Dispose(); this.success = true; this.Dispose(); this.Close(); } else { MessageBox.Show(Resource.GetString("ResetError") /*"Error resetting passphrase"*/, Resource.GetString("ResetTitle") /*"reset error"*/); this.success = false; } } catch (Exception ex) { MessageBox.Show(Resource.GetString("ResetError") /*"Error resetting passphrase"*/, Resource.GetString(ex.Message) /*"reset error"*/); this.success = false; } Cursor.Current = Cursors.Default; }
public IActionResult PutTest(int id, DomainItem item) { var data = OperationResponse.CreateSucceed($"Item: {id}, new PropA: {item.PropA}"); return(Ok(data)); }