public rp_personel_iptal_ozet(DateTime tarih1, DateTime tarih2) { InitializeComponent(); lbl_tarih.Text = tarih1.Day + "." + tarih1.Month + "." + tarih1.Year + "-" + tarih2.Day + "." + tarih2.Month + "." + tarih2.Year; DataTable dt = SQL.get("SELECT * FROM(SELECT ad_soyad = k.ad + ' ' + k.soyad, tutar = (SELECT SUM(ak.miktar * u.fiyat) FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id WHERE ak.silindi = 1 AND ak.durum_parametre_id != 51 AND ak.kaydeden_kullanici_id = k.kullanici_id AND ak.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')) FROM kullanicilar k WHERE k.silindi = 0) tbl WHERE tbl.tutar != 0"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "ad_soyad", ""); tc_urun.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "tutar", "{0:n2}"); tc_tutar.DataBindings.Add(binding1); XRBinding binding6 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_top_tutar.DataBindings.Add(binding6); XRSummary sum2 = new XRSummary(SummaryRunning.Page, SummaryFunc.Sum, "{0:c2}"); tc_top_tutar.Summary = sum2; GroupField sortField = new GroupField("tutar"); sortField.SortOrder = XRColumnSortOrder.Descending; this.Detail.SortFields.Add(sortField); }
private void AddContent(DataTable table) { XRTable dynamicTable = XRTable.CreateTable( new Rectangle(0, 0, TableWidth, 20), 1, 0); dynamicTable.Width = TableWidth; dynamicTable.Rows.FirstRow.Width = TableWidth; dynamicTable.Borders = DevExpress.XtraPrinting.BorderSide.All; dynamicTable.BorderWidth = 1; int i = 0; dynamicTable.BeginInit(); foreach (DataColumn dc in table.Columns) { XRTableCell cell = new XRTableCell(); XRBinding binding = new XRBinding("Text", table, table.Columns[i].ColumnName); cell.DataBindings.Add(binding); cell.CanGrow = false; cell.Width = 100; cell.Text = dc.ColumnName; dynamicTable.Rows.FirstRow.Cells.Add(cell); i++; } dynamicTable.Font = new Font("Verdana", 8F); dynamicTable.EndInit(); Detail.HeightF = 20f; Detail.Controls.Add(dynamicTable); }
public rp_finans_raporu(DateTime ilk_tarih, DateTime son_tarih) { InitializeComponent(); lbl_siparis_tarihi.Text = ilk_tarih.ToShortDateString() + " - " + son_tarih.ToShortDateString(); DataTable dt = SQL.get("SELECT fh.kayit_tarihi, fh.miktar, p.deger FROM finans_hareket fh INNER JOIN parametreler p ON p.parametre_id = fh.hareket_tipi_parametre_id WHERE fh.silindi = 0 AND fh.kayit_tarihi BETWEEN '" + ilk_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "' AND DATEADD(DAY, 0, '" + son_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "')"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "kayit_tarihi", ""); xrTableCell2.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "deger", ""); xrTableCell4.DataBindings.Add(binding1); XRBinding binding3 = new XRBinding("Text", this.DataSource, "miktar", "{0:c2}"); xrTableCell5.DataBindings.Add(binding3); XRBinding binding4 = new XRBinding("Text", this.DataSource, "miktar", "{0:c2}"); xrTableCell8.DataBindings.Add(binding4); XRSummary sum1 = new XRSummary(SummaryRunning.Page, SummaryFunc.Sum, "{0:c2}"); xrTableCell8.Summary = sum1; }
public rp_personel_iptal(DateTime tarih1, DateTime tarih2) { InitializeComponent(); lbl_tarih.Text = tarih1.Day + "." + tarih1.Month + "." + tarih1.Year + "-" + tarih2.Day + "." + tarih2.Month + "." + tarih2.Year; DataTable dt = SQL.get("SELECT ad_soyad = k.ad + ' ' + k.soyad, u.urun_adi, miktar = SUM(ak.miktar), tutar = SUM(ak.miktar * u.fiyat) FROM kullanicilar k LEFT OUTER JOIN adisyon_kalem ak ON ak.silindi = 1 AND ak.durum_parametre_id != 51 AND ak.kaydeden_kullanici_id = k.kullanici_id AND ak.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "') INNER JOIN urunler u ON u.urun_id = ak.urun_id " + " WHERE k.silindi = 0 GROUP by k.ad, k.soyad, u.urun_adi"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "ad_soyad", ""); lbl_personel.DataBindings.Add(binding0); XRBinding binding2 = new XRBinding("Text", this.DataSource, "urun_adi", ""); tc_urun.DataBindings.Add(binding2); XRBinding binding3 = new XRBinding("Text", this.DataSource, "miktar", "{0:n2}"); tc_miktar.DataBindings.Add(binding3); XRBinding binding4 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_tutar.DataBindings.Add(binding4); GroupField sortField = new GroupField("tutar"); sortField.SortOrder = XRColumnSortOrder.Descending; this.Detail.SortFields.Add(sortField); GroupField groupField = new GroupField("ad_soyad"); GroupHeader1.GroupFields.Add(groupField); }
private void XtraReport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { // Create a data binding object. XRBinding binding = new XRBinding("Text", null, "table.MyData"); // Add the data binding to the label's collection of bindings. xrSummaryLabel.DataBindings.Add(binding); // Create an XRSummary object. XRSummary summary = new XRSummary(); // Set a function which should be calculated. summary.Func = SummaryFunc.Sum; // Set a range for which the function should be calculated. summary.Running = SummaryRunning.Group; // Set the output string format. summary.FormatString = "{0:c2}"; // Make the label calculate the specified function for the // value specified by its DataBindings.Text property. xrSummaryLabel.Summary = summary; }
public rp_masa_grubuna_gore_satislar(DateTime tarih1, DateTime tarih2) { InitializeComponent(); lbl_tarih.Text = tarih1.Day + "." + tarih1.Month + "." + tarih1.Year + "-" + tarih2.Day + "." + tarih2.Month + "." + tarih2.Year; DataTable dt = SQL.get(" SELECT " + " mk.masa_kategori, " + " tutar = ISNULL((SELECT SUM(fh.miktar) FROM finans_hareket fh INNER JOIN adisyon a ON a.adisyon_id = fh.referans_id INNER JOIN masalar m ON m.masa_id = a.masa_id AND m.masa_kategori_id = mk.masa_kategori_id WHERE fh.silindi = 0 AND fh.hareket_tipi_parametre_id IN (25, 26, 27) AND fh.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')), 0) " + " FROM masalar_kategori mk " + " WHERE mk.silindi = 0 " + " AND 0 != ISNULL((SELECT SUM(fh.miktar) FROM finans_hareket fh INNER JOIN adisyon a ON a.adisyon_id = fh.referans_id INNER JOIN masalar m ON m.masa_id = a.masa_id AND m.masa_kategori_id = mk.masa_kategori_id WHERE fh.silindi = 0 AND fh.hareket_tipi_parametre_id IN (25, 26, 27) AND fh.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')), 0)"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "masa_kategori", ""); tc_masa_grubu.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_tutar.DataBindings.Add(binding1); GroupField sortField = new GroupField("tutar"); sortField.SortOrder = XRColumnSortOrder.Descending; this.Detail.SortFields.Add(sortField); }
public static XRBinding AddTextBinding(this XRControl control, string dataMember, string formatString = null) { if (dataMember == null) { throw new ArgumentNullException(nameof(dataMember)); } var binding = control.DataBindings[nameof(control.Text)]; if (binding != null) { control.DataBindings.Remove(binding); } binding = new XRBinding(nameof(control.Text), null, dataMember); if (!string.IsNullOrWhiteSpace(formatString)) { binding.FormatString = formatString; } control.DataBindings.Add(binding); return(binding); }
/// <summary> /// Lädt den Label-Text in das übergeben Label. /// </summary> public void LoadValueIntoField() { if (Control == null) { throw new ArgumentNullException("Control"); } if (DataSource == null) { throw new ArgumentNullException("DataSource"); } if (!FieldBindingInfo.ValueBufferPropertyNameExists) { throw new ArgumentNullException("ValueBufferPropertyName"); } // Prüfen, ob eine Bindung an die virtuelle multilange table besteht. if (IsPropertyBoundOnThisDataTable) { XRBinding binding = LabelDataBinding; string dataMember = binding.DataMember; BindValueProperty(GetDataBindingValue(dataMember)); // Umwandeln des Text-Binding in ein Tag-Binding Control.DataBindings.Remove(binding); Control.DataBindings.Add( FieldBindingInfo.ValueBufferPropertyName, null, dataMember); } }
protected RESULT ValidateBinding(XtraReport_Btfax p_report, XRControl p_xrControl) { if (p_xrControl.DataBindings.Count <= 0) { return(RESULT.SUCCESS); } XRBinding xrBinding = p_xrControl.DataBindings[0]; //// 바인딩 이름이 사용자 필드 존재여부 확인 //// foreach (CalculatedField calculateField in p_report.CalculatedFields) { string strBindingName = string.Format("{0}.{1}", calculateField.DataMember, calculateField.Name); if (strBindingName == xrBinding.DataMember) { return(RESULT.SUCCESS); } } //// 바인딩 이름이 전문필드 존재여부 확인 //// string strBindingData = p_report.GetPacketFieldData(xrBinding.DataMember); if (strBindingData != null) { return(RESULT.SUCCESS); } //// 로그기록 - 바인딩 데이터 없음 //// LogError(string.Format("{0} 팩스폼에서 [{1}] 컨트롤의 바인딩정보[{2}]에 해당하는 전문필드를 얻지 못하였습니다.", p_report.Name, p_xrControl.Name, xrBinding.DataMember), RESULT.F_MAKE_FAIL_TO_BINDING_DATA); return(RESULT.F_MAKE_FAIL_TO_BINDING_DATA); }
public rp_satis_raporu(int masa_id, DateTime ilk_tarih, DateTime son_tarih) { InitializeComponent(); lbl_siparis_tarihi.Text = ilk_tarih.ToShortDateString() + " - " + son_tarih.ToShortDateString(); DataTable dt = SQL.get("SELECT fh.kayit_tarihi, fh.miktar, p.deger, m.masa_adi FROM finans_hareket fh INNER JOIN parametreler p ON p.parametre_id = fh.hareket_tipi_parametre_id INNER JOIN adisyon a ON a.adisyon_id = fh.referans_id INNER JOIN masalar m ON m.masa_id = a.masa_id WHERE fh.silindi = 0 AND fh.hareket_tipi_parametre_id IN (25, 26, 27) AND (m.masa_id = " + masa_id + " OR " + masa_id + " = 0) AND fh.kayit_tarihi BETWEEN '" + ilk_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "' AND DATEADD(DAY, 0, '" + son_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "')"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "kayit_tarihi", ""); xrTableCell4.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "deger", ""); xrTableCell5.DataBindings.Add(binding1); XRBinding binding2 = new XRBinding("Text", this.DataSource, "masa_adi", ""); xrTableCell6.DataBindings.Add(binding2); XRBinding binding3 = new XRBinding("Text", this.DataSource, "miktar", "{0:c2}"); xrTableCell7.DataBindings.Add(binding3); XRBinding binding4 = new XRBinding("Text", this.DataSource, "miktar", "{0:c2}"); xrTableCell12.DataBindings.Add(binding4); XRSummary sum1 = new XRSummary(SummaryRunning.Page, SummaryFunc.Sum, "{0:c2}"); xrTableCell12.Summary = sum1; }
public rp_irsaliye(int irsaliye_id) { InitializeComponent(); DataTable dt_irsaliye = SQL.get("SELECT s.irsaliye_no, s.irsaliye_tarihi, c.cari_adi FROM urunler_irsaliye s INNER JOIN cariler c ON c.cari_id = s.cari_id WHERE s.irsaliye_id = " + irsaliye_id); lbl_cari_adi.Text = dt_irsaliye.Rows[0]["cari_adi"].ToString(); lbl_siparis_tarihi.Text = dt_irsaliye.Rows[0]["irsaliye_tarihi"].ToString(); lbl_siparis_no.Text = dt_irsaliye.Rows[0]["irsaliye_no"].ToString(); DataTable dt_irsaliye_kalem = SQL.get("SELECT s.siparis_no, i.irsaliye_kalem_id, i.urun_id, u.urun_adi, i.miktar, i.referans_siparis_kalem_id, olcu_birimi = p.deger, fatura_kalem_id = ISNULL(fk.fatura_kalem_id, 0) " + " FROM urunler_irsaliye_kalem i INNER JOIN urunler u ON u.urun_id = i.urun_id INNER JOIN parametreler p ON p.parametre_id = u.olcu_birimi_parametre_id INNER JOIN urunler_siparis_kalem sk ON sk.siparis_kalem_id = i.referans_siparis_kalem_id INNER JOIN urunler_siparis s ON s.siparis_id = sk.siparis_id LEFT OUTER JOIN urunler_fatura_kalem fk ON fk.silindi = 0 AND fk.referans_irsaliye_kalem_id = i.irsaliye_kalem_id " + " WHERE i.silindi = 0 AND i.irsaliye_id = " + irsaliye_id); this.DataSource = dt_irsaliye_kalem; XRBinding binding0 = new XRBinding("Text", this.DataSource, "urun_adi", ""); xrTableCell10.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "siparis_no", ""); xrTableCell11.DataBindings.Add(binding1); XRBinding binding2 = new XRBinding("Text", this.DataSource, "olcu_birimi", "{0:n0}"); xrTableCell12.DataBindings.Add(binding2); XRBinding binding3 = new XRBinding("Text", this.DataSource, "miktar", "{0:c2}"); xrTableCell13.DataBindings.Add(binding3); }
public rp_adisyon(int adisyon_id) { InitializeComponent(); string text = ""; try { text = System.IO.File.ReadAllText(@"firma_bilgi.txt"); } catch { text = ""; } xrLabel1.Text = text; DataTable dt_adisyon_kalem = SQL.get("SELECT u.fiyat, kullanici = k.ad + ' ' + k.soyad, a.kayit_tarihi, a.adisyon_id, adres_id = a.adres, masa_adi = CASE a.masa_id WHEN -1 THEN 'PERAKENDE SATIŞ' WHEN 0 THEN 'PERAKENDE SATIŞ' ELSE ISNULL(m.masa_adi, '') END, ak.adisyon_kalem_id, u.urun_adi, ak.miktar, ak.ikram_miktar, tutar = CASE ak.menu_id WHEN 0 THEN (ak.miktar - ak.ikram_miktar) * u.fiyat ELSE ak.fiyat END, olcu_birimi = p.deger, ak.durum_parametre_id, durum = dr.deger, kurye = kurye.ad + ' ' + kurye.soyad, a.ad_soyad, mst.adres, mst.adres_2, mst.adres_3, mst.telefon, mn.menu, ak.aciklama FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id INNER JOIN parametreler p ON p.parametre_id = u.olcu_birimi_parametre_id INNER JOIN parametreler dr ON dr.parametre_id = ak.durum_parametre_id INNER JOIN adisyon a ON a.adisyon_id = ak.adisyon_id LEFT OUTER JOIN masalar m ON m.masa_id = a.masa_id INNER JOIN kullanicilar k ON k.kullanici_id = ak.kaydeden_kullanici_id LEFT OUTER JOIN kullanicilar kurye ON kurye.kullanici_id = a.kurye_kullanici_id LEFT OUTER JOIN musteri mst ON mst.musteri_id = a.musteri_id LEFT OUTER JOIN menuler mn ON mn.menu_id = ak.menu_id WHERE ak.silindi = 0 AND ak.odendi = 0 AND ak.adisyon_id = " + adisyon_id); if (dt_adisyon_kalem.Rows.Count <= 0) { dt_adisyon_kalem = SQL.get("SELECT u.fiyat, kullanici = k.ad + ' ' + k.soyad, a.kayit_tarihi, a.adisyon_id, adres_id = a.adres, masa_adi = CASE a.masa_id WHEN -1 THEN 'PERAKENDE SATIŞ' WHEN 0 THEN 'PERAKENDE SATIŞ' ELSE ISNULL(m.masa_adi, '') END, ak.adisyon_kalem_id, u.urun_adi, ak.miktar, ak.ikram_miktar, tutar = CASE ak.menu_id WHEN 0 THEN (ak.miktar - ak.ikram_miktar) * u.fiyat ELSE ak.fiyat END, olcu_birimi = p.deger, ak.durum_parametre_id, durum = dr.deger, kurye = kurye.ad + ' ' + kurye.soyad, a.ad_soyad, mst.adres, mst.adres_2, mst.adres_3, mst.telefon, mn.menu, ak.aciklama FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id INNER JOIN parametreler p ON p.parametre_id = u.olcu_birimi_parametre_id INNER JOIN parametreler dr ON dr.parametre_id = ak.durum_parametre_id INNER JOIN adisyon a ON a.adisyon_id = ak.adisyon_id LEFT OUTER JOIN masalar m ON m.masa_id = a.masa_id INNER JOIN kullanicilar k ON k.kullanici_id = ak.kaydeden_kullanici_id LEFT OUTER JOIN kullanicilar kurye ON kurye.kullanici_id = a.kurye_kullanici_id LEFT OUTER JOIN musteri mst ON mst.musteri_id = a.musteri_id LEFT OUTER JOIN menuler mn ON mn.menu_id = ak.menu_id WHERE ak.silindi = 0 AND ak.adisyon_id = " + adisyon_id); } this.DataSource = dt_adisyon_kalem; DataTable dt_adisyon_fiyat = SQL.get("SELECT top_tutar = ISNULL(SUM(CASE ak.menu_id WHEN 0 THEN (ak.miktar - ak.ikram_miktar) * u.fiyat ELSE ak.fiyat END), 0.0000) FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id WHERE ak.silindi = 0 AND ak.adisyon_id = " + adisyon_id); DataTable dt_finans = SQL.get("SELECT top_tutar = ISNULL(SUM(miktar), 0.0000) FROM finans_hareket WHERE silindi = 0 AND hareket_tipi_parametre_id IN (25, 26, 27, 59) AND referans_id = " + adisyon_id); lbl_masa_adi.Text = dt_adisyon_kalem.Rows[0]["masa_adi"].ToString(); lbl_acan_kullanici.Text = dt_adisyon_kalem.Rows[0]["kullanici"].ToString(); lbl_fis_acilis_tarihi.Text = dt_adisyon_kalem.Rows[0]["kayit_tarihi"].ToString(); lbl_fis_no.Text = adisyon_id.ToString(); lbl_adres_bilgileri.Text = (dt_adisyon_kalem.Rows[0]["kurye"].ToString().Length > 2 ? "KURYE : " + dt_adisyon_kalem.Rows[0]["kurye"].ToString() + "\n" : "") + (dt_adisyon_kalem.Rows[0]["ad_soyad"].ToString().Length > 2 ? "İSİM : " + dt_adisyon_kalem.Rows[0]["ad_soyad"].ToString() + "\n" : "") + (dt_adisyon_kalem.Rows[0]["telefon"].ToString().Length > 2 ? "TEL : " + dt_adisyon_kalem.Rows[0]["telefon"].ToString() + "\n" : "") + (dt_adisyon_kalem.Rows[0][(dt_adisyon_kalem.Rows[0]["adres_id"].ToString() == "1" ? "adres" : "adres_" + dt_adisyon_kalem.Rows[0]["adres_id"].ToString())].ToString().Length > 0 ? "ADRES : " + dt_adisyon_kalem.Rows[0][(dt_adisyon_kalem.Rows[0]["adres_id"].ToString() == "1" ? "adres" : "adres_" + dt_adisyon_kalem.Rows[0]["adres_id"].ToString())].ToString() + "\n" : ""); XRBinding binding0 = new XRBinding("Text", this.DataSource, "urun_adi", ""); lbl_urun_adi.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "miktar", "x {0:0.##}"); lbl_mikta.DataBindings.Add(binding1); XRBinding binding4 = new XRBinding("Text", this.DataSource, "fiyat", "{0:c2}"); lbl_birim_fiyat.DataBindings.Add(binding4); XRBinding binding2 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); lbl_tutar.DataBindings.Add(binding2); XRBinding binding5 = new XRBinding("Text", this.DataSource, "aciklama", ""); lbl_menu.DataBindings.Add(binding5); /*XRBinding binding3 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); * lbl_toplam_tutar.DataBindings.Add(binding3); * * XRSummary sum1 = new XRSummary(SummaryRunning.Page, SummaryFunc.Sum, "{0:c2}"); * lbl_toplam_tutar.Summary = sum1;*/ lbl_toplam_tutar.Text = (Convert.ToDecimal(dt_adisyon_fiyat.Rows[0]["top_tutar"]) - Convert.ToDecimal(dt_finans.Rows[0]["top_tutar"])).ToString("c2"); }
public rp_personel_ikram(DateTime tarih1, DateTime tarih2) { InitializeComponent(); lbl_tarih.Text = tarih1.Day + "." + tarih1.Month + "." + tarih1.Year + "-" + tarih2.Day + "." + tarih2.Month + "." + tarih2.Year; DataTable dt = SQL.get("SELECT ad_soyad = k.ad + ' ' + k.soyad, u.urun_adi, miktar = SUM(ak.ikram_miktar), tutar = SUM(ak.ikram_miktar * u.fiyat), p.deger FROM kullanicilar k LEFT OUTER JOIN adisyon_kalem ak ON ak.silindi = 0 AND ak.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "') AND ak.ikram != 0 AND ak.kaydeden_kullanici_id = k.kullanici_id INNER JOIN urunler u ON u.urun_id = ak.urun_id LEFT OUTER JOIN parametreler p ON p.parametre_id = ak.ikram " + " WHERE k.silindi = 0 " + " GROUP by k.ad, k.soyad, u.urun_adi, p.deger"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "ad_soyad", ""); lbl_personel.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "deger", ""); lbl_deger.DataBindings.Add(binding1); XRBinding binding2 = new XRBinding("Text", this.DataSource, "urun_adi", ""); tc_urun.DataBindings.Add(binding2); XRBinding binding3 = new XRBinding("Text", this.DataSource, "miktar", "{0:n2}"); tc_miktar.DataBindings.Add(binding3); XRBinding binding4 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_tutar.DataBindings.Add(binding4); XRBinding binding5 = new XRBinding("Text", this.DataSource, "miktar", "{0:c2}"); tc_top_miktar.DataBindings.Add(binding5); XRSummary sum1 = new XRSummary(SummaryRunning.Group, SummaryFunc.Sum, "{0:c2}"); tc_top_miktar.Summary = sum1; XRBinding binding6 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_top_tutar.DataBindings.Add(binding6); XRSummary sum2 = new XRSummary(SummaryRunning.Group, SummaryFunc.Sum, "{0:c2}"); tc_top_tutar.Summary = sum2; GroupField sortField = new GroupField("tutar"); sortField.SortOrder = XRColumnSortOrder.Descending; this.Detail.SortFields.Add(sortField); GroupField groupField = new GroupField("ad_soyad"); GroupHeader2.GroupFields.Add(groupField); GroupField groupField1 = new GroupField("deger"); GroupHeader1.GroupFields.Add(groupField1); }
public rp_siparis(int siparis_id) { InitializeComponent(); DataTable dt_siparis = SQL.get("SELECT s.siparis_id, s.kayit_tarihi, s.tahmini_teslim_tarihi, c.cari_adi FROM urunler_siparis s INNER JOIN cariler c ON c.cari_id = s.cari_id WHERE s.siparis_id = " + siparis_id); lbl_cari_adi.Text = dt_siparis.Rows[0]["cari_adi"].ToString(); lbl_siparis_tarihi.Text = dt_siparis.Rows[0]["kayit_tarihi"].ToString(); lbl_teslim_tarihi.Text = dt_siparis.Rows[0]["tahmini_teslim_tarihi"].ToString(); lbl_siparis_no.Text = dt_siparis.Rows[0]["siparis_id"].ToString(); DataTable dt_siparis_kalem = SQL.get("SELECT sk.siparis_kalem_id, sk.urun_id, u.urun_adi, olcu_birimi = p.deger, sk.miktar, sk.kapandi, sk.birim_fiyat, sk.iskonto_1, sk.iskonto_2, u.kdv, " + " net_toplam = sk.miktar * (((sk.birim_fiyat - (sk.birim_fiyat / 100 * sk.iskonto_1)) - ((sk.birim_fiyat - (sk.birim_fiyat / 100 * sk.iskonto_1)) / 100 * sk.iskonto_2)) + (((sk.birim_fiyat - (sk.birim_fiyat / 100 * sk.iskonto_1)) - ((sk.birim_fiyat - (sk.birim_fiyat / 100 * sk.iskonto_1)) / 100 * sk.iskonto_2)) / 100 * u.kdv)), " + " net_birim_fiyat = (((sk.birim_fiyat - (sk.birim_fiyat / 100 * sk.iskonto_1)) - ((sk.birim_fiyat - (sk.birim_fiyat / 100 * sk.iskonto_1)) / 100 * sk.iskonto_2)) + (((sk.birim_fiyat - (sk.birim_fiyat / 100 * sk.iskonto_1)) - ((sk.birim_fiyat - (sk.birim_fiyat / 100 * sk.iskonto_1)) / 100 * sk.iskonto_2)) / 100 * u.kdv)) " + " FROM urunler_siparis_kalem sk INNER JOIN urunler u ON u.urun_id = sk.urun_id INNER JOIN parametreler p ON p.parametre_id = u.olcu_birimi_parametre_id WHERE sk.silindi = 0 AND sk.siparis_id = " + siparis_id); this.DataSource = dt_siparis_kalem; XRBinding binding0 = new XRBinding("Text", this.DataSource, "urun_adi", ""); xrTableCell10.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "olcu_birimi", ""); xrTableCell11.DataBindings.Add(binding1); XRBinding binding2 = new XRBinding("Text", this.DataSource, "miktar", "{0:n0}"); xrTableCell12.DataBindings.Add(binding2); XRBinding binding3 = new XRBinding("Text", this.DataSource, "birim_fiyat", "{0:c2}"); xrTableCell13.DataBindings.Add(binding3); XRBinding binding4 = new XRBinding("Text", this.DataSource, "iskonto_1", "{0:n0}"); xrTableCell14.DataBindings.Add(binding4); XRBinding binding5 = new XRBinding("Text", this.DataSource, "iskonto_2", "{0:n0}"); xrTableCell15.DataBindings.Add(binding5); XRBinding binding6 = new XRBinding("Text", this.DataSource, "kdv", "{0:n0}"); xrTableCell16.DataBindings.Add(binding6); XRBinding binding7 = new XRBinding("Text", this.DataSource, "net_birim_fiyat", "{0:c2}"); xrTableCell17.DataBindings.Add(binding7); XRBinding binding8 = new XRBinding("Text", this.DataSource, "net_toplam", "{0:c2}"); xrTableCell18.DataBindings.Add(binding8); }
/// <summary> /// Prüft, ob die Property des Label gebunden ist. /// </summary> /// <param name="propertyName"></param> /// <returns></returns> protected bool IsPropertyBoundOnDataTable(string propertyName) { XRBinding propertyDataBinding = Control.DataBindings[propertyName]; // Ist ein DataBinding an die Text-Property vorhanden? if (propertyDataBinding != null) { string dataMember = propertyDataBinding.DataMember; // Handelt es sich um eine Datenbindung an die // virtuelle ReportLabelDataTable? if (!string.IsNullOrEmpty(dataMember) && dataMember.StartsWith(FieldBindingInfo.DataTableName)) { return(true); } } return(false); }
protected RESULT BindImageBox(XtraReport_Btfax p_report, XRPictureBox p_xrPictureBox) { if (p_xrPictureBox.DataBindings.Count <= 0) { return(RESULT.SUCCESS); } XRBinding xrBinding = p_xrPictureBox.DataBindings[0]; string strImageFile = p_report.GetPacketFieldData(xrBinding.DataMember); if (strImageFile == null) { LogError(string.Format("전문 XML 에서 이미지파일정보[{0}]을 얻지 못하였습니다.", xrBinding.DataMember), RESULT.F_MAKE_IMAGEFILE_INFO_NOT_IN_PACKET); return(RESULT.F_MAKE_IMAGEFILE_INFO_NOT_IN_PACKET); } string strImagFullPath = string.Format("{0}\\{1}", Config.INPUT_DOCS_PATH, strImageFile); if (!File.Exists(strImagFullPath)) { LogError(string.Format("[{0}] 파일이 존재하지 않습니다.", strImagFullPath), RESULT.F_MAKE_IMAGEFILE_NOT_EXIST); return(RESULT.F_MAKE_IMAGEFILE_NOT_EXIST); } try { p_xrPictureBox.DataBindings.Clear(); Image img = Image.FromFile(strImagFullPath); p_xrPictureBox.Image = img; int angle = p_xrPictureBox.Angle; p_xrPictureBox.Angle = 0; p_xrPictureBox.Angle = angle; } catch (Exception ex) { LogError(string.Format("이미지파일[{0}:{1}]을 열지 못하였습니다. {2}", xrBinding.DataMember, strImagFullPath, ex), RESULT.F_MAKE); return(RESULT.F_MAKE_IMAGEFILE_NOT_EXIST); } return(RESULT.SUCCESS); }
public rp_ust_kategori_satis(DateTime tarih1, DateTime tarih2) { InitializeComponent(); lbl_tarih.Text = tarih1.Day + "." + tarih1.Month + "." + tarih1.Year + "-" + tarih2.Day + "." + tarih2.Month + "." + tarih2.Year; DataTable dt = SQL.get("SELECT k.kategori_adi, tutar = ISNULL((SELECT SUM(ak.miktar * u.fiyat) FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id INNER JOIN kategoriler k1 ON k1.kategori_id = u.kategori_id AND k1.ust_kategori_id = k.kategori_id WHERE ak.silindi = 0 AND ak.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')), 0) FROM kategoriler k " + " WHERE k.silindi = 0 AND k.ust_kategori_id = 0 AND k.menude_gosterilsin = 1 AND 0 != ISNULL((SELECT SUM(ak.miktar * u.fiyat) FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id INNER JOIN kategoriler k1 ON k1.kategori_id = u.kategori_id AND k1.ust_kategori_id = k.kategori_id WHERE ak.silindi = 0 AND ak.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')), 0)"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "kategori_adi", ""); tc_masa_grubu.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_tutar.DataBindings.Add(binding1); GroupField sortField = new GroupField("tutar"); sortField.SortOrder = XRColumnSortOrder.Descending; this.Detail.SortFields.Add(sortField); }
/// <summary> /// Set text for table cell /// </summary> /// <param name="tableCell">Given table cell</param> public virtual void SetTextTableCell(XRTableCell tableCell) { if (!string.IsNullOrEmpty(tableCell.Text)) { XRBinding biding = tableCell.DataBindings[0]; double cellValue = 0; if (double.TryParse(tableCell.Text, out cellValue)) { if (cellValue < 0) { if (tableCell.Text.StartsWith("-")) { tableCell.Text = tableCell.Text.Remove(0, 1); } tableCell.Text = string.Format("({0})", tableCell.Text); tableCell.ForeColor = Color.Red; } else if (cellValue > 0) { tableCell.ForeColor = Color.Black; } else if (cellValue == 0) { //tableCell.Text = string.Empty; } } else { DateTime dateTime = DateTime.MaxValue; if (DateTime.TryParse(tableCell.Text, out dateTime)) { if (dateTime.Date == DateTime.MaxValue.Date) { tableCell.Text = string.Empty; } } } } }
public rp_odeme(int adisyon_id, DataTable dt, string odeme_tipi, decimal tutar) { InitializeComponent(); string text = ""; try { text = System.IO.File.ReadAllText(@"firma_bilgi.txt"); } catch { text = ""; } xrLabel1.Text = text; pb_logo.ImageUrl = "firma_logo.png"; DataTable dt_adisyon_kalem = SQL.get("SELECT u.fiyat, kullanici = k.ad + ' ' + k.soyad, a.kayit_tarihi, a.adisyon_id, masa_adi = ISNULL(m.masa_adi, 'SELF SERVİS'), ak.adisyon_kalem_id, u.urun_adi, ak.miktar, ak.ikram_miktar, tutar = (ak.miktar - ak.ikram_miktar) * u.fiyat, olcu_birimi = p.deger, ak.durum_parametre_id, durum = dr.deger FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id INNER JOIN parametreler p ON p.parametre_id = u.olcu_birimi_parametre_id INNER JOIN parametreler dr ON dr.parametre_id = ak.durum_parametre_id INNER JOIN adisyon a ON a.adisyon_id = ak.adisyon_id LEFT OUTER JOIN masalar m ON m.masa_id = a.masa_id INNER JOIN kullanicilar k ON k.kullanici_id = ak.kaydeden_kullanici_id WHERE ak.silindi = 0 AND ak.adisyon_id = " + adisyon_id); lbl_masa_adi.Text = "Perakende Satış"; lbl_acan_kullanici.Text = dt_adisyon_kalem.Rows[0]["kullanici"].ToString(); lbl_fis_acilis_tarihi.Text = dt_adisyon_kalem.Rows[0]["kayit_tarihi"].ToString(); lbl_fis_no.Text = adisyon_id.ToString(); lbl_odeme_tipi.Text = odeme_tipi; lbl_toplam_tutar.Text = tutar.ToString("c2"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "urun_adi", ""); tc_urun_adi.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "miktar", "x {0:0.##}"); tc_miktar.DataBindings.Add(binding1); XRBinding binding2 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_tutar.DataBindings.Add(binding2); XRBinding binding3 = new XRBinding("Text", this.DataSource, "fiyat", "{0:c2}"); tc_birim_fiyat.DataBindings.Add(binding3); InitializeComponent(); }
public rp_urun_satislari(DateTime tarih1, DateTime tarih2) { InitializeComponent(); lbl_tarih.Text = tarih1.Day + "." + tarih1.Month + "." + tarih1.Year + "-" + tarih2.Day + "." + tarih2.Month + "." + tarih2.Year; DataTable dt = SQL.get(" SELECT " + " u.urun_adi, " + " tutar = ISNULL((SELECT SUM(ak.miktar) * u.fiyat FROM adisyon_kalem ak WHERE ak.silindi = 0 AND ak.urun_id = u.urun_id AND ak.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')), 0) " + " FROM urunler u WHERE u.silindi = 0 AND u.menu_aktif = 1 AND 0 != ISNULL((SELECT SUM(ak.miktar) * u.fiyat FROM adisyon_kalem ak WHERE ak.silindi = 0 AND ak.urun_id = u.urun_id AND ak.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')), 0) "); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "urun_adi", ""); tc_masa_grubu.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_tutar.DataBindings.Add(binding1); GroupField sortField = new GroupField("tutar"); sortField.SortOrder = XRColumnSortOrder.Descending; this.Detail.SortFields.Add(sortField); }
/// <summary> /// Bindet das Label an die DataTable. /// </summary> public void Rebind() { if (Control == null) { throw new ArgumentNullException("Control"); } XRBinding binding = Control.DataBindings[ FieldBindingInfo.ValuePropertyName]; if (binding != null) { Control.DataBindings.Remove(binding); } Control.DataBindings.Add( new XRBinding( FieldBindingInfo.ValuePropertyName, null, string.Format( "{0}.{1}", FieldBindingInfo.DataTableName, Control.Name))); }
public rp_personel_satis(DateTime tarih1, DateTime tarih2) { InitializeComponent(); lbl_tarih.Text = tarih1.Day + "." + tarih1.Month + "." + tarih1.Year + "-" + tarih2.Day + "." + tarih2.Month + "." + tarih2.Year; DataTable dt = SQL.get(" SELECT " + " ad_soyad = k.ad + ' ' + k.soyad, " + " tutar = ISNULL((SELECT SUM(ak.miktar * u.fiyat) FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id WHERE ak.silindi = 0 AND ak.kaydeden_kullanici_id = k.kullanici_id AND ak.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')), 0) " + " FROM kullanicilar k WHERE k.silindi = 0 AND 0 != ISNULL((SELECT SUM(ak.miktar * u.fiyat) FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id WHERE ak.silindi = 0 AND ak.kaydeden_kullanici_id = k.kullanici_id AND ak.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')), 0)"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "ad_soyad", ""); tc_masa_grubu.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_tutar.DataBindings.Add(binding1); GroupField sortField = new GroupField("tutar"); sortField.SortOrder = XRColumnSortOrder.Descending; this.Detail.SortFields.Add(sortField); }
public rp_stok_hareket_raporu(int urun_id, DateTime ilk_tarih, DateTime son_tarih) { InitializeComponent(); DataTable dt_urun = SQL.get("SELECT * FROM urunler WHERE urun_id = " + urun_id); lbl_urun_adi.Text = dt_urun.Rows[0]["urun_adi"].ToString(); lbl_siparis_tarihi.Text = ilk_tarih.ToShortDateString() + " - " + son_tarih.ToShortDateString(); DataTable dt_stok_hareket = SQL.get("SELECT uh.kayit_tarihi, uh.miktar, tip = p.deger, belge_no = (CASE uh.hareket_tipi_parametre_id WHEN 34 THEN (SELECT uf.fatura_no FROM urunler_fatura_kalem ufk INNER JOIN urunler_fatura uf ON uf.fatura_id = ufk.fatura_id WHERE ufk.fatura_kalem_id = uh.referans_id) WHEN 4 THEN (SELECT ui.irsaliye_no FROM urunler_irsaliye_kalem uik INNER JOIN urunler_irsaliye ui ON ui.irsaliye_id = uik.irsaliye_id WHERE uik.irsaliye_kalem_id = uh.referans_id) ELSE '-' END), cari_adi = (CASE uh.hareket_tipi_parametre_id WHEN 34 THEN (SELECT c.cari_adi FROM urunler_fatura_kalem ufk INNER JOIN urunler_fatura uf ON uf.fatura_id = ufk.fatura_id INNER JOIN cariler c ON c.cari_id = uf.cari_id WHERE ufk.fatura_kalem_id = uh.referans_id) WHEN 4 THEN (SELECT c.cari_adi FROM urunler_irsaliye_kalem uik INNER JOIN urunler_irsaliye ui ON ui.irsaliye_id = uik.irsaliye_id INNER JOIN cariler c ON c.cari_id = ui.cari_id WHERE uik.irsaliye_kalem_id = uh.referans_id) ELSE '-' END) FROM urunler_hareket uh INNER JOIN parametreler p ON p.parametre_id = uh.hareket_tipi_parametre_id LEFT OUTER JOIN adisyon a ON uh.hareket_tipi_parametre_id = 3 AND a.adisyon_id = uh.referans_id WHERE uh.silindi = 0 AND uh.urun_id = " + urun_id + " AND uh.kayit_tarihi BETWEEN '" + ilk_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "' AND DATEADD(DAY, 0, '" + son_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "') ORDER by uh.kayit_tarihi"); this.DataSource = dt_stok_hareket; XRBinding binding0 = new XRBinding("Text", this.DataSource, "kayit_tarihi", ""); xrTableCell2.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "tip", ""); xrTableCell4.DataBindings.Add(binding1); XRBinding binding4 = new XRBinding("Text", this.DataSource, "cari_adi", ""); xrTableCell12.DataBindings.Add(binding4); XRBinding binding5 = new XRBinding("Text", this.DataSource, "belge_no", ""); xrTableCell13.DataBindings.Add(binding5); XRBinding binding2 = new XRBinding("Text", this.DataSource, "miktar", "{0:0.##}"); xrTableCell5.DataBindings.Add(binding2); XRBinding binding3 = new XRBinding("Text", this.DataSource, "miktar", "{0:0.##}"); xrTableCell8.DataBindings.Add(binding3); XRSummary sum1 = new XRSummary(SummaryRunning.Report, SummaryFunc.Sum, "{0:0.##}"); xrTableCell8.Summary = sum1; }
private void xrTranAccount_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { // Create a data binding object. XRBinding binding = new XRBinding("Text", null, "ViewTransactionPostCollectionBank.Dr"); XRBinding bindings = new XRBinding("Text", null, "ViewTransactionPostCollectionBank.Cr"); XRBinding bindincol = new XRBinding("Text", null, "ViewTransactionPostCollectionBank.CloseBal"); XRBinding bindingAmt = new XRBinding("Text", null, "ViewTransactionPostCollectionBank.Amount"); XRBinding bindingopen = new XRBinding("Text", null, "ViewTransactionPostCollectionBank.OpenBal"); // Add the data binding to the label's collection of bindings. xrSummaryDr.DataBindings.Add(binding); xrSummaryCr.DataBindings.Add(bindings); xrCloseBal.DataBindings.Add(bindincol); xrAmt.DataBindings.Add(bindingAmt); xrOpenBal.DataBindings.Add(bindingopen); // Create an XRSummary object. XRSummary summdb = new XRSummary(); XRSummary summcr = new XRSummary(); XRSummary sumclose = new XRSummary(); XRSummary sumAt = new XRSummary(); XRSummary sumOpen = new XRSummary(); summdb.Func = SummaryFunc.Sum; summdb.Running = SummaryRunning.Group; summdb.IgnoreNullValues = true; summdb.FormatString = "# {0:n2}"; summcr.Func = SummaryFunc.Sum; summcr.Running = SummaryRunning.Group; summcr.IgnoreNullValues = true; summcr.FormatString = "# {0:n2}"; sumclose.Func = SummaryFunc.DSum; sumclose.Running = SummaryRunning.Report; sumclose.FormatString = "# {0:n2}"; sumOpen.Func = SummaryFunc.DSum; sumOpen.Running = SummaryRunning.Report; sumOpen.FormatString = "# {0:n2}"; sumAt.Func = SummaryFunc.DSum; sumAt.Running = SummaryRunning.Report; sumAt.FormatString = "# {0:n2}"; xrSummaryDr.Summary = summdb; xrSummaryDr.ForeColor = Color.Green; xrAmt.Summary = sumAt; xrAmt.ForeColor = Color.Red; xrSummaryCr.Summary = summcr; xrSummaryCr.ForeColor = Color.Green; xrCloseBal.Summary = sumclose; xrCloseBal.ForeColor = Color.DarkOliveGreen; //xrLabel12.ForeColor = Color.DarkOliveGreen; xrOpenBal.Summary = sumOpen; xrOpenBal.ForeColor = Color.DarkOliveGreen; SummaryFunc res = default(SummaryFunc); res = SummaryFunc.Sum; XRSummary totdb = default(XRSummary); totdb = xrSummaryDr.Summary; XRSummary totcd = default(XRSummary); totcd = xrSummaryCr.Summary; }
public frmRpt_GroupPayment_Rs(List<RptPaymentStyle1_ForPrint> aListData,string CompanyName, string Address, string NameCustomerGroup,string InvoiceNumber , DateTime FirstDate, DateTime LastDate, decimal? BookingHMoney, decimal? BookingRMoney, int IDBookingR, int Div) { InitializeComponent(); this.aListData = aListData; if (string.IsNullOrEmpty(Div.ToString()) || Div == 1) { Div = 1; lblTitle.Text = "PHIẾU BÁO THANH TOÁN"; } else { lblTitle.Text = "PHIẾU BÁO THANH TOÁN (CHIA " + Div + ")"; } for (int i = 0; i < this.aListData.Count; i++) { this.aListData[i].DrinkMoney = this.aListData[i].DrinkMoney / Div; this.aListData[i].Hall_Fee = this.aListData[i].Hall_Fee / Div; this.aListData[i].MealMoney = this.aListData[i].MealMoney / Div; this.aListData[i].OtherMoney = this.aListData[i].OtherMoney / Div; this.aListData[i].Room_Fee = this.aListData[i].Room_Fee / Div; this.aListData[i].RoomServiceMoney = this.aListData[i].RoomServiceMoney / Div; this.aListData[i].ServiceGroup10_Fee = this.aListData[i].ServiceGroup10_Fee / Div; this.aListData[i].ServiceGroup11_Fee = this.aListData[i].ServiceGroup11_Fee / Div; this.aListData[i].ServiceGroup12_Fee = this.aListData[i].ServiceGroup12_Fee / Div; this.aListData[i].ServiceGroup13_Fee = this.aListData[i].ServiceGroup13_Fee / Div; this.aListData[i].ServiceGroup14_Fee = this.aListData[i].ServiceGroup14_Fee / Div; this.aListData[i].ServiceGroup15_Fee = this.aListData[i].ServiceGroup15_Fee / Div; this.aListData[i].ServiceGroup2_Fee = this.aListData[i].ServiceGroup2_Fee / Div; this.aListData[i].ServiceGroup3_Fee = this.aListData[i].ServiceGroup3_Fee / Div; this.aListData[i].ServiceGroup4_Fee = this.aListData[i].ServiceGroup4_Fee / Div; this.aListData[i].ServiceGroup5_Fee = this.aListData[i].ServiceGroup5_Fee / Div; this.aListData[i].ServiceGroup6_Fee = this.aListData[i].ServiceGroup6_Fee / Div; this.aListData[i].ServiceGroup7_Fee = this.aListData[i].ServiceGroup7_Fee / Div; this.aListData[i].ServiceGroup8_Fee = this.aListData[i].ServiceGroup8_Fee / Div; this.aListData[i].ServiceGroup9_Fee = this.aListData[i].ServiceGroup9_Fee / Div; this.aListData[i].TotalMoney = this.aListData[i].TotalMoney / Div; this.aListData[i].TotalServiceMoney = this.aListData[i].TotalServiceMoney / Div; //---------------------------------------------------------------------- TotalServiceMoney = TotalServiceMoney + this.aListData[i].TotalServiceMoney; TotalMoneyBeforeTax = TotalMoneyBeforeTax + this.aListData[i].TotalMoney; this.aListData[i].Room_Fee = this.aListData[i].Room_Fee + this.aListData[i].Hall_Fee; } //Truyền dữ liệu cho Detail lblCompanyName.Text = CompanyName; lblAddress.Text = Address; lblCustomerGroupName.Text = NameCustomerGroup; lblCheckIn.Text = FirstDate.ToString("dd-MM-yyyy"); lblCheckOut.Text = LastDate.ToString("dd-MM-yyyy"); BookingRs aBookingRs = new BookingRs(); aBookingRs = (new BookingRsBO()).Select_ByID(IDBookingR); lblIDBookingR.Text = IDBookingR.ToString(); lblInvoiceNumber.Text = aBookingRs.InvoiceNumber; lblInvoiceDate.Text = aBookingRs.InvoiceDate.GetValueOrDefault().Date.ToShortDateString(); lbAcceptDate.Text = aBookingRs.AcceptDate.GetValueOrDefault().Date.ToShortDateString(); this.DetailReport.DataSource = this.aListData; colDate.DataBindings.Add("Text", this.DetailReport.DataSource, "Date", "{0:dd-MM}"); colDescription.DataBindings.Add("Text", this.DetailReport.DataSource, "Note"); colNumberCus.DataBindings.Add("Text", this.DetailReport.DataSource, "CountCustomerInGroup"); colMoneyRoom.DataBindings.Add("Text", this.DetailReport.DataSource, "Room_Fee", "{0:0,0}"); colTotalARoom.DataBindings.Add("Text", this.DetailReport.DataSource, "TotalMoney", "{0:0,0}"); // colHallMoney.DataBindings.Add("Text", this.DetailReport.DataSource, "Hall_Fee", "{0:0,0}"); colMealMoney.DataBindings.Add("Text", this.DetailReport.DataSource, "MealMoney", "{0:0,0}"); colDrinkMoney.DataBindings.Add("Text", this.DetailReport.DataSource, "DrinkMoney", "{0:0,0}"); colRoomServiceMoney.DataBindings.Add("Text", this.DetailReport.DataSource, "RoomServiceMoney", "{0:0,0}"); colOtherMoney.DataBindings.Add("Text", this.DetailReport.DataSource, "OtherMoney", "{0:0,0}"); colMoneyService.Text = TotalServiceMoney.ToString("0,0"); colMoneyBeforeTax.Text = TotalMoneyBeforeTax.ToString("0,0"); colMoneyTax.Text = (TotalMoneyBeforeTax * 10 / 100).ToString("0,0"); colMoneyAfterTax.Text = (TotalMoneyBeforeTax * 110 / 100).ToString("0,0"); colBookingMoney.Text = Convert.ToDecimal(BookingHMoney.GetValueOrDefault(0) + BookingRMoney.GetValueOrDefault(0)).ToString("0,0"); colTotalMoneyPay.Text = ((TotalMoneyBeforeTax * 110 / 100) - Convert.ToDecimal(BookingHMoney.GetValueOrDefault(0) + BookingRMoney.GetValueOrDefault(0))).ToString("0,0"); string TotalMoney_String = UppercaseFirst(StringUtility.ConvertDecimalToString((TotalMoneyBeforeTax * 110 / 100) - Convert.ToDecimal(BookingHMoney.GetValueOrDefault(0) + BookingRMoney.GetValueOrDefault(0)))); lblConvertToString.Text = TotalMoney_String; int day = DateTime.Now.Day; int month = DateTime.Now.Month; int year = DateTime.Now.Year; lblDayMonthYear.Text = "Hà Nội, ngày " + day.ToString() + " tháng " + month.ToString() + " năm " + year.ToString(); //--------------Tính tổng--------------------------------- XRSummary aXRSummaryMoney = new XRSummary(); aXRSummaryMoney.Func = SummaryFunc.Sum; aXRSummaryMoney.Running = SummaryRunning.Group; aXRSummaryMoney.IgnoreNullValues = true; aXRSummaryMoney.FormatString = "{0:0,0}"; XRBinding aXRBindingMoney = new XRBinding("Text", this.DetailReport.DataSource, "TotalMoney", "{0:0,0}"); XRBinding[] listXRBindingMoney = new XRBinding[] { aXRBindingMoney }; colSumTotalMoney.DataBindings.AddRange(listXRBindingMoney); colSumTotalMoney.Summary = aXRSummaryMoney; XRSummary aXRSumDrinkMoney = new XRSummary(); aXRSumDrinkMoney.Func = SummaryFunc.Sum; aXRSumDrinkMoney.Running = SummaryRunning.Group; aXRSumDrinkMoney.IgnoreNullValues = true; aXRSumDrinkMoney.FormatString = "{0:0,0}"; XRBinding aXRBinding = new XRBinding("Text", this.DetailReport.DataSource, "DrinkMoney", "{0:0,0}"); XRBinding[] aList_aXRBinding = new XRBinding[] { aXRBinding }; colSumDrinkMoney.DataBindings.AddRange(aList_aXRBinding); colSumDrinkMoney.Summary = aXRSumDrinkMoney; //XRSummary aXRSumHallMoney = new XRSummary(); //aXRSumHallMoney.Func = SummaryFunc.Sum; //aXRSumHallMoney.Running = SummaryRunning.Group; //aXRSumHallMoney.IgnoreNullValues = true; //aXRSumHallMoney.FormatString = "{0:0,0}"; //XRBinding aXRBinding1 = new XRBinding("Text", this.DetailReport.DataSource, "Hall_Fee", "{0:0,0}"); //XRBinding[] aList_aXRBinding1 = new XRBinding[] { aXRBinding1 }; //colSumHallMoney.DataBindings.AddRange(aList_aXRBinding1); //colSumHallMoney.Summary = aXRSumHallMoney; XRSummary aXRSumMealMoney = new XRSummary(); aXRSumMealMoney.Func = SummaryFunc.Sum; aXRSumMealMoney.Running = SummaryRunning.Group; aXRSumMealMoney.IgnoreNullValues = true; aXRSumMealMoney.FormatString = "{0:0,0}"; XRBinding aXRBinding2 = new XRBinding("Text", this.DetailReport.DataSource, "MealMoney", "{0:0,0}"); XRBinding[] aList_aXRBinding2 = new XRBinding[] { aXRBinding2 }; colSumMealMoney.DataBindings.AddRange(aList_aXRBinding2); colSumMealMoney.Summary = aXRSumMealMoney; XRSummary aXRSumMoneyRoom = new XRSummary(); aXRSumMoneyRoom.Func = SummaryFunc.Sum; aXRSumMoneyRoom.Running = SummaryRunning.Group; aXRSumMoneyRoom.IgnoreNullValues = true; aXRSumMoneyRoom.FormatString = "{0:0,0}"; XRBinding aXRBinding3 = new XRBinding("Text", this.DetailReport.DataSource, "Room_Fee", "{0:0,0}"); XRBinding[] aList_aXRBinding3 = new XRBinding[] { aXRBinding3 }; colSumMoneyRoom.DataBindings.AddRange(aList_aXRBinding3); colSumMoneyRoom.Summary = aXRSumMoneyRoom; XRSummary aXRSumOtherMoney = new XRSummary(); aXRSumOtherMoney.Func = SummaryFunc.Sum; aXRSumOtherMoney.Running = SummaryRunning.Group; aXRSumOtherMoney.IgnoreNullValues = true; aXRSumOtherMoney.FormatString = "{0:0,0}"; XRBinding aXRBinding4 = new XRBinding("Text", this.DetailReport.DataSource, "OtherMoney", "{0:0,0}"); XRBinding[] aList_aXRBinding4 = new XRBinding[] { aXRBinding4 }; colSumOtherMoney.DataBindings.AddRange(aList_aXRBinding4); colSumOtherMoney.Summary = aXRSumOtherMoney; XRSummary aXRSumRoomServiceMoney = new XRSummary(); aXRSumRoomServiceMoney.Func = SummaryFunc.Sum; aXRSumRoomServiceMoney.Running = SummaryRunning.Group; aXRSumRoomServiceMoney.IgnoreNullValues = true; aXRSumRoomServiceMoney.FormatString = "{0:0,0}"; XRBinding aXRBinding5 = new XRBinding("Text", this.DetailReport.DataSource, "RoomServiceMoney", "{0:0,0}"); XRBinding[] aList_aXRBinding5 = new XRBinding[] { aXRBinding5 }; colSumRoomServiceMoney.DataBindings.AddRange(aList_aXRBinding5); colSumRoomServiceMoney.Summary = aXRSumRoomServiceMoney; }
public rp_fatura(int fatura_id) { InitializeComponent(); DataTable dt_siparis = SQL.get("SELECT s.fatura_id, s.fatura_no, s.fatura_tarihi, c.cari_adi, p.deger, c.adres, c.vergi_dairesi, c.vergi_no FROM urunler_fatura s INNER JOIN cariler c ON c.cari_id = s.cari_id INNER JOIN parametreler p ON p.parametre_id = s.fatura_tipi_parametre_id WHERE s.fatura_id = " + fatura_id); lbl_cari_adi.Text = dt_siparis.Rows[0]["cari_adi"].ToString(); lbl_siparis_tarihi.Text = dt_siparis.Rows[0]["fatura_tarihi"].ToString(); lbl_vergi_no.Text = dt_siparis.Rows[0]["deger"].ToString(); lbl_siparis_no.Text = dt_siparis.Rows[0]["fatura_no"].ToString(); lbl_adres.Text = dt_siparis.Rows[0]["adres"].ToString(); lbl_vergi_dairesi.Text = dt_siparis.Rows[0]["vergi_dairesi"].ToString(); lbl_vergi_no.Text = dt_siparis.Rows[0]["vergi_no"].ToString(); DataTable dt_siparis_kalem = SQL.get( "SELECT " + " s.siparis_id, " + " i.irsaliye_no, " + " fk.fatura_kalem_id, " + " fk.referans_irsaliye_kalem_id, " + " fk.urun_id, " + " u.urun_adi, " + " olcu_birim = p.deger, " + " fk.miktar, " + " fk.birim_fiyat, " + " fk.iskonto_1, " + " fk.iskonto_2, " + " fk.kdv, " + " toplam_tutar = fk.miktar * fk.birim_fiyat, " + " toplam_iskonto = (fk.miktar * fk.birim_fiyat) - (fk.miktar * ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) - ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) / 100 * fk.iskonto_2))), " + " toplam_net = (fk.miktar * ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) - ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) / 100 * fk.iskonto_2))), " + " toplam_kdv = (fk.miktar * ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) - ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) / 100 * fk.iskonto_2))) / 100 * fk.kdv, " + " toplam = fk.miktar * (((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) - ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) / 100 * fk.iskonto_2)) + (((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) - ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) / 100 * fk.iskonto_2)) / 100 * fk.kdv)), " + " net_birim_fiyat = (((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) - ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) / 100 * fk.iskonto_2)) + (((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) - ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) / 100 * fk.iskonto_2)) / 100 * fk.kdv)) " + "FROM " + " urunler_fatura_kalem fk " + " INNER JOIN urunler u ON u.urun_id = fk.urun_id " + " INNER JOIN parametreler p ON p.parametre_id = u.olcu_birimi_parametre_id " + " LEFT OUTER JOIN urunler_irsaliye_kalem ik ON ik.irsaliye_kalem_id = fk.referans_irsaliye_kalem_id " + " LEFT OUTER JOIN urunler_irsaliye i ON i.irsaliye_id = ik.irsaliye_id " + " LEFT OUTER JOIN urunler_siparis_kalem sk ON sk.siparis_kalem_id = ik.referans_siparis_kalem_id " + " LEFT OUTER JOIN urunler_siparis s ON s.siparis_id = sk.siparis_id " + " WHERE fk.silindi = 0 AND fk.fatura_id = " + fatura_id); this.DataSource = dt_siparis_kalem; XRBinding binding0 = new XRBinding("Text", this.DataSource, "urun_adi", ""); lbl_urun_adi.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "olcu_birim", ""); lbl_olcu_birimi.DataBindings.Add(binding1); XRBinding binding2 = new XRBinding("Text", this.DataSource, "miktar", "{0:n0}"); lbl_miktar.DataBindings.Add(binding2); XRBinding binding3 = new XRBinding("Text", this.DataSource, "birim_fiyat", "{0:n2}"); lbl_birim_fiyat.DataBindings.Add(binding3); XRBinding binding4 = new XRBinding("Text", this.DataSource, "iskonto_1", "- %{0:n0}"); lbl_iskonto_1.DataBindings.Add(binding4); XRBinding binding5 = new XRBinding("Text", this.DataSource, "iskonto_2", "- %{0:n0}"); lbl_iskonto_2.DataBindings.Add(binding5); XRBinding binding6 = new XRBinding("Text", this.DataSource, "kdv", "+ %{0:n0}"); lbl_kdv.DataBindings.Add(binding6); XRBinding binding7 = new XRBinding("Text", this.DataSource, "net_birim_fiyat", "{0:n2}"); lbl_net_birim_fiyat.DataBindings.Add(binding7); XRBinding binding8 = new XRBinding("Text", this.DataSource, "toplam", "{0:n2}"); lbl_net_toplam.DataBindings.Add(binding8); XRBinding binding10 = new XRBinding("Text", this.DataSource, "toplam_tutar", "{0:n2}"); lbl_toplam_tutar.DataBindings.Add(binding10); XRSummary sum1 = new XRSummary(SummaryRunning.Report, SummaryFunc.Sum, "{0:n2}"); lbl_toplam_tutar.Summary = sum1; XRBinding binding11 = new XRBinding("Text", this.DataSource, "toplam_iskonto", "{0:n2}"); lbl_toplam_iskonto.DataBindings.Add(binding11); XRSummary sum2 = new XRSummary(SummaryRunning.Report, SummaryFunc.Sum, "{0:n2}"); lbl_toplam_iskonto.Summary = sum2; XRBinding binding12 = new XRBinding("Text", this.DataSource, "toplam_net", "{0:n2}"); lbl_net_tutar_toplam.DataBindings.Add(binding12); XRSummary sum3 = new XRSummary(SummaryRunning.Report, SummaryFunc.Sum, "{0:n2}"); lbl_net_tutar_toplam.Summary = sum3; XRBinding binding13 = new XRBinding("Text", this.DataSource, "toplam_kdv", "{0:n2}"); lbl_kdv_toplam.DataBindings.Add(binding13); XRSummary sum4 = new XRSummary(SummaryRunning.Report, SummaryFunc.Sum, "{0:n2}"); lbl_kdv_toplam.Summary = sum4; XRBinding binding14 = new XRBinding("Text", this.DataSource, "toplam", "{0:n2}"); lbl_genel_toplam.DataBindings.Add(binding14); XRSummary sum5 = new XRSummary(SummaryRunning.Report, SummaryFunc.Sum, "{0:n2}"); lbl_genel_toplam.Summary = sum5; }
public frmRpt_SplitPayment_BookingHs(NewPaymentEN aNewPaymentEN, int IndexSub) { InitializeComponent(); this.aNewPaymentEN = aNewPaymentEN; this.IndexSub = IndexSub; try { lblNumberVote.Text = Convert.ToString(this.aNewPaymentEN.IDBookingH); lblIDBookingH.Text = Convert.ToString(this.aNewPaymentEN.IDBookingH); lblNameCustomer.Text = this.aNewPaymentEN.NameCustomer; lblGroup.Text = this.aNewPaymentEN.NameCustomerGroup; lblCompany.Text = this.aNewPaymentEN.NameCompany; lblTaxNumberCode.Text = this.aNewPaymentEN.TaxNumberCodeCompany; int day = DateTime.Now.Day; int month = DateTime.Now.Month; int year = DateTime.Now.Year; lblDayMonthYear.Text = "Hà Nội, ngày " + day.ToString() + " tháng " + month.ToString() + " năm " + year.ToString(); //Lấy dữ liệu List<BookingHallUsedEN> aListBookingHallUsedEN = new List<BookingHallUsedEN>(); aListBookingHallUsedEN = this.aNewPaymentEN.aListBookingHallUsed.Where(r => r.IndexSubPayment == this.IndexSub).OrderBy(r => r.HallSku).ToList(); aListBookingHallUsedEN.Count(); aListServiceUsedHall = this.aNewPaymentEN.GetAllServiceUsedInHall().Where(r => r.IndexSubPayment == this.IndexSub).OrderBy(r => r.Sku).ToList(); //Lấy List< IDServiceGroup> List<int> aTemp1 = new List<int>(); int IDServiceGroupHall; foreach (ServiceUsedEN item in aListServiceUsedHall) { IDServiceGroupHall = new int(); IDServiceGroupHall = item.IDServiceGroup; aTemp1.Add(IDServiceGroupHall); } aListIDServicesGroupHall = aTemp1.Distinct().ToList(); ServiceGroupEN aServicesGroupHallEN; foreach (int item in aListIDServicesGroupHall) { aServicesGroupHallEN = new ServiceGroupEN(); aServicesGroupHallEN.IDServiceGroup = item; aServicesGroupHallEN.TotalMoneyBeforeTax = this.GetTotalMoneyServiceGroupHallBeforeTax(item); aServicesGroupHallEN.TotalMoneyAfterTax = this.GetTotalMoneyServiceGroupHallAfterTax(item); aServicesGroupHallEN.DisplayMoneyTax = aNewPaymentEN.GetMoneyTax(this.GetTotalMoneyServiceGroupHallBeforeTax(item), 10); aServicesGroupHallEN.ServiceGroupName = aServiceGroupsBO.Sel_ByID(item).Name; aListServicesGroupHallEN.Add(aServicesGroupHallEN); } decimal? sumMoneyHallBeforeTax = aListBookingHallUsedEN.Sum(r => r.GetMoneyHallBeforeTax()); decimal? SumMoneyTaxHall = aListBookingHallUsedEN.Sum(r => r.GetTotalMoneyHall()); decimal? sumMoneyHallAfterTax = aListBookingHallUsedEN.Sum(r => r.GetTotalMoneyHall()); decimal? sumMoneyServiceHallBeforeTax = aListServicesGroupHallEN.Sum(s => s.TotalMoneyBeforeTax); decimal? sumMoneyTaxServices = aListServicesGroupHallEN.Sum(s => s.DisplayMoneyTax); decimal? sumMoneyServiceHallAfterTax = aListServicesGroupHallEN.Sum(s => s.TotalMoneyAfterTax); //Tong tien hoa don can thanh toan decimal? beforTax = sumMoneyHallBeforeTax + sumMoneyServiceHallBeforeTax; decimal? afterTax = sumMoneyHallAfterTax + sumMoneyServiceHallAfterTax; decimal? bookingMoney = Convert.ToDecimal(this.aNewPaymentEN.BookingHMoney); //danh sach hoi truong this.DetailReportHall.DataSource = aNewPaymentEN.aListBookingHallUsed; colSkuHall.DataBindings.Add("Text", this.DetailReportHall.DataSource, "HallSku"); colCreateDate.DataBindings.Add("Text", this.DetailReportHall.DataSource, "Date", "{0:dd/MM/yyyy}"); colBookingHallCost.DataBindings.Add("Text", this.DetailReportHall.DataSource, "Cost", "{0:0,0}"); colPercentTax.DataBindings.Add("Text", this.DetailReportHall.DataSource, "DisplayMoneyTaxHall", "{0:0,0}"); colPaymentMoneyHall.DataBindings.Add("Text", this.DetailReportHall.DataSource, "MoneyHall", "{0:0,0}"); XRSummary aXRSummaryDisplayMoneyTaxHall = new XRSummary(); aXRSummaryDisplayMoneyTaxHall.Func = SummaryFunc.Sum; aXRSummaryDisplayMoneyTaxHall.Running = SummaryRunning.Group; aXRSummaryDisplayMoneyTaxHall.IgnoreNullValues = true; aXRSummaryDisplayMoneyTaxHall.FormatString = "{0:0,0}"; XRBinding aXRBindingDisplayMoneyTaxHall = new XRBinding("Text", this.DetailReportHall.DataSource, "DisplayMoneyTaxHall", "{0:0,0}"); XRBinding[] listXRBindingDisplayMoneyTaxHall = new XRBinding[] { aXRBindingDisplayMoneyTaxHall }; lblSumMoneyHallsTax.DataBindings.AddRange(listXRBindingDisplayMoneyTaxHall); lblSumMoneyHallsTax.Summary = aXRSummaryDisplayMoneyTaxHall; //danh sach dich vu su dung this.DetailReportService.DataSource = aListServicesGroupHallEN; colNamServiceHall.DataBindings.Add("Text", this.DetailReportService.DataSource, "ServiceGroupName"); colTotalMoneyServiceHallBeforeTax.DataBindings.Add("Text", this.DetailReportService.DataSource, "TotalMoneyBeforeTax", "{0:0,0}"); colPercentTaxServiceHall.DataBindings.Add("Text", this.DetailReportService.DataSource, "DisplayMoneyTax", "{0:0,0}"); colTotalMoneyServiceHallAfterTax.DataBindings.Add("Text", this.DetailReportService.DataSource, "TotalMoneyAfterTax", "{0:0,0}"); XRSummary aXRSummaryDisplayMoneyServiceHallTax = new XRSummary(); aXRSummaryDisplayMoneyServiceHallTax.Func = SummaryFunc.Sum; aXRSummaryDisplayMoneyServiceHallTax.Running = SummaryRunning.Group; aXRSummaryDisplayMoneyServiceHallTax.IgnoreNullValues = true; aXRSummaryDisplayMoneyServiceHallTax.FormatString = "{0:0,0}"; lblSumMoneyServiceHallsTax.DataBindings.AddRange(new XRBinding[] { new XRBinding("Text", this.DetailReportService.DataSource, "DisplayMoneyTax", "{0:0,0}") }); lblSumMoneyServiceHallsTax.Summary = aXRSummaryDisplayMoneyServiceHallTax; //tong tien hoi truong truoc thue lblSumMoneyHallsBeforeTax.Text = String.Format("{0:0,0}",sumMoneyHallBeforeTax); //tong tien hoi truong sau thue lblSumMoneyHallsAfterTax.Text = String.Format("{0:0,0}", sumMoneyHallAfterTax); //tong tien dich vu hoi truong truoc thue lblSumMoneyServiceHallsBeforeTax.Text = String.Format("{0:0,0}", sumMoneyServiceHallBeforeTax); //tong tien dich vu hoi truong sau thue lblSumMoneyServiceHallsAfterTax.Text = String.Format("{0:0,0}", sumMoneyServiceHallAfterTax); //tong tien thanh toan truoc thue lblTotalMoneyBeforeTax.Text = String.Format("{0:0,0}", beforTax); //tien thue lblTotalMoneyTax.Text = String.Format("{0:0,0}", sumMoneyTaxServices+SumMoneyTaxHall); //tong tien thanh toan sau thue lblTotalMoneyAfterTax.Text = String.Format("{0:0,0}", afterTax); //So tien ung truoc lblBookingMoney.Text = String.Format("{0:0,0}", bookingMoney); //so tien con lai can thanh toan lblTotalMoney.Text = String.Format("{0:0,0}", afterTax - bookingMoney); string TotalMoney_BookingHString = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Library.StringUtility.ConvertDecimalToString(Convert.ToDecimal(afterTax - bookingMoney))); lblTotalMoneyString.Text = "(" + TotalMoney_BookingHString + ")"; } catch (Exception ex) { ex.ToString(); } }
//-----------------------------------------------------------------------------------------------------------------------------------------// public RepKargoPlani(DataTable p_TableResult) { // Initialize InitializeComponent(); // DateTime txtDateTime.Text = DateTime.Now.ToString(alfaDate.DTFormat); // Version txtVersion.Text = alfaVer.GetAppVersion(); // Operator txtOperator.Text = alfaSession.FullName; // Create rowHeader DataRow rowHeader = p_TableResult.NewRow(); foreach (DataColumn col in p_TableResult.Columns) { // Assign Text rowHeader[col.ColumnName] = col.ColumnName; } // Add to Table p_TableResult.Rows.InsertAt(rowHeader, 0); //========================================== Create XRTable ========================================// int p_Padding = 10; int p_TableWidth = this.PageWidth - this.Margins.Left - this.Margins.Right - p_Padding * 2; int p_ColWidth = p_TableWidth / p_TableResult.Columns.Count; // Create Dynamic XRTable XRTable repTable = XRTable.CreateTable(new Rectangle(p_Padding, 2, p_TableWidth, 40), 1, 0); repTable.BorderWidth = 2; repTable.Width = p_TableWidth; repTable.Rows.FirstRow.Width = p_TableWidth; repTable.Font = new Font("Tahoma", 10, FontStyle.Bold); repTable.Borders = DevExpress.XtraPrinting.BorderSide.All; // Begin repTable.BeginInit(); foreach (DataColumn col in p_TableResult.Columns) { // Create Cell XRTableCell cell = new XRTableCell(); // Binding XRBinding binding = new XRBinding("Text", this.DataSource, col.ColumnName); // Cell Properties cell.TextAlignment = TextAlignment.MiddleCenter; cell.DataBindings.Add(binding); cell.Text = col.ColumnName; cell.Width = p_ColWidth; cell.Multiline = true; cell.CanShrink = false; cell.CanGrow = false; // Add Cell repTable.Rows.FirstRow.Cells.Add(cell); } // Add to Detail Detail.Controls.Add(repTable); repTable.BeforePrint += new System.Drawing.Printing.PrintEventHandler(repTable_BeforePrint); // Adjust repTable.AdjustSize(); // Begin repTable.EndInit(); //========================================== Create XRTable ========================================// }
public GroupAllocationReport1() { InitializeComponent(); string tableName = "REP2"; DataSet ds = new DataSet(); DataTable dt = new DataTable(tableName); ds.Tables.Add(dt); string queryString = "[dbo].[rep_GroupAllocationReport]"; string connectionString = ConfigurationManager.ConnectionStrings["LorealReports.Properties.Settings.LorealConnectionString"].ConnectionString; int rowsCount = -1; using (SqlConnection connection = new SqlConnection(connectionString)) { try { SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = new SqlCommand(queryString, connection); rowsCount = adapter.Fill(ds, tableName); } catch (SqlException) { } } //xrPivotGrid1.Fields.Add() XRLabel label = new XRLabel(); label.Width = 500; label.Font = new System.Drawing.Font("Verdana", 10F, FontStyle.Bold); //PageHeader.Controls.Add(label); if (rowsCount > 0) { int padding = 10; int tableWidth = this.PageWidth - this.Margins.Left - this.Margins.Right - padding * 2; XRTable dynamicTable = XRTable.CreateTable( new Rectangle(padding, // rect X 2, // rect Y tableWidth, // width 40), // height 1, // table row count 0); // table column count dynamicTable.Width = tableWidth; dynamicTable.Rows.FirstRow.Width = tableWidth; dynamicTable.Borders = DevExpress.XtraPrinting.BorderSide.All; dynamicTable.BorderWidth = 1; int i = 0; foreach (DataColumn dc in ds.Tables[tableName].Columns) { XRTableCell cell = new XRTableCell(); XRBinding binding = new XRBinding("Text", ds, ds.Tables[tableName].Columns[i].ColumnName); cell.DataBindings.Add(binding); cell.CanGrow = false; cell.Width = 100; cell.Text = dc.ColumnName; dynamicTable.Rows.FirstRow.Cells.Add(cell); i++; } dynamicTable.Font = new System.Drawing.Font("Verdana", 8F); Detail.Controls.Add(dynamicTable); label.Text = string.Format("Data table: {0}", tableName); this.DataSource = ds; this.DataMember = tableName; } else { label.Text = string.Format("There's no data to display or the table doesn't exists"); } }
public rp_cari_hesap_ekstresi(int cari_id, DateTime ilk_tarih, DateTime son_tarih) { InitializeComponent(); DataTable dt_cari = SQL.get("SELECT * FROM cariler WHERE cari_id = " + cari_id); lbl_cari_adi.Text = dt_cari.Rows[0]["cari_adi"].ToString(); lbl_siparis_tarihi.Text = ilk_tarih.ToShortDateString() + " - " + son_tarih.ToShortDateString(); DataTable dt = SQL.get( "SELECT " + " id = f.fatura_id, " + " [no] = f.fatura_no, " + " c.cari_adi, " + " tarih = f.fatura_tarihi, " + " tip = p.deger, " + " belge = 'Fatura', " + " tutar = CASE f.fatura_tipi_parametre_id WHEN 29 THEN -1 WHEN 30 THEN 1 END * (SELECT SUM(fk.miktar * (((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) - ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) / 100 * fk.iskonto_2)) + (((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) - ((fk.birim_fiyat - (fk.birim_fiyat / 100 * fk.iskonto_1)) / 100 * fk.iskonto_2)) / 100 * fk.kdv))) FROM urunler_fatura_kalem fk WHERE fk.silindi = 0 AND fk.fatura_id = f.fatura_id) " + "FROM " + " urunler_fatura f " + " INNER JOIN cariler c ON c.cari_id = f.cari_id " + " INNER JOIN parametreler p ON p.parametre_id = f.fatura_tipi_parametre_id " + "WHERE " + " f.silindi = 0 " + " AND f.cari_id = " + cari_id + " " + " AND f.fatura_tarihi BETWEEN '" + ilk_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "' AND DATEADD(DAY, 0, '" + son_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "') " + "UNION ALL " + "SELECT " + " id = t.tahsilat_id, " + " [no] = t.tahsilat_no, " + " c.cari_adi, " + " tarih = t.tahsilat_tarihi, " + " tip = p.deger, " + " belge = 'Tahsilat Fişi', " + " tutar = CASE t.tahsilat_tipi_parametre_id WHEN 37 THEN t.tutar WHEN 35 THEN t.tutar * -1 END " + "FROM " + " finans_tahsilat t " + " INNER JOIN cariler c ON c.cari_id = t.cari_id " + " INNER JOIN parametreler p ON p.parametre_id = t.tahsilat_tipi_parametre_id " + "WHERE " + " t.silindi = 0 " + " AND t.cari_id = " + cari_id + " " + " AND t.tahsilat_tarihi BETWEEN '" + ilk_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "' AND DATEADD(DAY, 0, '" + son_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "') " + "UNION ALL " + "SELECT" + " id = finans_hareket_id, " + " [no] = CAST(finans_hareket_id AS NVARCHAR), " + " c.cari_adi, " + " tarih = fh.kayit_tarihi, " + " tip = p.deger, " + " belge = 'G.Gider', " + " tutar = fh.miktar " + "FROM " + " finans_hareket fh " + " INNER JOIN cariler c ON c.cari_id = fh.referans_id " + " INNER JOIN parametreler p ON p.parametre_id = fh.hareket_tipi_parametre_id " + "WHERE " + " fh.silindi = 0 " + " AND fh.referans_id = " + cari_id + " " + " AND fh.kayit_tarihi BETWEEN '" + ilk_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "' AND DATEADD(DAY, 0, '" + son_tarih.ToString("yyyy-MM-dd HH:mm:ss.fff") + "')"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "tarih", ""); xrTableCell4.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "no", ""); xrTableCell5.DataBindings.Add(binding1); XRBinding binding2 = new XRBinding("Text", this.DataSource, "belge", ""); xrTableCell6.DataBindings.Add(binding2); XRBinding binding3 = new XRBinding("Text", this.DataSource, "tip", ""); xrTableCell7.DataBindings.Add(binding3); XRBinding binding4 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); xrTableCell10.DataBindings.Add(binding4); XRBinding binding5 = new XRBinding("Text", this.DataSource, "tutar", ""); xrTableCell15.DataBindings.Add(binding5); XRSummary sum1 = new XRSummary(SummaryRunning.Page, SummaryFunc.Sum, "{0:c2}"); xrTableCell15.Summary = sum1; }
public frmRpt_GroupPayment_Rs(List<RptPaymentStyle1_ForPrint> aListData,string CompanyName, string Address, string NameCustomerGroup,string InvoiceNumber , DateTime FirstDate, DateTime LastDate, decimal? BookingHMoney, decimal? BookingRMoney, int IDBookingR) { InitializeComponent(); this.aListData = aListData; foreach (RptPaymentStyle1_ForPrint aItem in aListData) { TotalServiceMoney = TotalServiceMoney + aItem.TotalServiceMoney; TotalMoneyBeforeTax = TotalMoneyBeforeTax + aItem.TotalMoney; aItem.Room_Fee = aItem.Room_Fee + aItem.Hall_Fee; // Gộp 2 cột } //Truyền dữ liệu cho Detail lblCompanyName.Text = CompanyName; lblAddress.Text = Address; lblCustomerGroupName.Text = NameCustomerGroup; lblCheckIn.Text = FirstDate.ToString("dd-MM-yyyy"); lblCheckOut.Text = LastDate.ToString("dd-MM-yyyy"); BookingRs aBookingRs = new BookingRs(); aBookingRs = (new BookingRsBO()).Select_ByID(IDBookingR); lblIDBookingR.Text = IDBookingR.ToString(); lblInvoiceNumber.Text = aBookingRs.InvoiceNumber; lblInvoiceDate.Text = aBookingRs.InvoiceDate.GetValueOrDefault().Date.ToShortDateString(); lbAcceptDate.Text = aBookingRs.AcceptDate.GetValueOrDefault().Date.ToShortDateString(); this.DetailReport.DataSource = this.aListData; colDate.DataBindings.Add("Text", this.DetailReport.DataSource, "Date", "{0:dd-MM}"); colDescription.DataBindings.Add("Text", this.DetailReport.DataSource, "Note"); colNumberCus.DataBindings.Add("Text", this.DetailReport.DataSource, "CountCustomerInGroup"); colMoneyRoom.DataBindings.Add("Text", this.DetailReport.DataSource, "Room_Fee", "{0:0,0}"); colTotalARoom.DataBindings.Add("Text", this.DetailReport.DataSource, "TotalMoney", "{0:0,0}"); // colHallMoney.DataBindings.Add("Text", this.DetailReport.DataSource, "Hall_Fee", "{0:0,0}"); colMealMoney.DataBindings.Add("Text", this.DetailReport.DataSource, "MealMoney", "{0:0,0}"); colDrinkMoney.DataBindings.Add("Text", this.DetailReport.DataSource, "DrinkMoney", "{0:0,0}"); colRoomServiceMoney.DataBindings.Add("Text", this.DetailReport.DataSource, "RoomServiceMoney", "{0:0,0}"); colOtherMoney.DataBindings.Add("Text", this.DetailReport.DataSource, "OtherMoney", "{0:0,0}"); colMoneyService.Text = TotalServiceMoney.ToString("0,0"); colMoneyBeforeTax.Text = TotalMoneyBeforeTax.ToString("0,0"); colMoneyTax.Text = (TotalMoneyBeforeTax * 10 / 100).ToString("0,0"); colMoneyAfterTax.Text = (TotalMoneyBeforeTax * 110 / 100).ToString("0,0"); colBookingMoney.Text = Convert.ToDecimal(BookingHMoney + BookingHMoney).ToString("0,0"); colTotalMoneyPay.Text = ((TotalMoneyBeforeTax * 110 / 100) - Convert.ToDecimal(BookingHMoney + BookingHMoney)).ToString("0,0"); string TotalMoney_String = UppercaseFirst(StringUtility.ConvertDecimalToString((TotalMoneyBeforeTax * 110 / 100) - Convert.ToDecimal(BookingHMoney + BookingHMoney))); lblConvertToString.Text = TotalMoney_String; int day = DateTime.Now.Day; int month = DateTime.Now.Month; int year = DateTime.Now.Year; lblDayMonthYear.Text = "Hà nội , ngày " + day.ToString() + " tháng " + month.ToString() + " năm " + year.ToString(); //--------------Tính tổng--------------------------------- XRSummary aXRSummaryMoney = new XRSummary(); aXRSummaryMoney.Func = SummaryFunc.Sum; aXRSummaryMoney.Running = SummaryRunning.Group; aXRSummaryMoney.IgnoreNullValues = true; aXRSummaryMoney.FormatString = "{0:0,0}"; XRBinding aXRBindingMoney = new XRBinding("Text", this.DetailReport.DataSource, "TotalMoney", "{0:0,0}"); XRBinding[] listXRBindingMoney = new XRBinding[] { aXRBindingMoney }; colSumTotalMoney.DataBindings.AddRange(listXRBindingMoney); colSumTotalMoney.Summary = aXRSummaryMoney; XRSummary aXRSumDrinkMoney = new XRSummary(); aXRSumDrinkMoney.Func = SummaryFunc.Sum; aXRSumDrinkMoney.Running = SummaryRunning.Group; aXRSumDrinkMoney.IgnoreNullValues = true; aXRSumDrinkMoney.FormatString = "{0:0,0}"; XRBinding aXRBinding = new XRBinding("Text", this.DetailReport.DataSource, "DrinkMoney", "{0:0,0}"); XRBinding[] aList_aXRBinding = new XRBinding[] { aXRBinding }; colSumDrinkMoney.DataBindings.AddRange(aList_aXRBinding); colSumDrinkMoney.Summary = aXRSumDrinkMoney; //XRSummary aXRSumHallMoney = new XRSummary(); //aXRSumHallMoney.Func = SummaryFunc.Sum; //aXRSumHallMoney.Running = SummaryRunning.Group; //aXRSumHallMoney.IgnoreNullValues = true; //aXRSumHallMoney.FormatString = "{0:0,0}"; //XRBinding aXRBinding1 = new XRBinding("Text", this.DetailReport.DataSource, "Hall_Fee", "{0:0,0}"); //XRBinding[] aList_aXRBinding1 = new XRBinding[] { aXRBinding1 }; //colSumHallMoney.DataBindings.AddRange(aList_aXRBinding1); //colSumHallMoney.Summary = aXRSumHallMoney; XRSummary aXRSumMealMoney = new XRSummary(); aXRSumMealMoney.Func = SummaryFunc.Sum; aXRSumMealMoney.Running = SummaryRunning.Group; aXRSumMealMoney.IgnoreNullValues = true; aXRSumMealMoney.FormatString = "{0:0,0}"; XRBinding aXRBinding2 = new XRBinding("Text", this.DetailReport.DataSource, "MealMoney", "{0:0,0}"); XRBinding[] aList_aXRBinding2 = new XRBinding[] { aXRBinding2 }; colSumMealMoney.DataBindings.AddRange(aList_aXRBinding2); colSumMealMoney.Summary = aXRSumMealMoney; XRSummary aXRSumMoneyRoom = new XRSummary(); aXRSumMoneyRoom.Func = SummaryFunc.Sum; aXRSumMoneyRoom.Running = SummaryRunning.Group; aXRSumMoneyRoom.IgnoreNullValues = true; aXRSumMoneyRoom.FormatString = "{0:0,0}"; XRBinding aXRBinding3 = new XRBinding("Text", this.DetailReport.DataSource, "Room_Fee", "{0:0,0}"); XRBinding[] aList_aXRBinding3 = new XRBinding[] { aXRBinding3 }; colSumMoneyRoom.DataBindings.AddRange(aList_aXRBinding3); colSumMoneyRoom.Summary = aXRSumMoneyRoom; XRSummary aXRSumOtherMoney = new XRSummary(); aXRSumOtherMoney.Func = SummaryFunc.Sum; aXRSumOtherMoney.Running = SummaryRunning.Group; aXRSumOtherMoney.IgnoreNullValues = true; aXRSumOtherMoney.FormatString = "{0:0,0}"; XRBinding aXRBinding4 = new XRBinding("Text", this.DetailReport.DataSource, "OtherMoney", "{0:0,0}"); XRBinding[] aList_aXRBinding4 = new XRBinding[] { aXRBinding4 }; colSumOtherMoney.DataBindings.AddRange(aList_aXRBinding4); colSumOtherMoney.Summary = aXRSumOtherMoney; XRSummary aXRSumRoomServiceMoney = new XRSummary(); aXRSumRoomServiceMoney.Func = SummaryFunc.Sum; aXRSumRoomServiceMoney.Running = SummaryRunning.Group; aXRSumRoomServiceMoney.IgnoreNullValues = true; aXRSumRoomServiceMoney.FormatString = "{0:0,0}"; XRBinding aXRBinding5 = new XRBinding("Text", this.DetailReport.DataSource, "RoomServiceMoney", "{0:0,0}"); XRBinding[] aList_aXRBinding5 = new XRBinding[] { aXRBinding5 }; colSumRoomServiceMoney.DataBindings.AddRange(aList_aXRBinding5); colSumRoomServiceMoney.Summary = aXRSumRoomServiceMoney; }
public frmRpt_Payment_BookingRsAndBookingHs(NewPaymentEN aNewPaymentEN) { InitializeComponent(); this.aNewPaymentEN = aNewPaymentEN; try { lblNumberVote.Text = Convert.ToString(this.aNewPaymentEN.IDBookingR); lblIIDBookingR.Text = Convert.ToString(this.aNewPaymentEN.IDBookingR); lblNameCustomer.Text = this.aNewPaymentEN.NameCustomer; lblGroup.Text = this.aNewPaymentEN.NameCustomerGroup; lblCompany.Text = this.aNewPaymentEN.NameCompany; lblTaxNumberCode.Text = this.aNewPaymentEN.TaxNumberCodeCompany; int day = DateTime.Now.Day; int month = DateTime.Now.Month; int year = DateTime.Now.Year; lblDayMonthYear.Text = "Hà nội , ngày " + day.ToString() + " tháng " + month.ToString() + " năm " + year.ToString(); #region Phòng aListServiceUsedRoom = this.aNewPaymentEN.GetAllServiceUsedInRoom(); //Lấy List< IDServiceGroup> List<int> aTemp = new List<int>(); int IDServiceGroup; foreach (ServiceUsedEN item in aListServiceUsedRoom) { IDServiceGroup = new int(); IDServiceGroup = item.IDServiceGroup; aTemp.Add(IDServiceGroup); } aListIDServicesGroupRoom = aTemp.Distinct().ToList(); ServiceGroupEN aServicesGroupEN; ServiceGroupsBO aServiceGroupsBO = new ServiceGroupsBO(); foreach (int item in aListIDServicesGroupRoom) { aServicesGroupEN = new ServiceGroupEN(); aServicesGroupEN.IDServiceGroup = item; aServicesGroupEN.TotalMoneyBeforeTax = this.GetTotalMoneyServiceGroupRoomBeforeTax(item); aServicesGroupEN.TotalMoneyAfterTax = this.GetTotalMoneyServiceGroupRoomAfterTax(item); aServicesGroupEN.DisplayMoneyTax = aNewPaymentEN.GetMoneyTax(this.GetTotalMoneyServiceGroupRoomBeforeTax(item), 10); aServicesGroupEN.ServiceGroupName = aServiceGroupsBO.Sel_ByID(item).Name; aListServicesGroupRoomEN.Add(aServicesGroupEN); } //danh sach phong this.DetailReport.DataSource = aNewPaymentEN.aListBookingRoomUsed; colSkuRoom.DataBindings.Add("Text", this.DetailReport.DataSource, "RoomSku"); colCheckIn.DataBindings.Add("Text", this.DetailReport.DataSource, "CheckInActual", "{0:dd-MM-yyyy HH:mm}"); colCheckOut.DataBindings.Add("Text", this.DetailReport.DataSource, "CheckOutActual", "{0:dd-MM-yyyy HH:mm}"); colBookingRoomCost.DataBindings.Add("Text", this.DetailReport.DataSource, "Cost", "{0:0,0}"); colDateInUse.DataBindings.Add("Text", this.DetailReport.DataSource, "DateUsed", "{0:0,0}"); colMoneyRoomBeforeTax.DataBindings.Add("Text", this.DetailReport.DataSource, "MoneyRoomBeforeTax", "{0:0,0}"); colPercentTaxRoom.DataBindings.Add("Text", this.DetailReport.DataSource, "DisplayMoneyTaxRoom", "{0:0,0}"); colPaymentMoneyRoom.DataBindings.Add("Text", this.DetailReport.DataSource, "MoneyRoom", "{0:0,0}"); XRSummary aXRSummaryMoneyRoomBeforeTax = new XRSummary(); aXRSummaryMoneyRoomBeforeTax.Func = SummaryFunc.Sum; aXRSummaryMoneyRoomBeforeTax.Running = SummaryRunning.Group; aXRSummaryMoneyRoomBeforeTax.IgnoreNullValues = true; aXRSummaryMoneyRoomBeforeTax.FormatString = "{0:0,0}"; XRBinding aXRBindingMoneyRoomBeforeTax = new XRBinding("Text", this.DetailReport.DataSource, "MoneyRoomBeforeTax", "{0:0,0}"); XRBinding[] listXRBindingMoneyRoomBeforeTax = new XRBinding[] { aXRBindingMoneyRoomBeforeTax }; lblSumMoneyRoomsBeforeTax.DataBindings.AddRange(listXRBindingMoneyRoomBeforeTax); lblSumMoneyRoomsBeforeTax.Summary = aXRSummaryMoneyRoomBeforeTax; XRSummary aXRSummaryDisplayMoneyTaxRoom = new XRSummary(); aXRSummaryDisplayMoneyTaxRoom.Func = SummaryFunc.Sum; aXRSummaryDisplayMoneyTaxRoom.Running = SummaryRunning.Group; aXRSummaryDisplayMoneyTaxRoom.IgnoreNullValues = true; aXRSummaryDisplayMoneyTaxRoom.FormatString = "{0:0,0}"; XRBinding aXRBindingDisplayMoneyTaxRoom = new XRBinding("Text", this.DetailReport.DataSource, "DisplayMoneyTaxRoom", "{0:0,0})"); XRBinding[] listXRBindingDisplayMoneyTaxRoom = new XRBinding[] { aXRBindingDisplayMoneyTaxRoom }; lblSumMoneyRoomTax.DataBindings.AddRange(listXRBindingDisplayMoneyTaxRoom); lblSumMoneyRoomTax.Summary = aXRSummaryDisplayMoneyTaxRoom; XRSummary aXRSummaryMoneyRoom = new XRSummary(); aXRSummaryMoneyRoom.Func = SummaryFunc.Sum; aXRSummaryMoneyRoom.Running = SummaryRunning.Group; aXRSummaryMoneyRoom.IgnoreNullValues = true; aXRSummaryMoneyRoom.FormatString = "{0:0,0}"; XRBinding aXRBindingMoneyRoom = new XRBinding("Text", this.DetailReport.DataSource, "MoneyRoom", "{0:0,0}"); XRBinding[] listXRBindingMoneyRoom = new XRBinding[] { aXRBindingMoneyRoom }; lblSumMoneyRoomsAfterTax.DataBindings.AddRange(listXRBindingMoneyRoom); lblSumMoneyRoomsAfterTax.Summary = aXRSummaryMoneyRoom; //danh sach dich vu this.DetailReport2.DataSource = aListServicesGroupRoomEN; colNamServiceRoom.DataBindings.Add("Text", this.DetailReport2.DataSource, "ServiceGroupName"); colTotalMoneyServiceRoomBeforeTax.DataBindings.Add("Text", this.DetailReport2.DataSource, "TotalMoneyBeforeTax", "{0:0,0}"); colPercentTaxServiceRoom.DataBindings.Add("Text", this.DetailReport2.DataSource, "DisplayMoneyTax", "{0:0,0}"); colTotalMoneyServiceRoomAfterTax.DataBindings.Add("Text", this.DetailReport2.DataSource, "TotalMoneyAfterTax", "{0:0,0}"); XRSummary aXRSummaryTotalMoneyBeforeTax = new XRSummary(); aXRSummaryTotalMoneyBeforeTax.Func = SummaryFunc.Sum; aXRSummaryTotalMoneyBeforeTax.Running = SummaryRunning.Group; aXRSummaryTotalMoneyBeforeTax.IgnoreNullValues = true; aXRSummaryTotalMoneyBeforeTax.FormatString = "{0:0,0}"; lblSumMoneyServiceRoomsBeforeTax.DataBindings.AddRange(new XRBinding[] { new XRBinding("Text", this.DetailReport2.DataSource, "TotalMoneyBeforeTax", "{0:0,0}") }); lblSumMoneyServiceRoomsBeforeTax.Summary = aXRSummaryTotalMoneyBeforeTax; XRSummary aXRSummaryDisplayMoneyTax = new XRSummary(); aXRSummaryDisplayMoneyTax.Func = SummaryFunc.Sum; aXRSummaryDisplayMoneyTax.Running = SummaryRunning.Group; aXRSummaryDisplayMoneyTax.IgnoreNullValues = true; aXRSummaryDisplayMoneyTax.FormatString = "{0:0,0}"; lblSumMoneyServiceRoomsTax.DataBindings.AddRange(new XRBinding[] { new XRBinding("Text", this.DetailReport2.DataSource, "DisplayMoneyTax", "{0:0,0}") }); lblSumMoneyServiceRoomsTax.Summary = aXRSummaryDisplayMoneyTax; XRSummary aXRSummaryTotalMoneyAfterTax = new XRSummary(); aXRSummaryTotalMoneyAfterTax.Func = SummaryFunc.Sum; aXRSummaryTotalMoneyAfterTax.Running = SummaryRunning.Group; aXRSummaryTotalMoneyAfterTax.IgnoreNullValues = true; aXRSummaryTotalMoneyAfterTax.FormatString = "{0:0,0}"; lblSumMoneyServiceRoomsAfterTax.DataBindings.AddRange(new XRBinding[] { new XRBinding("Text", this.DetailReport2.DataSource, "TotalMoneyAfterTax", "{0:0,0}") }); lblSumMoneyServiceRoomsAfterTax.Summary = aXRSummaryTotalMoneyAfterTax; #endregion #region Hội trường aListServiceUsedHall = this.aNewPaymentEN.GetAllServiceUsedInHall(); //Lấy List< IDServiceGroup> List<int> aTemp1 = new List<int>(); int IDServiceGroupHall; foreach (ServiceUsedEN item in aListServiceUsedHall) { IDServiceGroupHall = new int(); IDServiceGroupHall = item.IDServiceGroup; aTemp1.Add(IDServiceGroupHall); } aListIDServicesGroupHall = aTemp1.Distinct().ToList(); ServiceGroupEN aServicesGroupHallEN; foreach (int item in aListIDServicesGroupHall) { aServicesGroupHallEN = new ServiceGroupEN(); aServicesGroupHallEN.IDServiceGroup = item; aServicesGroupHallEN.TotalMoneyBeforeTax = this.GetTotalMoneyServiceGroupHallBeforeTax(item); aServicesGroupHallEN.TotalMoneyAfterTax = this.GetTotalMoneyServiceGroupHallAfterTax(item); aServicesGroupHallEN.DisplayMoneyTax = aNewPaymentEN.GetMoneyTax(this.GetTotalMoneyServiceGroupHallBeforeTax(item), 10); aServicesGroupHallEN.ServiceGroupName = aServiceGroupsBO.Sel_ByID(item).Name; aListServicesGroupHallEN.Add(aServicesGroupHallEN); } //danh sach hoi truong this.DetailReportHall.DataSource = aNewPaymentEN.aListBookingHallUsed; colSkuHall.DataBindings.Add("Text", this.DetailReportHall.DataSource, "HallSku"); colCreateDate.DataBindings.Add("Text", this.DetailReportHall.DataSource, "Date", "{0:dd/MM/yyyy}"); colBookingHallCost.DataBindings.Add("Text", this.DetailReportHall.DataSource, "Cost", "{0:0,0}"); colPercentTax.DataBindings.Add("Text", this.DetailReportHall.DataSource, "DisplayMoneyTaxHall", "{0:0,0}"); colPaymentMoneyHall.DataBindings.Add("Text", this.DetailReportHall.DataSource, "MoneyHall", "{0:0,0}"); XRSummary aXRSummaryDisplayMoneyTaxHall = new XRSummary(); aXRSummaryDisplayMoneyTaxHall.Func = SummaryFunc.Sum; aXRSummaryDisplayMoneyTaxHall.Running = SummaryRunning.Group; aXRSummaryDisplayMoneyTaxHall.IgnoreNullValues = true; aXRSummaryDisplayMoneyTaxHall.FormatString = "{0:0,0}"; XRBinding aXRBindingDisplayMoneyTaxHall = new XRBinding("Text", this.DetailReportHall.DataSource, "DisplayMoneyTaxHall", "{0:0,0}"); XRBinding[] listXRBindingDisplayMoneyTaxHall = new XRBinding[] { aXRBindingDisplayMoneyTaxHall }; lblSumMoneyHallsTax.DataBindings.AddRange(listXRBindingDisplayMoneyTaxHall); lblSumMoneyHallsTax.Summary = aXRSummaryDisplayMoneyTaxHall; //danh sach dich vu su dung this.DetailReportService.DataSource = aListServicesGroupHallEN; colNamServiceHall.DataBindings.Add("Text", this.DetailReportService.DataSource, "ServiceGroupName"); colTotalMoneyServiceHallBeforeTax.DataBindings.Add("Text", this.DetailReportService.DataSource, "TotalMoneyBeforeTax", "{0:0,0}"); colPercentTaxServiceHall.DataBindings.Add("Text", this.DetailReportService.DataSource, "DisplayMoneyTax", "{0:0,0}"); colTotalMoneyServiceHallAfterTax.DataBindings.Add("Text", this.DetailReportService.DataSource, "TotalMoneyAfterTax", "{0:0,0}"); XRSummary aXRSummaryDisplayMoneyServiceHallTax = new XRSummary(); aXRSummaryDisplayMoneyServiceHallTax.Func = SummaryFunc.Sum; aXRSummaryDisplayMoneyServiceHallTax.Running = SummaryRunning.Group; aXRSummaryDisplayMoneyServiceHallTax.IgnoreNullValues = true; aXRSummaryDisplayMoneyServiceHallTax.FormatString = "{0:0,0}"; lblSumMoneyServiceHallsTax.DataBindings.AddRange(new XRBinding[] { new XRBinding("Text", this.DetailReportService.DataSource, "DisplayMoneyTax", "{0:0,0}") }); lblSumMoneyServiceHallsTax.Summary = aXRSummaryDisplayMoneyServiceHallTax; //tong tien hoi truong truoc thue lblSumMoneyHallsBeforeTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetOnlyMoneyHallsBeforeTax())); //tong tien hoi truong sau thue lblSumMoneyHallsAfterTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetOnlyMoneyHalls())); //tong tien dich vu hoi truong truoc thue lblSumMoneyServiceHallsBeforeTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetTotalMoneyServiceUsedInHallsBeforeTax())); //tong tien dich vu hoi truong sau thue lblSumMoneyServiceHallsAfterTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetTotalMoneyServiceUsedInHalls())); //Tong tien hoa don can thanh toan decimal? beforTax = Convert.ToDecimal(this.aNewPaymentEN.GetTotalMoneyBeforeTax()); decimal? afterTax = Convert.ToDecimal(this.aNewPaymentEN.GetTotalMoney()); decimal? bookingMoney = Convert.ToDecimal(this.aNewPaymentEN.BookingHMoney) + Convert.ToDecimal(this.aNewPaymentEN.BookingRMoney); //tong tien thanh toan truoc thue lblTotalMoneyBeforeTax.Text = String.Format("{0:0,0}", beforTax); //tien thue lblTotalMoneyTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetMoneyTax(beforTax, 10))); //tong tien thanh toan sau thue lblTotalMoneyAfterTax.Text = String.Format("{0:0,0}", afterTax); //So tien ung truoc lblBookingMoney.Text = String.Format("{0:0,0}", bookingMoney); //so tien con lai can thanh toan lblTotalMoney.Text = String.Format("{0:0,0}", afterTax - bookingMoney); string TotalMoney_BookingRString = UppercaseFirst(StringUtility.ConvertDecimalToString(Convert.ToDecimal(afterTax - bookingMoney))); lblTotalMoneyString.Text = "(" + TotalMoney_BookingRString + ")"; #endregion } catch (Exception ex) { ex.ToString(); } }
public frmRpt_Payment_BookingRsUnPay(NewPaymentEN aNewPaymentEN) { InitializeComponent(); this.aNewPaymentEN = aNewPaymentEN; try { //------------- Phong ------------------------ lblNumberVote.Text = Convert.ToString(this.aNewPaymentEN.IDBookingR); lblIDBookingR.Text = Convert.ToString(this.aNewPaymentEN.IDBookingR); lblNameCustomer.Text = this.aNewPaymentEN.NameCustomer; lblGroup.Text = this.aNewPaymentEN.NameCustomerGroup; lblCompany.Text = this.aNewPaymentEN.NameCompany; lblTaxNumberCode.Text = this.aNewPaymentEN.TaxNumberCodeCompany; int day = DateTime.Now.Day; int month = DateTime.Now.Month; int year = DateTime.Now.Year; lblDayMonthYear.Text = "Hà Nội, ngày " + day.ToString() + " tháng " + month.ToString() + " năm " + year.ToString(); aListServiceUsed = this.aNewPaymentEN.GetAllServiceUsedInRoom(); //Lấy List< IDServiceGroup> List<int> aTemp = new List<int>(); int IDServiceGroup; foreach (ServiceUsedEN item in aListServiceUsed) { IDServiceGroup = new int(); IDServiceGroup = item.IDServiceGroup; aTemp.Add(IDServiceGroup); } aListIDServicesGroup = aTemp.Distinct().ToList(); ServiceGroupEN aServicesGroupEN; ServiceGroupsBO aServiceGroupsBO = new ServiceGroupsBO(); foreach (int item in aListIDServicesGroup) { aServicesGroupEN = new ServiceGroupEN(); aServicesGroupEN.IDServiceGroup = item; aServicesGroupEN.TotalMoneyBeforeTax = this.GetTotalMoneyServiceGroupBeforeTax(item); aServicesGroupEN.DisplayMoneyTax = aNewPaymentEN.GetMoneyTax(this.GetTotalMoneyServiceGroupBeforeTax(item), 10); aServicesGroupEN.TotalMoneyAfterTax = this.GetTotalMoneyServiceGroupAfterTax(item); aServicesGroupEN.ServiceGroupName = aServiceGroupsBO.Sel_ByID(item).Name; aListServicesGroupEN.Add(aServicesGroupEN); } //danh sach phong this.DetailReport.DataSource = aNewPaymentEN.aListBookingRoomUsed; colSkuRoom.DataBindings.Add("Text", this.DetailReport.DataSource, "RoomSku"); colCheckIn.DataBindings.Add("Text", this.DetailReport.DataSource, "CheckInActual", "{0:dd-MM-yyyy HH:mm}"); if (aNewPaymentEN.Status_BookingR == 8 || aNewPaymentEN.Status_BookingR == 7) { colCheckOut.DataBindings.Add("Text", this.DetailReport.DataSource, "CheckOutActual", "{0:dd-MM-yyyy HH:mm}"); } else { colCheckOut.DataBindings.Add("Text", this.DetailReport.DataSource, "CheckOutPlan", "{0:dd-MM-yyyy HH:mm}"); } colBookingRoomCost.DataBindings.Add("Text", this.DetailReport.DataSource, "Cost", "{0:0,0.##}"); colDateInUse.DataBindings.Add("Text", this.DetailReport.DataSource, "DateUsed", "{0:0,0.##}"); colMoneyRoomBeforeTax.DataBindings.Add("Text", this.DetailReport.DataSource, "MoneyRoomBeforeTax", "{0:0,0}"); colPercentTaxRoom.DataBindings.Add("Text", this.DetailReport.DataSource, "DisplayMoneyTaxRoom", "{0:0,0}"); colPaymentMoneyaRoom.DataBindings.Add("Text", this.DetailReport.DataSource, "MoneyRoom", "{0:0,0}"); ////tong tien phong truoc thue //lblSumMoneyRoomsBeforeTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetMoneyRoomsBeforeTax())); ////Tong tien thue //lblSumMoneyRoomTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetMoneyTax(this.aNewPaymentEN.GetMoneyRoomsBeforeTax(), 10))); ////tong tien phong sau thue //lblSumMoneyRoomsAfterTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetMoneyRooms())); XRSummary aXRSummaryMoneyRoomBeforeTax = new XRSummary(); aXRSummaryMoneyRoomBeforeTax.Func = SummaryFunc.Sum; aXRSummaryMoneyRoomBeforeTax.Running = SummaryRunning.Group; aXRSummaryMoneyRoomBeforeTax.IgnoreNullValues = true; aXRSummaryMoneyRoomBeforeTax.FormatString = "{0:0,0}"; XRBinding aXRBindingMoneyRoomBeforeTax = new XRBinding("Text", this.DetailReport.DataSource, "MoneyRoomBeforeTax", "{0:0,0}"); XRBinding[] listXRBindingMoneyRoomBeforeTax = new XRBinding[] { aXRBindingMoneyRoomBeforeTax }; lblSumMoneyRoomsBeforeTax.DataBindings.AddRange(listXRBindingMoneyRoomBeforeTax); lblSumMoneyRoomsBeforeTax.Summary = aXRSummaryMoneyRoomBeforeTax; XRSummary aXRSummaryDisplayMoneyTaxRoom = new XRSummary(); aXRSummaryDisplayMoneyTaxRoom.Func = SummaryFunc.Sum; aXRSummaryDisplayMoneyTaxRoom.Running = SummaryRunning.Group; aXRSummaryDisplayMoneyTaxRoom.IgnoreNullValues = true; aXRSummaryDisplayMoneyTaxRoom.FormatString = "{0:0,0}"; XRBinding aXRBindingDisplayMoneyTaxRoom = new XRBinding("Text", this.DetailReport.DataSource, "DisplayMoneyTaxRoom", "{0:0,0}"); XRBinding[] listXRBindingDisplayMoneyTaxRoom = new XRBinding[] { aXRBindingDisplayMoneyTaxRoom }; lblSumMoneyRoomTax.DataBindings.AddRange(listXRBindingDisplayMoneyTaxRoom); lblSumMoneyRoomTax.Summary = aXRSummaryDisplayMoneyTaxRoom; XRSummary aXRSummaryMoneyRoom = new XRSummary(); aXRSummaryMoneyRoom.Func = SummaryFunc.Sum; aXRSummaryMoneyRoom.Running = SummaryRunning.Group; aXRSummaryMoneyRoom.IgnoreNullValues = true; aXRSummaryMoneyRoom.FormatString = "{0:0,0}"; XRBinding aXRBindingMoneyRoom = new XRBinding("Text", this.DetailReport.DataSource, "MoneyRoom", "{0:0,0}"); XRBinding[] listXRBindingMoneyRoom = new XRBinding[] { aXRBindingMoneyRoom }; lblSumMoneyRoomsAfterTax.DataBindings.AddRange(listXRBindingMoneyRoom); lblSumMoneyRoomsAfterTax.Summary = aXRSummaryMoneyRoom; //danh sach dich vu this.DetailReport2.DataSource = aListServicesGroupEN; colNamService.DataBindings.Add("Text", this.DetailReport2.DataSource, "ServiceGroupName"); colTotalMoneyBeforeTax.DataBindings.Add("Text", this.DetailReport2.DataSource, "TotalMoneyBeforeTax", "{0:0,0}"); colPercentTaxService.DataBindings.Add("Text", this.DetailReport2.DataSource, "DisplayMoneyTax", "{0:0,0}"); colTotalMoneyServiceAfterTax.DataBindings.Add("Text", this.DetailReport2.DataSource, "TotalMoneyAfterTax", "{0:0,0}"); ////tong tien dich vu truoc thue //lblSumMoneyService_BookingRBeforeTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetTotalMoneyServiceUsedInRoomsBeforeTax())); ////Tong so tien thue //lblSumMoneyServiceTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetMoneyTax(this.aNewPaymentEN.GetTotalMoneyServiceUsedInRoomsBeforeTax(), 10))); ////tong tien dich vu sau thue //lblSumMoneyService_BookingRAfterTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetTotalMoneyServiceUsedInRooms())); XRSummary aXRSummaryTotalMoneyBeforeTax = new XRSummary(); aXRSummaryTotalMoneyBeforeTax.Func = SummaryFunc.Sum; aXRSummaryTotalMoneyBeforeTax.Running = SummaryRunning.Group; aXRSummaryTotalMoneyBeforeTax.IgnoreNullValues = true; aXRSummaryTotalMoneyBeforeTax.FormatString = "{0:0,0}"; lblSumMoneyService_BookingRBeforeTax.DataBindings.AddRange(new XRBinding[] { new XRBinding("Text", this.DetailReport2.DataSource, "TotalMoneyBeforeTax", "{0:0,0}") }); lblSumMoneyService_BookingRBeforeTax.Summary = aXRSummaryTotalMoneyBeforeTax; XRSummary aXRSummaryDisplayMoneyTax = new XRSummary(); aXRSummaryDisplayMoneyTax.Func = SummaryFunc.Sum; aXRSummaryDisplayMoneyTax.Running = SummaryRunning.Group; aXRSummaryDisplayMoneyTax.IgnoreNullValues = true; aXRSummaryDisplayMoneyTax.FormatString = "{0:0,0}"; lblSumMoneyServiceTax.DataBindings.AddRange(new XRBinding[] { new XRBinding("Text", this.DetailReport2.DataSource, "DisplayMoneyTax", "{0:0,0}") }); lblSumMoneyServiceTax.Summary = aXRSummaryDisplayMoneyTax; XRSummary aXRSummaryTotalMoneyAfterTax = new XRSummary(); aXRSummaryTotalMoneyAfterTax.Func = SummaryFunc.Sum; aXRSummaryTotalMoneyAfterTax.Running = SummaryRunning.Group; aXRSummaryTotalMoneyAfterTax.IgnoreNullValues = true; aXRSummaryTotalMoneyAfterTax.FormatString = "{0:0,0}"; lblSumMoneyService_BookingRAfterTax.DataBindings.AddRange(new XRBinding[] { new XRBinding("Text", this.DetailReport2.DataSource, "TotalMoneyAfterTax", "{0:0,0}") }); lblSumMoneyService_BookingRAfterTax.Summary = aXRSummaryTotalMoneyAfterTax; //tong tien thanh toan truoc thue lblTotalMoneyBookingRBeforeTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetTotalMoneyBeforeTax())); //tien thue lblTotalMoneyTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetMoneyTax(Convert.ToDecimal(this.aNewPaymentEN.GetMoneyRoomsBeforeTax()) + Convert.ToDecimal(this.aNewPaymentEN.GetTotalMoneyServiceUsedInRoomsBeforeTax()), 10))); //tong tien thanh toan sau thue lblTotalMoneyBookingRAfterTax.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.GetTotalMoney())); //So tien ung truoc lblBookingMoney_BookingR.Text = String.Format("{0:0,0}", Convert.ToDecimal(this.aNewPaymentEN.BookingRMoney)); //so tien con lai can thanh toan lblTotalMoney_BookingR.Text = String.Format("{0:0,0}", (Convert.ToDecimal(this.aNewPaymentEN.GetTotalMoney()) - Convert.ToDecimal(this.aNewPaymentEN.BookingRMoney))); string TotalMoney_BookingRString = UppercaseFirst(StringUtility.ConvertDecimalToString((Convert.ToDecimal(this.aNewPaymentEN.GetTotalMoney()) - Convert.ToDecimal(this.aNewPaymentEN.BookingRMoney)))); lblTotalMoney_BookingRString.Text = "(" + TotalMoney_BookingRString + ")"; } catch (Exception ex) { ex.ToString(); } }
public frmRpt_StatusInMonth_Rooms() { InitializeComponent(); ReportTaskBO aReportTaskBO = new ReportTaskBO(); List<List<RptRoomStatusEN>> aRet = new List<List<RptRoomStatusEN>>(); //DateTime dt = DateTime.Now.AddMonths(-5); XRBinding aXRBinding = new XRBinding(); aRet = aReportTaskBO.RoomsPerformanceInMonth(DateTime.Now); this.DataSource = ConvertToForShowReport(aRet); colSku.DataBindings.Add("Text", this.DataSource, "Sku"); col1.DataBindings.Add("Text", this.DataSource, "Date1"); col2.DataBindings.Add("Text", this.DataSource, "Date2"); col3.DataBindings.Add("Text", this.DataSource, "Date3"); col4.DataBindings.Add("Text", this.DataSource, "Date4"); col5.DataBindings.Add("Text", this.DataSource, "Date5"); col6.DataBindings.Add("Text", this.DataSource, "Date6"); col7.DataBindings.Add("Text", this.DataSource, "Date7"); col8.DataBindings.Add("Text", this.DataSource, "Date8"); col9.DataBindings.Add("Text", this.DataSource, "Date9"); col10.DataBindings.Add("Text", this.DataSource, "Date10"); col11.DataBindings.Add("Text", this.DataSource, "Date11"); col12.DataBindings.Add("Text", this.DataSource, "Date12"); col13.DataBindings.Add("Text", this.DataSource, "Date13"); col14.DataBindings.Add("Text", this.DataSource, "Date14"); col15.DataBindings.Add("Text", this.DataSource, "Date15"); col16.DataBindings.Add("Text", this.DataSource, "Date16"); col17.DataBindings.Add("Text", this.DataSource, "Date17"); col18.DataBindings.Add("Text", this.DataSource, "Date18"); col19.DataBindings.Add("Text", this.DataSource, "Date19"); col20.DataBindings.Add("Text", this.DataSource, "Date20"); col21.DataBindings.Add("Text", this.DataSource, "Date21"); col22.DataBindings.Add("Text", this.DataSource, "Date22"); col23.DataBindings.Add("Text", this.DataSource, "Date23"); col24.DataBindings.Add("Text", this.DataSource, "Date24"); col25.DataBindings.Add("Text", this.DataSource, "Date25"); col26.DataBindings.Add("Text", this.DataSource, "Date26"); col27.DataBindings.Add("Text", this.DataSource, "Date27"); col28.DataBindings.Add("Text", this.DataSource, "Date28"); if (aRet.Count >= 30) { col29.DataBindings.Add("Text", this.DataSource, "Date29"); col30.DataBindings.Add("Text", this.DataSource, "Date30"); } if (aRet.Count == 31) { col31.DataBindings.Add("Text", this.DataSource, "Date31"); } colTotalCustomer.DataBindings.Add("Text", this.DataSource, "TotalCustomer"); string fromDateToDate=string.Empty; if(aRet.Count == 28 ) { fromDateToDate="Từ ngày 01 đến ngày 28 tháng " + DateTime.Now.Month.ToString() + " Năm " + DateTime.Now.Year.ToString(); } else if(aRet.Count == 30) { fromDateToDate="Từ ngày 01 đến ngày 30 tháng " + DateTime.Now.Month.ToString() + " Năm " + DateTime.Now.Year.ToString(); } else { fromDateToDate="Từ ngày 01 đến ngày 31 tháng " + DateTime.Now.Month.ToString() + " Năm " + DateTime.Now.Year.ToString(); } lblFromDateToDate.Text = fromDateToDate; lblDatePrint.Text = "Ngày in:" + DateTime.Now.ToString("dd-MM-yyyy"); }