private void gridExLicensors_CellEdited(object sender, ColumnActionEventArgs e) { if (gridExLicensors.CurrentColumn != null && gridExLicensors.CurrentColumn.Key == "LicencjodawcaId") { gridExLicensors.UpdateData(); if (int.TryParse(gridExLicensors.CurrentRow.Cells["LicencjodawcaId"].Value.ToString(), out int selectedId)) { selectedId = (int)gridExLicensors.CurrentRow.Cells["LicencjodawcaId"].Value; Licensor selectedLicensor = LicensorsRepo.GetById(selectedId); gridExLicensors.CurrentRow.Cells["AdresEmail"].Text = selectedLicensor.Email; gridExLicensors.CurrentRow.Cells["OsobaFizyczna"].Value = selectedLicensor.IsNaturalPerson; gridExLicensors.CurrentRow.Cells["PodatekProcent"].Value = selectedLicensor.TaxPercentage; } else { gridExLicensors.CurrentRow.Cells["AdresEmail"].Text = ""; gridExLicensors.CurrentRow.Cells["OsobaFizyczna"].Value = false; gridExLicensors.CurrentRow.Cells["PodatekProcent"].Value = 0; } } this.SetAgreementChangesPending(true); }
private void gridExLicensors_CellValueChanged(object sender, ColumnActionEventArgs e) { if (e.Column.DataMember == "LicencjodawcaId") { gridExLicensors.UpdateData(); if (gridExLicensors.CurrentRow.Cells["LicencjodawcaId"].Value != null) { int selectedId = (int)gridExLicensors.CurrentRow.Cells["LicencjodawcaId"].Value; Licensor selectedLicensor = LicensorsRepo.GetById(selectedId); gridExLicensors.CurrentRow.Cells["AdresEmail"].Text = selectedLicensor.Email; gridExLicensors.CurrentRow.Cells["OsobaFizyczna"].Value = selectedLicensor.IsNaturalPerson; gridExLicensors.CurrentRow.Cells["PodatekProcent"].Value = selectedLicensor.TaxPercentage; } else { gridExLicensors.CurrentRow.Cells["AdresEmail"].Text = ""; gridExLicensors.CurrentRow.Cells["OsobaFizyczna"].Value = null; gridExLicensors.CurrentRow.Cells["PodatekProcent"].Value = 0; } } this.SetAgreementChangesPending(true); }
private void UpdateDispatchInfo() { Settlement settlement = SettlementsRepo.GetById((int)gridExSettlementsList.GetCheckedRows()[0].Cells["id"].Value); Licensor licensor = LicensorsRepo.GetById((int)gridExSettlementsDetails.GetDataRows()[0].Cells["tLicencjodawcaCafreOfId"].Value); settlement.Email = licensor.Email; settlement.DispatchDate = DateTime.Now; SettlementsRepo.Update(settlement); }
private void PrepareDraftMail(bool reportHasSumRow) { Licensor licensor = LicensorsRepo.GetById((int)gridExSettlementsDetails.GetDataRows()[1].Cells["tLicencjodawcaCafreOfId"].Value); string timeStamp = DateTime.Now.ToString("yyyyMMddHHmmss"); string detailsReportPath = string.Format("{0}{1}_RaportZbiorczy.xls", ConfigurationSettings.AppSettings["mail_attachmentDirectory"], timeStamp); string shortReportPath = string.Format("{0}{1}_RaportSkrocony.pdf", ConfigurationSettings.AppSettings["mail_attachmentDirectory"], timeStamp); List <string> attachments = new List <string>(); attachments.Add(detailsReportPath); attachments.Add(shortReportPath); ExcelHelper.CreateReport_SettlementsDetails(gridExSettlementsDetails, detailsReportPath, reportHasSumRow); ExcelHelper.CreateReport_Short(gridExSettlementsDetails, shortReportPath); OutlookHelper.SaveDraft(attachments, licensor.Email); MessageBox.Show("Szkic maila zostal przygotowany wraz załącznikami.", "Eksport do email", MessageBoxButtons.OK, MessageBoxIcon.Information); }