private bool Report_BuyWeightBalanceByYear(DateTime strFromDate) { try { DataTable dt = new DataTable(); DataSet ds = SQLReport.Rpt_BuyWeightBalanceByYear(strFromDate, sCustomerId); dt = ds.Tables[0]; Rpt_BuyWeightBalance report = new Rpt_BuyWeightBalance { DataSource = dt, DataMember = "Datatable1" }; report.lblSearchText.Text = strFromDate.ToString("ช่วงปี yyyy", SQLData._cultureThInfo); PrintReport(report); return(true); } catch (Exception ex) { XtraMessageBox.Show(ex.Message); return(false); } }
private bool Report_BuyweightBalanceByDate(DateTime strFromDate, DateTime strToDate) { try { DataTable dt = new DataTable(); DataSet ds = SQLReport.Rpt_BuyWeightBalanceBydate(strFromDate, strToDate, sCustomerId); dt = ds.Tables[0]; Rpt_BuyWeightBalance report = new Rpt_BuyWeightBalance { DataSource = dt, DataMember = "Datatable1" }; report.lblSearchText.Text = "ระหว่าง " + strFromDate.ToString("วันdddd ที่ dd MMMM yyyy hh:mm", SQLData._cultureThInfo) + " ถึง " + strToDate.ToString("วันdddd ที่ dd MMMM yyyy hh:mm", SQLData._cultureThInfo); PrintReport(report); return(true); } catch (Exception ex) { XtraMessageBox.Show(ex.Message); return(false); } }