private void ShowPreviewReport() { BindingList <PriceMethod> lst = gvPrice.DataSource as BindingList <PriceMethod>; DataTable dtMethodsPrice = new ModPrice().getDTPriceMethod(lst.ToList()); if (dtMethodsPrice == null) { dtMethodsPrice = new ModPrice().getDTPriceMethod(null); } if (dtMethodsPrice != null) { dtParams.Rows[0]["Cod_cotizacion"] = tbCodPrice.Text; dtParams.Rows[0]["Empresa"] = cbCompany.Text; dtParams.Rows[0]["Atencion"] = GetAttention(); dtParams.Rows[0]["Saludo"] = richTextIni.RichTextBox.Rtf; dtParams.Rows[0]["Despedida"] = richTextEnd.RichTextBox.Rtf; dtParams.Rows[0]["Total_sin_igv"] = tbSubTotalAmount.Text; dtParams.Rows[0]["Igv"] = tbTotalIgv.Text; dtParams.Rows[0]["Total"] = tbTotalAmount.Text; freport.ReportName = "ReportPrice.frx"; freport.RegisterDataTable(dtParams, "Parametros"); freport.RegisterDataTable(dtMethodsPrice, "MethodsPrice"); freport.ShowReport(previewControl1); } }
private void OpenDesignReport() { DataTable dtMethodsPrice = new ModPrice().getDTPriceMethod(gvPrice.DataSource as List <PriceMethod>); if (dtMethodsPrice == null) { dtMethodsPrice = new ModPrice().getDTPriceMethod(null); } if (dtMethodsPrice != null) { dtParams.Rows[0]["Cod_cotizacion"] = tbCodPrice.Text; dtParams.Rows[0]["Empresa"] = cbCompany.Text; dtParams.Rows[0]["Atencion"] = GetAttention(); dtParams.Rows[0]["Total_sin_igv"] = tbSubTotalAmount.Text; dtParams.Rows[0]["Igv"] = tbTotalIgv.Text; dtParams.Rows[0]["Total"] = tbTotalAmount.Text; freport.ReportName = "ReportPrice.frx"; freport.RegisterDataTable(dtParams, "Parametros"); freport.RegisterDataTable(dtMethodsPrice, "MethodsPrice"); freport.DesignReport(); } }
void RetrieveDataCompany() { // --- recuperate the clients if (cbCompany.EditValue != null) { if (cbCompany.EditValue.ToString().Trim() != "" && cbCompany.EditValue.ToString().Trim() != "0") { CCompany oCompany = new CCompany(); CCompanyFactory faCompany = new CCompanyFactory(); oCompany = faCompany.GetByPrimaryKey(new CCompanyKeys(Convert.ToInt16(cbCompany.EditValue))); tbClientDomicile.Text = oCompany.Domicile; tbClientPhone.Text = oCompany.Phone_client; tbClientRuc.Text = oCompany.Ruc; // --- get/show contacts Reception oReception = new BusinessLayer.Modules.Reception(); ModPrice oModPrice = new ModPrice(); gcContact.DataSource = new BindingList <CContact_price>(oModPrice.GetLstContactsByCompany(oCompany.Idcompany)); } } }
void InitDataControls() { deDateCreation.DateTime = Comun.GetDate(); tbNumDaysValid.Value = new CSettings().GetNumDaysPriceDefault(); // --- init company cbCompany.Properties.DataSource = new CCompanyFactory().GetAll(); cbCompany.Properties.DisplayMember = "Business_name"; cbCompany.Properties.ValueMember = "Idcompany"; // --- init type sample combo CType_sampleFactory faType_Sample = new CType_sampleFactory(); cbTypeSample.Properties.DataSource = faType_Sample.GetAll(); cbTypeSample.Properties.ValueMember = "Cod_type_sample"; cbTypeSample.Properties.DisplayMember = "Name_type_sample"; Reception oReception = new Reception(); // --- init type person repPerson_type.DataSource = oReception.GetLstPersonType(); repPerson_type.DisplayMember = "Name"; repPerson_type.ValueMember = "Id"; // --- init methods gcPrice.DataSource = new BindingList <PriceMethod>(new ModPrice().GetPriceMethod(null)); // --- init plantillas CMemo_templateFactory faMemo_template = new CMemo_templateFactory(); gcParagraphHistoryIni.DataSource = faMemo_template.GetAll().Where(c => c.Memo_type == 1).ToList(); gcParagraphHistoryEnd.DataSource = faMemo_template.GetAll().Where(c => c.Memo_type == 2).ToList(); // --- init adjuntos List <Anexos> list = new ModPrice().GetLstAnexos(null); gcAnexos.DataSource = new BindingList <Anexos>(list); }
protected override void Recuperar_Registro() { if (oPrice != null && oPrice_version != null) { tabHead.Text = oPrice.Cod_price; tbCodPrice.Text = oPrice.Cod_price; tbNumVersion.Text = oPrice_version.Num_version.ToString(); cbTypeSample.EditValue = oPrice_version.Cod_type_sample; cbCompany.EditValue = oPrice_version.Idcompany; deDateCreation.EditValue = oPrice_version.Date_creation; tbNumDaysValid.Value = Convert.ToInt32(oPrice_version.Num_days_valid); tbObservation.Text = oPrice_version.Observation; // --- person if (oPrice.Dispatch_person > 0) { ckDispatchPerson.Checked = true; } else { ckDispatchPerson.Checked = false; } // --- curier if (oPrice.Dispatch_curier > 0) { ckDispatchCurier.Checked = true; } else { ckDispatchCurier.Checked = false; } // --- transport if (oPrice.Dispatch_transport > 0) { ckDispatchTransport.Checked = true; } else { ckDispatchTransport.Checked = false; } // --- fax if (oPrice.Dispatch_fax > 0) { ckDispatchFax.Checked = true; } else { ckDispatchFax.Checked = false; } // --- get contacts gcContact.DataSource = new BindingList <CContact_price>(new ModPrice().GetLstContactsByPrice(oPrice.Idprice, oPrice_version.Idprice_version)); // --- recuperando métodos List <PriceMethod> myLstPriceMethod = new ModPrice().GetPriceMethod(oPrice_version); gcPrice.DataSource = new BindingList <PriceMethod>(myLstPriceMethod); // --- recuperando parrafos var lstmemo = (from m in new CMemo_priceFactory().GetAll() where m.Idprice_version == oPrice_version.Idprice_version select new { m.Paragraph, m.Memo_type }).ToList(); foreach (var item in lstmemo) { if (item.Memo_type == 1) { richTextIni.RichTextBox.Rtf = item.Paragraph; } else if (item.Memo_type == 2) { richTextEnd.RichTextBox.Rtf = item.Paragraph; } } // --- recuperar memo template var lsttemplate_memo = new CMemo_templateFactory().GetAll(); gcParagraphHistoryIni.DataSource = lsttemplate_memo.Where(c => c.Memo_type == 1).ToList(); gcParagraphHistoryEnd.DataSource = lsttemplate_memo.Where(c => c.Memo_type == 2).ToList(); // --- recalcular tamaño de celdas de texto amplio gvPrice.OptionsView.RowAutoHeight = true; gvPrice.LayoutChanged(); gvParagraphHistoryIni.OptionsView.RowAutoHeight = true; gvParagraphHistoryIni.LayoutChanged(); gvParagraphHistoryEnd.OptionsView.RowAutoHeight = true; gvParagraphHistoryEnd.LayoutChanged(); // --- recuperar suma totales SumTotals(); // --- recuperar reporte de cotización ShowPreviewReport(); // --- recuperar archivos adjuntos gcAnexos.DataSource = new BindingList <Anexos>(new ModPrice().GetLstAnexos(oPrice_version)); } else { ckDispatchPerson.Checked = false; ckDispatchCurier.Checked = true; ckDispatchTransport.Checked = false; ckDispatchFax.Checked = false; } }