public AccountPenaltyRemissionAddChangeForm(AccountPenaltyRemission accountPenaltyRemission) : this() { this.m_accountPenaltyRemission = accountPenaltyRemission; if (accountPenaltyRemission.FromDate != System.DateTime.MinValue) { this.datePeriod.DateBegin = accountPenaltyRemission.FromDate; } if (accountPenaltyRemission.ToDate != System.DateTime.MinValue) { this.datePeriod.DateEnd = accountPenaltyRemission.ToDate; } }
private void tsbAddPenaltyRemission_Click(object sender, System.EventArgs e) { if (this.m_Account != null) { AccountPenaltyRemission accountPenaltyRemission = new AccountPenaltyRemission { AccountId = this.m_Account.Id }; AccountPenaltyRemissionAddChangeForm form = new AccountPenaltyRemissionAddChangeForm(accountPenaltyRemission); form.set_Text("Добавление периода"); form.SetButtonText("Добавить"); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.bsPenaltyRemission.set_DataSource(AccountPenaltyRemission.FindByAccountId(this.m_Account.Id)); this.bsPenaltyRemission.set_Sort(this.bsPenaltyRemission.get_Sort()); } } }