public DebtListNoticesForm(DebtDocument debtDocument, ObjectList<Account> selectedAccounts) { this.InitializeComponent(); this.set_Font(Manager.WindowFont); this.m_debtDocument = debtDocument; this.m_SelectedAccounts = selectedAccounts; }
public DebtDocumentEditForm(DebtDocument debtDocument) { this.InitializeComponent(); this.set_Font(Manager.WindowFont); this.debtDoc = debtDocument; this.Fill(); }
public DebtAccountPrintForm(DebtDocument debtDocument, PrintEnum printEnum, ObjectList<Account> selectedAccounts) : this() { this.m_debtDocument = debtDocument; this.m_printEnumType = printEnum; this.m_SelectedAccounts = selectedAccounts; }
public DebtAccountPrintForm() { this.m_debtDocument = DebtDocument.Null; this.m_SelectedAccounts = new ObjectList<Account>(); this.InitializeComponent(); this.set_Font(Manager.WindowFont); }
private void tsbtnSaveDebtAccounts_Click(object sender, System.EventArgs e) { Organization organization = this.selectOrganizationForDocument.SelectedOrganization ?? Organization.Null; OrgDocument document = this.selectOrgDocument1.SelectedOrgDocument ?? OrgDocument.Null; if (this.dbxSaveDate.IsNull) { Messages.ShowWarning("Введите дату для сохранения списка должников"); } else { bool flag = true; foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvDebtors.Rows) { if ((row.Cells.get_Item("selected").get_Value() != null) && ((bool) row.Cells.get_Item("selected").get_Value())) { flag = false; break; } } if (flag) { Messages.ShowWarning("Выберите лицевые счета"); } else { DebtDocument document2; document2 = new DebtDocument { OrgDocId = document.Id, FromDate = this.dbxSaveDate.Value, HouseHolderId = organization.Id, Created = System.DateTime.Now, PaymentToDate = this.cbPaymentPeriod.get_Checked() ? this.PeriodPayment : document2.Created }; document2.SaveChanges(); ObjectList<DebtAccount> debtAccounts = new ObjectList<DebtAccount>(); this.dgvDebtors.EndEdit(); ObjectList<DebtAccountService> debtAccountServices = new ObjectList<DebtAccountService>(); this.dgvAccountServices.EndEdit(); foreach (System.Windows.Forms.DataGridViewRow row2 in (System.Collections.IEnumerable) this.dgvDebtors.Rows) { if ((row2.Cells.get_Item("selected").get_Value() != null) && ((bool) row2.Cells.get_Item("selected").get_Value())) { DebtAccount account = new DebtAccount { AccountId = (long) ((long) row2.Cells.get_Item("accountId").get_Value()), DebtSumm = (decimal) row2.Cells.get_Item("debt").get_Value(), MonthCount = (int) ((int) row2.Cells.get_Item("monthCount").get_Value()) }; debtAccounts.Add(account); Account account2 = Account.FindById((long) ((long) row2.Cells.get_Item("accountId").get_Value())); foreach (System.Data.DataRow row3 in Mappers.DebtorMapper.FindByAccount(this.Providers, this.Holders, this.ServiceTypes, this.Services, account2, this.Period, false, (long) this.selectFasetApartmentType.Id, this.PeriodPayment, this.m_cityBoroughs, this.AccountHolders).Tables.get_Item(0).Rows) { DebtAccountService service = new DebtAccountService { AccountServiceId = System.Convert.ToInt64(row3.get_Item("accountServiceId").ToString()), DebtSumm = System.Convert.ToDecimal(row3.get_Item("debt").ToString()), MonthCount = System.Convert.ToInt16(row3.get_Item("monthCount").ToString()), AccountId = account2.Id }; debtAccountServices.Add(service); } } } DebtAccount.SaveDebtAccounts(document2, debtAccounts, debtAccountServices); if (Messages.QuestionYesNo(this, "Список сохранен, сделать групповое заведение исков по сохраненным в список должникам?") != System.Windows.Forms.DialogResult.Yes) { document2.SaveDebtActions(false); } else { document2.SaveDebtActions(true); Messages.ShowMessage("Иски по данному документу заведены"); } } } }
private void bsDebtDocuments_CurrentChanged(object sender, System.EventArgs e) { if (!this.bsDebtDocuments.get_IsBindingSuspended()) { this.m_DebtDocument = (this.bsDebtDocuments.get_Current() as DebtDocument) ?? DebtDocument.Null; this.bsDebtAccounts.SuspendBinding(); this.bsDebtAccounts.set_DataSource(this.m_DebtDocument.GetDebtAccountsByUser()); this.bsDebtAccounts.ResumeBinding(); if (this.m_DebtDocument.ShowInterface) { string str; this.tsbChangeShow.set_Image(Resources.EXPORT); this.tsbChangeShow.set_Text((string) (str = "Скрыть документ")); this.tsbChangeShow.set_ToolTipText(str); } else { string str2; this.tsbChangeShow.set_Image(Resources.IMPORT); this.tsbChangeShow.set_Text((string) (str2 = "Отображать документ всегда")); this.tsbChangeShow.set_ToolTipText(str2); } this.tsbtnAllAccount.PerformClick(); } }
public static void SaveDebtAccounts(DebtDocument debtDocument, ObjectList<DebtAccount> debtAccounts, ObjectList<DebtAccountService> debtAccountServices) { Mappers.DebtAccountMapper.SaveDebtAccounts(debtDocument.Id, debtAccounts, debtAccountServices); }