public AddChangePaymentSystemAgentsForm(PayPaymentSystemAgent paymentSystemAgent) { this.m_PaymentSystemAgent = PayPaymentSystemAgent.Null; this.m_Organization = Organization.Null; this.InitializeComponent(); this.m_PaymentSystemAgent = paymentSystemAgent ?? PayPaymentSystemAgent.Null; this.btnPerform.set_Text("Изменить"); this.set_Text("Редактирование платёжного агента"); }
public AddChangePaymentSystemAgentsForm(Organization organization) { this.m_PaymentSystemAgent = PayPaymentSystemAgent.Null; this.m_Organization = Organization.Null; this.InitializeComponent(); this.m_Organization = organization; this.btnPerform.set_Text("Добавить"); this.set_Text("Добавление платёжного агента"); }
private void btnRemove_Click(object sender, System.EventArgs e) { if (this.selectOrganization.SelectedOrganization == Organization.Null) { Messages.ShowMessage("Выберите организация"); } else { this.selectedPaymentSystemAgent = this.bsPaymentSystemAgentsView.get_Current() as PayPaymentSystemAgent; if ((this.selectedPaymentSystemAgent != null) && (Messages.QuestionYesNo(this, "Вы уверены, что хотите удалить этот элемент?") == System.Windows.Forms.DialogResult.Yes)) { this.selectedPaymentSystemAgent.Delete(); this.ReloadPaymentSystemAgents(); } } }
private void btnPerform_Click(object sender, System.EventArgs e) { if (this.m_OrgBS.get_Current() == null) { Messages.ShowWarning("Выберите организацию"); } else if (this.m_PaymentSystemBS.get_Current() == null) { Messages.ShowWarning("Выберите платёжную систему"); } else if (string.IsNullOrEmpty(this.tbExternalNumber.get_Text().Trim())) { Messages.ShowWarning("Поле \"Внешний номер\" необходимо заполнить"); } else if (this.m_CashFlowType.SelectedFasetItem == FasetItem.Null) { Messages.ShowWarning("Выберите денежный поток, в котором будут загружаться платежи от этого агента"); } else { try { if (this.m_PaymentSystemAgent == PayPaymentSystemAgent.Null) { this.m_PaymentSystemAgent = new PayPaymentSystemAgent(); } this.m_PaymentSystemAgent.OrganizationId = ((Organization) this.m_OrgBS.get_Current()).Id; this.m_PaymentSystemAgent.PaymentSystemId = ((PayPaymentSystem) this.m_PaymentSystemBS.get_Current()).Id; this.m_PaymentSystemAgent.ExternalNumber = this.tbExternalNumber.get_Text().Trim(); this.m_PaymentSystemAgent.CashFlowTypeId = this.m_CashFlowType.SelectedFasetItem.Id; this.m_PaymentSystemAgent.PercentRateCommission = this.nudPercentCommission.Value; this.m_PaymentSystemAgent.RoubleRateCommission = this.nudRoubleCommission.Value; this.m_PaymentSystemAgent.SaveChanges(); base.set_DialogResult(System.Windows.Forms.DialogResult.OK); } catch (System.Exception exception) { Messages.ShowException(this, "При сохранении платёжного агента произошла ошибка." + System.Environment.get_NewLine() + "Проверьте, не ввели ли вы уже существующий внешний номер повторно.", exception); } } }
private void btnChange_Click(object sender, System.EventArgs e) { if (this.selectOrganization.SelectedOrganization == Organization.Null) { Messages.ShowMessage("Выберите организация"); } else { this.selectedPaymentSystemAgent = this.bsPaymentSystemAgentsView.get_Current() as PayPaymentSystemAgent; if (this.selectedPaymentSystemAgent != null) { AddChangePaymentSystemAgentsForm form = new AddChangePaymentSystemAgentsForm(this.selectedPaymentSystemAgent); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.ReloadPaymentSystemAgents(); } } } }