private void LoadDanhSach() { try { m_dtDanhSachChoKham = SPs.QmsLaydanhsachbenhnhanchokham(PropertyLib._HISQMSProperties.MaPhongKham, globalVariables.MA_KHOA_THIEN, PropertyLib._HISQMSProperties.SoLuongHienThi).GetDataSet().Tables[ 0]; Utility.SetDataSourceForDataGridEx(grdList, m_dtDanhSachChoKham, false, true, "1=1", ""); Janus.Windows.GridEX.GridEXColumn gridExColumn = grdList.RootTable.Columns["STT"]; Utility.SetGridEXSortKey(grdList, gridExColumn, SortOrder.Ascending); if (PropertyLib._HISQMSProperties.HienThiBacSyKham) { splitContainer1.Panel2Collapsed = false; string bacsykham = string.Format("{0}", Utility.sDbnull(PropertyLib._HISQMSProperties.TenBacSyHienThi, globalVariables.gv_strTenNhanvien)); lblBacSykham.Text = bacsykham; } else { splitContainer1.Panel2Collapsed = true; } } catch (Exception ex) { Utility.ShowMsg("Lỗi:" + ex.Message); } }
private void AddGridColumn(Janus.Windows.GridEX.GridEX grid, string dataMember, bool visible, int width = 200) { Janus.Windows.GridEX.GridEXColumn c1 = new Janus.Windows.GridEX.GridEXColumn(); c1.DataMember = dataMember; grid.RootTable.Columns.Add(c1); c1.Visible = visible; c1.Width = width; c1.Key = dataMember; c1.Selectable = false; }
private void chkSoloVisibles_Click(object sender, EventArgs e) { if (chkSoloVisibles.Checked) { Janus.Windows.GridEX.GridEXColumn column = gridEX1.RootTable.Columns["Visible"]; Janus.Windows.GridEX.ConditionOperator condicion = Janus.Windows.GridEX.ConditionOperator.Equal; Janus.Windows.GridEX.GridEXFilterCondition filtro = new Janus.Windows.GridEX.GridEXFilterCondition(column, condicion, true); gridEX1.RootTable.FilterCondition = filtro; } else { gridEX1.RootTable.FilterCondition = null; } }
private void BuildUI() { tbbAnterior.Enabled = !_uiController.IsFirstTask() && !_uiController.IsFlushedState(); tbbSeparator.Enabled = !_uiController.IsFirstTask() && !_uiController.IsFlushedState(); tbbAnterior.Text = _uiController.TextoBotonAnterior; tbbSiguiente.Text = _uiController.TextoBotonSiguiente; //gridEX1.LayoutData = _uiController.Layout; gridManagerView1.Visible = false; gridManagerView1.Configure(_uiController.GetProcessName(), _uiController.GetTaskName(), "FrmComprobantesSelectN", gridEX1, "FrmComprobantesSelectN"); Janus.Windows.GridEX.GridEXColumn column = gridEX1.RootTable.Columns["Visible"]; Janus.Windows.GridEX.ConditionOperator condicion = Janus.Windows.GridEX.ConditionOperator.Equal; Janus.Windows.GridEX.GridEXFilterCondition filtro = new Janus.Windows.GridEX.GridEXFilterCondition(column, condicion, true); gridEX1.RootTable.FilterCondition = filtro; KeyPreview = true; }
public static string GetColumnFriendlyName(Janus.Windows.GridEX.GridEXColumn column) { if (column.Caption.Length == 0) { if (column.Tag != null) { return(System.Convert.ToString(column.Tag)); } else { return(column.Key); } } else { return(column.Caption); } }
private void formatGrid(GxGrid grid, DataTable tbl) { grid.VisualStyle = Janus.Windows.GridEX.VisualStyle.Office2003; grid.RootTable = new Janus.Windows.GridEX.GridEXTable(); grid.RootTable.RowHeight = 20; grid.ColumnAutoResize = false; #region Define column Dictionary <string, string> dicColumnText; Dictionary <string, int> dicColumnWidth; GetColumnInfo(out dicColumnText, out dicColumnWidth); #endregion foreach (KeyValuePair <string, string> col in dicColumnText) { Janus.Windows.GridEX.GridEXColumn column = grid.AddColumn(col.Key, Janus.Windows.GridEX.ColumnType.Text, dicColumnWidth[col.Key], Janus.Windows.GridEX.ColumnBoundMode.Bound, col.Value, Janus.Windows.GridEX.FilterEditType.Combo); } }
private void gridResultado_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e) { if (e.Row.RowType == Janus.Windows.GridEX.RowType.Record) { foreach (Janus.Windows.GridEX.GridEXFormatCondition cnd in gridResultado.RootTable.FormatConditions) { if (cnd.Value1.GetType().Name.Equals("GridEXColumn")) { Janus.Windows.GridEX.GridEXColumn col = (Janus.Windows.GridEX.GridEXColumn)cnd.Value1; decimal valor1 = (decimal)e.Row.Cells[cnd.Column.Key].Value; decimal valor2 = (decimal)e.Row.Cells[col.Key].Value; if (valor1 > valor2) { e.Row.RowStyle = cnd.FormatStyle; } } } } }
private void activityBFGridEX_MouseMove(object sender, MouseEventArgs e) { try { Janus.Windows.GridEX.GridArea hitTest = activityBFGridEX.HitTest(e.X, e.Y); int rowPos = activityBFGridEX.RowPositionFromPoint(); Janus.Windows.GridEX.GridEXRow ger = activityBFGridEX.GetRow(rowPos); Janus.Windows.GridEX.GridEXColumn gec = activityBFGridEX.ColumnFromPoint(e.X, e.Y); if (ger != null && ger.RowType == Janus.Windows.GridEX.RowType.Record && gec != null && gec.Key == "StepCode" && showTooltip) { ToolTipRow = ger; } else { ToolTipRow = null; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void BindCol() { Janus.Windows.GridEX.GridEXColumn bcol = new Janus.Windows.GridEX.GridEXColumn("Remark"); bcol.HasValueList = true; string sqlget = "select * from codedef where NameEN='EquipmentType'"; DataTable dt = new DataTable(); dt = SQLHelper.GetDataSet(sqlget); if (dt != null) { if (dt.Rows.Count > 0) { } } Janus.Windows.GridEX.GridEXValueListItemCollection vcol = new Janus.Windows.GridEX.GridEXValueListItemCollection(); vcol.PopulateValueList(dt.DefaultView, "NameCN", "NameCN"); bcol.EditType = Janus.Windows.GridEX.EditType.DropDownList; bcol.CompareTarget = Janus.Windows.GridEX.ColumnCompareTarget.Text; bcol.DefaultGroupInterval = Janus.Windows.GridEX.GroupInterval.Text; }
/// <summary> /// hàm thực hiện việc in phiếu báo cáo tổng hợp /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdInPhieuXN_Click(object sender, EventArgs e) { if (chkTachCDHA.Checked) { _dtData = BAOCAO_NGOAITRU.BaocaoDoanhthuphongkham( chkByDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"), chkByDate.Checked ? dtToDate.Value : globalVariables.SysDate, Utility.sDbnull(cboDoituongKCB.SelectedValue, -1), Utility.sDbnull(cboNhanvien.SelectedValue, -1), Utility.ByteDbnull(cboLoaidichvu.SelectedValue, 2), Utility.sDbnull(cboKhoa.SelectedValue, -1)); Utility.SetDataSourceForDataGridEx(grdChitiet, _dtData, false, true, "1=1", ""); Janus.Windows.GridEX.GridEXColumn gridExColumnTientong = grdChitiet.RootTable.Columns["TONGCONG"]; tong_tien = Utility.Int32Dbnull(grdChitiet.GetTotal(gridExColumnTientong, Janus.Windows.GridEX.AggregateFunction.Sum)); } else { _dtData = BAOCAO_NGOAITRU.BaocaoDoanhthuphongkhamTonghop( chkByDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"), chkByDate.Checked ? dtToDate.Value : globalVariables.SysDate, Utility.sDbnull(cboDoituongKCB.SelectedValue, -1), Utility.sDbnull(cboNhanvien.SelectedValue, -1), Utility.ByteDbnull(cboLoaidichvu.SelectedValue, -1), Utility.sDbnull(cboKhoa.SelectedValue, -1)); Utility.SetDataSourceForDataGridEx(grdList, _dtData, false, true, "1=1", ""); Janus.Windows.GridEX.GridEXColumn gridExColumnTientong = grdList.RootTable.Columns["TONGCONG"]; tong_tien = Utility.Int32Dbnull(grdList.GetTotal(gridExColumnTientong, Janus.Windows.GridEX.AggregateFunction.Sum)); } if (_dtData.Rows.Count <= 0) { Utility.ShowMsg("Không tìm thấy dữ liệu báo cáo theo điều kiện bạn chọn", "Thông báo", MessageBoxIcon.Information); return; } Utility.UpdateLogotoDatatable(ref _dtData); string Condition = string.Format("Từ ngày {0} đến {1} - Đối tượng : {2} - Nhân viên :{3}", dtFromDate.Text, dtToDate.Text, cboDoituongKCB.SelectedIndex >= 0 ? Utility.sDbnull(cboDoituongKCB.Text) : "Tất cả", cboNhanvien.SelectedIndex > 0 ? Utility.sDbnull(cboNhanvien.Text) : "Tất cả"); string reportcode = chkTachCDHA.Checked ? "baocao_doanhthuphongkham_chitiet" : "baocao_doanhthuphongkham_tonghop"; var crpt = Utility.GetReport(reportcode, ref tieude, ref reportname); if (crpt == null) { return; } string StaffName = globalVariables.gv_strTenNhanvien; if (string.IsNullOrEmpty(globalVariables.gv_strTenNhanvien)) { StaffName = globalVariables.UserName; } try { frmPrintPreview objForm = new frmPrintPreview(tieude, crpt, true, _dtData.Rows.Count <= 0 ? false : true); //try //{ crpt.SetDataSource(_dtData); objForm.mv_sReportFileName = Path.GetFileName(reportname); objForm.mv_sReportCode = reportcode; crpt.SetParameterValue("StaffName", StaffName); crpt.SetParameterValue("BranchName", globalVariables.Branch_Name); crpt.SetParameterValue("Address", globalVariables.Branch_Address); crpt.SetParameterValue("Phone", globalVariables.Branch_Phone); crpt.SetParameterValue("FromDateToDate", Condition); crpt.SetParameterValue("sTitleReport", tieude); crpt.SetParameterValue("sMoneybyLetter", new MoneyByLetter().sMoneyToLetter(tong_tien.ToString())); crpt.SetParameterValue("sCurrentDate", Utility.FormatDateTimeWithThanhPho(dtNgayInPhieu.Value)); crpt.SetParameterValue("BottomCondition", THU_VIEN_CHUNG.BottomCondition()); objForm.crptViewer.ReportSource = crpt; objForm.ShowDialog(); } catch (Exception exception) { } }
/// <summary> /// hàm thực hiện việc in phiếu báo cáo tổng hợp /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdInPhieuXN_Click(object sender, EventArgs e) { string kieutimkiem = "-1"; if (chktienkham.Checked == true && chktientiem.Checked == false && chktienvacxin.Checked == false) { kieutimkiem = "1"; } if (chktienkham.Checked == true && chktientiem.Checked == true && chktienvacxin.Checked == false) { kieutimkiem = "1,11"; } if (chktienkham.Checked == false && chktientiem.Checked == true && chktienvacxin.Checked == false) { kieutimkiem = "11"; } if (chktienkham.Checked == true && chktientiem.Checked == false && chktienvacxin.Checked == true) { kieutimkiem = "1,3"; } if (chktienkham.Checked == false && chktientiem.Checked == true && chktienvacxin.Checked == true) { kieutimkiem = "11,3"; } if (chkChitiet.Checked) { _dtData = BAOCAO_NGOAITRU.BaocaoThutientiemchungchitiet( chkByDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"), chkByDate.Checked ? dtToDate.Value : globalVariables.SysDate, Utility.sDbnull(cboDoituongKCB.SelectedValue, -1), Utility.sDbnull(cboNhanvien.SelectedValue, -1), Utility.sDbnull(cboLoaidichvu.SelectedValue, ""), Utility.sDbnull(thamso, ""), Utility.sDbnull(cboKhoa.SelectedValue, -1), kieutimkiem); THU_VIEN_CHUNG.CreateXML(_dtData, "baocao_thutien_tiemchung_chitiet.xml"); Utility.SetDataSourceForDataGridEx(grdChitiet, _dtData, false, true, "1=1", ""); Janus.Windows.GridEX.GridEXColumn gridExColumnTientong = grdChitiet.RootTable.Columns["Thanh_Tien"]; tong_tien = Utility.Int32Dbnull(grdChitiet.GetTotal(gridExColumnTientong, Janus.Windows.GridEX.AggregateFunction.Sum)); } else { _dtData = BAOCAO_NGOAITRU.BaocaoThutientiemchungtonghop( chkByDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"), chkByDate.Checked ? dtToDate.Value : globalVariables.SysDate, Utility.sDbnull(cboDoituongKCB.SelectedValue, -1), Utility.sDbnull(cboNhanvien.SelectedValue, -1), Utility.Int16Dbnull(cboLoaidichvu.SelectedValue, -1), Utility.sDbnull(thamso, ""), Utility.sDbnull(cboKhoa.SelectedValue, -1)); THU_VIEN_CHUNG.CreateXML(_dtData, "baocao_thutien_tiemchung_tonghop.xml"); Utility.SetDataSourceForDataGridEx(grdList, _dtData, false, true, "1=1", ""); Janus.Windows.GridEX.GridEXColumn gridExColumnTientong = grdList.RootTable.Columns["Thanh_Tien"]; tong_tien = Utility.Int32Dbnull(grdList.GetTotal(gridExColumnTientong, Janus.Windows.GridEX.AggregateFunction.Sum)); } if (_dtData.Rows.Count <= 0) { Utility.ShowMsg("Không tìm thấy dữ liệu báo cáo theo điều kiện bạn chọn", "Thông báo", MessageBoxIcon.Information); return; } if (chktienkham.Checked == false && chktientiem.Checked == false && chktienvacxin.Checked == true) { kieutimkiem = "3"; } Utility.UpdateLogotoDatatable(ref _dtData); string condition = string.Format("Từ ngày {0} đến {1} - Đối tượng : {2} - Nhân viên :{3} - Phương thức thanh toán: {4}", dtFromDate.Text, dtToDate.Text, cboDoituongKCB.SelectedIndex >= 0 ? Utility.sDbnull(cboDoituongKCB.Text) : "Tất cả", cboNhanvien.SelectedIndex > 0 ? Utility.sDbnull(cboNhanvien.Text) : "Tất cả", cboLoaidichvu.SelectedIndex > 0 ?Utility.sDbnull(cboLoaidichvu.Text):"Tất cả"); var crpt = Utility.GetReport(chkChitiet.Checked ? "baocao_thutien_tiemchung_chitiet" : "baocao_thutien_tiemchung_tonghop", ref tieude, ref reportname); if (crpt == null) { return; } string staffName = globalVariables.gv_strTenNhanvien; if (string.IsNullOrEmpty(globalVariables.gv_strTenNhanvien)) { staffName = globalVariables.UserName; } try { frmPrintPreview objForm = new frmPrintPreview(tieude, crpt, true, _dtData.Rows.Count <= 0 ? false : true); //try //{ crpt.SetDataSource(_dtData); objForm.mv_sReportFileName = Path.GetFileName(reportname); objForm.mv_sReportCode = chkChitiet.Checked ? "baocao_thutien_tiemchung_chitiet" : "baocao_thutien_tiemchung_tonghop"; crpt.SetParameterValue("StaffName", staffName); crpt.SetParameterValue("BranchName", globalVariables.Branch_Name); crpt.SetParameterValue("Address", globalVariables.Branch_Address); crpt.SetParameterValue("Phone", globalVariables.Branch_Phone); crpt.SetParameterValue("FromDateToDate", condition); crpt.SetParameterValue("sTitleReport", tieude); crpt.SetParameterValue("sCurrentDate", Utility.FormatDateTimeWithThanhPho(dtNgayInPhieu.Value)); crpt.SetParameterValue("BottomCondition", THU_VIEN_CHUNG.BottomCondition()); objForm.crptViewer.ReportSource = crpt; objForm.ShowDialog(); } catch (Exception exception) { Utility.ShowMsg("Lỗi:" + exception.Message); } }
/// <summary> /// hàm thực hiên viecj in báo cáo doanh thu tiền khám chữa bệnh viện phí /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdInPhieuXN_Click(object sender, EventArgs e) { _mabschidinh = "-1"; _idThuoc = -1; // Lấy Id Bác sỹ if (!string.IsNullOrEmpty(cboBacSyChiDinh.Text)) { var query = (from chk in cboBacSyChiDinh.CheckedValues.AsEnumerable() let x = Utility.sDbnull(chk) select x).ToArray(); if (query.Count() > 0) { _mabschidinh = string.Join(",", query); } } //Truyền dữ liệu vào datatable DataTable m_dtReport = BAOCAO_THUOC.ThuocBaocaoTinhhinhkedonthuocTheobacsy(Utility.Int32Dbnull(cboStock.SelectedValue, -1), Utility.Int32Dbnull(cboDoiTuong.SelectedValue, -1), _mabschidinh, _idThuoc, chkByDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"), chkByDate.Checked ? dtToDate.Value : globalVariables.SysDate, Utility.Int16Dbnull(cboTrangthai.SelectedValue, -1)); if (m_dtReport == null) { return; } THU_VIEN_CHUNG.CreateXML(m_dtReport, "thuoc_baocaokedon_theobacsy.xml"); //Kiểm tra dữ liệu if (m_dtReport.Rows.Count <= 0) { Utility.ShowMsg("Không tìm thấy dữ liệu cho báo cáo", "Thông báo", MessageBoxIcon.Warning); return; } //Truyền tổng tiền vào text và chuyển qua tiền bằng chữ Janus.Windows.GridEX.GridEXColumn gridExColumnTong = grdList.RootTable.Columns["thanh_tien"]; decimal tong = Utility.DecimaltoDbnull(grdList.GetTotal(gridExColumnTong, Janus.Windows.GridEX.AggregateFunction.Sum)); m_dtReport.AcceptChanges(); Utility.UpdateLogotoDatatable(ref m_dtReport); //Truyền dữ liệu vào datagrid-view Utility.SetDataSourceForDataGridEx(grdList, m_dtReport, false, true, "1=1", ""); //Lấy chuỗi condition truyền vào biến ?FromDateToDate trên crpt string Condition = string.Format("Từ ngày {0} đến {1}- Đối tượng {2} - Thuộc kho :{3} - Bác sỹ: {4}", dtFromDate.Text, dtToDate.Text, cboDoiTuong.SelectedIndex > 0 ? Utility.sDbnull(cboDoiTuong.SelectedValue) : "Tất cả", cboStock.SelectedIndex > 0 ? Utility.sDbnull(cboStock.SelectedValue) : "Tất cả", string.IsNullOrEmpty(cboBacSyChiDinh.Text) ? "Tất cả" : cboBacSyChiDinh.Text); //Lấy tên người tạo báo cáo và gọi crpt string StaffName = globalVariables.gv_strTenNhanvien; string tieude = "", reportname = ""; var crpt = Utility.GetReport("thuoc_baocaokedon_theobacsy", ref tieude, ref reportname); if (crpt == null) { return; } if (string.IsNullOrEmpty(globalVariables.gv_strTenNhanvien)) { StaffName = globalVariables.UserName; } try { frmPrintPreview objForm = new frmPrintPreview(baocaO_TIEUDE1.TIEUDE, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true); crpt.SetDataSource(m_dtReport); objForm.mv_sReportFileName = Path.GetFileName(reportname); objForm.mv_sReportCode = "thuoc_baocaokedon_theobacsy"; Utility.SetParameterValue(crpt, "StaffName", StaffName); Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name); Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address); Utility.SetParameterValue(crpt, "Phone", globalVariables.Branch_Phone); Utility.SetParameterValue(crpt, "FromDateToDate", Condition); Utility.SetParameterValue(crpt, "sTitleReport", baocaO_TIEUDE1.TIEUDE); Utility.SetParameterValue(crpt, "TienBangChu", _moneyByLetter.sMoneyToLetter(tong.ToString())); Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(dtNgayInPhieu.Value)); Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition()); Utility.SetParameterValue(crpt, "Department_Name", globalVariables.KhoaDuoc); Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, globalVariables.SysDate)); objForm.crptViewer.ReportSource = crpt; objForm.ShowDialog(); } catch (Exception exception) { } }
private bool ObtenerConfiguracionGrillaPerfiles(long IdProceso, long IdTarea, long IdPerfil, long IdConfiguracion) { bool existeConfiguracion = false; //long IdConfiguracion = long.MinValue; //tui_ConfiguracionGrillaEstiloAplicadoPerfilesDataset dataEA = tui_ConfiguracionGrillaEstiloAplicadoPerfiles.GetList(IdPerfil, IdProceso, IdTarea, _grilla.Name, _formulario, long.MinValue); //foreach(tui_ConfiguracionGrillaEstiloAplicadoPerfilesDataset.tui_ConfiguracionGrillaEstiloAplicadoPerfilesRow row in dataEA.tui_ConfiguracionGrillaEstiloAplicadoPerfiles.Rows) //{ //existeConfiguracion = true; //IdConfiguracion = row.IdConfiguracion; tui_ConfiguracionGrillaEstilosCondicionalesDetPerfilesDataset dataCondDet = businessrules.tui_ConfiguracionGrillaEstilosCondicionalesDetPerfiles.GetList(IdPerfil, IdConfiguracion); foreach (tui_ConfiguracionGrillaEstilosCondicionalesDetPerfilesDataset.tui_ConfiguracionGrillaEstilosCondicionalesDetPerfilesRow rowDet in dataCondDet.tui_ConfiguracionGrillaEstilosCondicionalesDetPerfiles.Rows) { existeConfiguracion = true; string ColumnaKey = rowDet.Columna; string Condicion = rowDet.Condicion.ToString(); long IdCondicion = rowDet.IdCondicion; Janus.Windows.GridEX.GridEXFormatStyle fs = getEstiloPerfil(IdConfiguracion, IdCondicion, IdPerfil); if (rowDet["ValorColumna"] == System.DBNull.Value || rowDet.ValorColumna.Equals(string.Empty)) //El valor de comparacion no es una colomna { Janus.Windows.GridEX.ConditionOperator condOp = new Janus.Windows.GridEX.ConditionOperator(); switch (Condicion) { case ">": condOp = Janus.Windows.GridEX.ConditionOperator.GreaterThan; break; case "<": condOp = Janus.Windows.GridEX.ConditionOperator.LessThan; break; case "=": condOp = Janus.Windows.GridEX.ConditionOperator.Equal; break; case ">=": condOp = Janus.Windows.GridEX.ConditionOperator.GreaterThanOrEqualTo; break; case "<=": condOp = Janus.Windows.GridEX.ConditionOperator.LessThanOrEqualTo; break; case "!=": condOp = Janus.Windows.GridEX.ConditionOperator.NotEqual; break; case "like": condOp = Janus.Windows.GridEX.ConditionOperator.Contains; break; } string Valor = rowDet.Valor; Janus.Windows.GridEX.GridEXFormatCondition cnd = new Janus.Windows.GridEX.GridEXFormatCondition(_grilla.RootTable.Columns[ColumnaKey], condOp, Valor); cnd.FormatStyle = fs; _grilla.RootTable.FormatConditions.Add(cnd); } else //El valor de comparacion es una colomna { string ColumnaValorKey = rowDet.ValorColumna; Janus.Windows.GridEX.GridEXColumn realColumn = _grilla.RootTable.Columns[ColumnaKey]; ConfiguracionStyleGrilla.ColumnaView colView = new ConfiguracionStyleGrilla.ColumnaView(realColumn.Caption, GridManagerView.getTypeFor(realColumn.FormatString, realColumn.ColumnType.ToString()), realColumn.Key, realColumn); Janus.Windows.GridEX.GridEXColumn valorC = _grilla.RootTable.Columns[ColumnaValorKey]; ConfiguracionStyleGrilla.MyGridEXFormatStyle mfs = new ConfiguracionStyleGrilla.MyGridEXFormatStyle(fs); ConfiguracionStyleGrilla.ConfiguracionGrillaEstilosCondicionalesDet detConf = new ConfiguracionStyleGrilla.ConfiguracionGrillaEstilosCondicionalesDet(IdCondicion, colView, Condicion, valorC, mfs, string.Empty); _configuracionDet.Add(detConf); } } //} if (existeConfiguracion) { tui_ConfiguracionGrillaEstilosCondicionalesPerfilesDataset.tui_ConfiguracionGrillaEstilosCondicionalesPerfilesRow rowC = tui_ConfiguracionGrillaEstilosCondicionalesPerfiles.GetByPk(IdPerfil, IdConfiguracion); string nombreConf = rowC.Nombre; toolTip1.SetToolTip(btnConfGrilla, nombreConf); } return(existeConfiguracion); }
private void GetData() { string ReasonBy = ""; string sAccountName = THU_VIEN_CHUNG.LayMaDviLamViec(); LayThongTinPaymentDetail(sAccountName); //grdPaymentDetail.DataSource = m_dtPaymentDetail; SqlQuery sqlQuery = new Select().From(TPhieuthu.Schema) .Where(TPhieuthu.Columns.PaymentId).IsEqualTo(Utility.Int32Dbnull(txtPayment_ID.Text)).And( TPhieuthu.Columns.LoaiPhieu).IsEqualTo(status); if (sqlQuery.GetRecordCount() <= 0) { TPayment objPayment = TPayment.FetchByID(Utility.Int32Dbnull(txtPayment_ID.Text, -1)); if (objPayment != null) { dtCreateDate.Value = Convert.ToDateTime(objPayment.PaymentDate); txtPayment_ID.Text = Utility.sDbnull(objPayment.PaymentId, "-1"); txtMA_PTHU.Text = BusinessHelper.GetMaPhieuThu(dtCreateDate.Value, 0); Janus.Windows.GridEX.GridEXColumn gridExColumn = grdPaymentDetail.RootTable.Columns["TONG"]; txtSO_TIEN.Text = Utility.sDbnull(grdPaymentDetail.GetTotal(gridExColumn, Janus.Windows.GridEX.AggregateFunction.Sum)); txtSLUONG_CTU_GOC.Text = "1"; TPatientInfo objPatientInfo = TPatientInfo.FetchByID(objPayment.PatientId); if (objPatientInfo != null) { txtNGUOI_NOP.Text = objPatientInfo.PatientName; label9.Text = "Người nhận"; } if (status == 0) { switch (sAccountName) { case "YHOCHAIQUAN": ReasonBy = BusinessHelper.GetLyDo_PhieuThu(m_dtPaymentDetail); txtLDO_NOP.Text = ReasonBy; break; case "KYDONG": ReasonBy = BusinessHelper.GetLyDo_PhieuThu(m_dtPaymentDetail); txtLDO_NOP.Text = ReasonBy; break; case "DETMAY": LObjectType objectType = LObjectType.FetchByID(v_ObjectType_Id); if (objectType.ObjectTypeType == 0) { txtLDO_NOP.Text = string.Format("Bệnh nhân cùng chi trả :{0} %", (100 - v_DiscountRate)); } else { ReasonBy = BusinessHelper.GetLyDo_PhieuThu(m_dtPaymentDetail); txtLDO_NOP.Text = ReasonBy; } break; default: ReasonBy = BusinessHelper.GetLyDo_PhieuThu(m_dtPaymentDetail); txtLDO_NOP.Text = ReasonBy; break; } } if (status == 1) { ReasonBy = "Trả lại tiền cho bệnh nhân"; txtLDO_NOP.Text = ReasonBy; } } } else { var objPhieuthu = sqlQuery.ExecuteSingle <TPhieuthu>(); if (objPhieuthu != null) { txtSLUONG_CTU_GOC.Text = Utility.sDbnull(objPhieuthu.SluongCtuGoc, 1); txtMA_PTHU.Text = Utility.sDbnull(objPhieuthu.MaPthu, ""); txtNGUOI_NOP.Text = Utility.sDbnull(objPhieuthu.NguoiNop); txtSO_TIEN.Text = Utility.sDbnull(objPhieuthu.SoTien); txtTKHOAN_CO.Text = Utility.sDbnull(objPhieuthu.TkhoanCo, ""); txtTKHOAN_NO.Text = Utility.sDbnull(objPhieuthu.TkhoanNo, ""); txtLDO_NOP.Text = objPhieuthu.LdoNop; dtCreateDate.Value = Convert.ToDateTime(objPhieuthu.NgayThien); } } }
/// <summary> /// hàm thực hiện việc in phiếu xét nghiêm /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdPrint_Click(object sender, EventArgs e) { try { string nhomdichvu = "-1"; if (!string.IsNullOrEmpty(cboNhomdichvuCLS.Text) && cboNhomdichvuCLS.CheckedValues != null) { var query = (from chk in cboNhomdichvuCLS.CheckedValues.AsEnumerable() let x = Utility.sDbnull(chk) select x).ToArray(); if (query.Count() > 0) { nhomdichvu = string.Join(",", query); } } if (chkChitiet.Checked) { _reportTable = BAOCAO_NGOAITRU.BaocaoThutientheokhoaChitiet(Utility.sDbnull(cboPhong.SelectedValue, -1), chkByDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"), chkByDate.Checked ? dtToDate.Value : globalVariables.SysDate, Utility.sDbnull(cboDoituongKCB.SelectedValue, -1), nhomdichvu, Utility.sDbnull(cbonhanvien.SelectedValue, -1), Utility.sDbnull(cbokhoa.SelectedValue, -1)); Utility.SetDataSourceForDataGridEx(grdChitiet, _reportTable, false, true, "1=1", ""); Janus.Windows.GridEX.GridEXColumn gridExColumnTientong = grdChitiet.RootTable.Columns["Thanh_Tien"]; tong_tien = Utility.Int32Dbnull(grdChitiet.GetTotal(gridExColumnTientong, Janus.Windows.GridEX.AggregateFunction.Sum)); } else { _reportTable = BAOCAO_NGOAITRU.BaocaoThutientheokhoaTonghop(Utility.sDbnull(cboPhong.SelectedValue, -1), chkByDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"), chkByDate.Checked ? dtToDate.Value : globalVariables.SysDate, Utility.sDbnull(cboDoituongKCB.SelectedValue, -1), nhomdichvu, Utility.sDbnull(cbonhanvien.SelectedValue, -1), Utility.sDbnull(cbokhoa.SelectedValue, -1)); Utility.SetDataSourceForDataGridEx(grdList, _reportTable, false, true, "1=1", ""); Janus.Windows.GridEX.GridEXColumn gridExColumnTientong = grdList.RootTable.Columns["Thanh_Tien"]; tong_tien = Utility.Int32Dbnull(grdList.GetTotal(gridExColumnTientong, Janus.Windows.GridEX.AggregateFunction.Sum)); } if (_reportTable.Rows.Count <= 0) { Utility.ShowMsg("Không tìm thấy dữ liệu cho báo cáo", "Thông báo", MessageBoxIcon.Warning); return; } string StaffName = globalVariables.gv_strTenNhanvien; if (string.IsNullOrEmpty(globalVariables.gv_strTenNhanvien)) { StaffName = globalVariables.UserName; } string Condition = string.Format("Từ ngày {0} đến {1} - Đối tượng : {2} - Nhân viên :{3} - Khoa chỉ định :{4} - Phòng thực hiện :{5} - Nhóm dịch vụ: {6}", dtFromDate.Text, dtToDate.Text, cboDoituongKCB.SelectedIndex > 0 ? Utility.sDbnull(cboDoituongKCB.Text) : "Tất cả", cbonhanvien.SelectedIndex > 0 ? Utility.sDbnull(cbonhanvien.Text) : "Tất cả", cbokhoa.SelectedIndex > 0 ? Utility.sDbnull(cbokhoa.Text) : "Tất cả", cboPhong.SelectedIndex > 0 ? Utility.sDbnull(cboPhong.Text) : "Tất cả", cboNhomdichvuCLS.CheckedValues != null ? Utility.sDbnull(cboNhomdichvuCLS.Text) : "Tất cả"); Utility.UpdateLogotoDatatable(ref _reportTable); string reportCode = chkChitiet.Checked ? "baocao_thutientheokhoa_chitiet" : "baocao_thutientheokhoa_tonghop"; var crpt = Utility.GetReport(reportCode, ref tieude, ref reportname); if (crpt == null) { return; } frmPrintPreview objForm = new frmPrintPreview(tieude, crpt, true, _reportTable.Rows.Count <= 0 ? false : true); crpt.SetDataSource(_reportTable); objForm.mv_sReportFileName = Path.GetFileName(reportname); objForm.mv_sReportCode = reportCode; Utility.SetParameterValue(crpt, "StaffName", StaffName); Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name); Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address); Utility.SetParameterValue(crpt, "Phone", globalVariables.Branch_Phone); Utility.SetParameterValue(crpt, "FromDateToDate", Condition); Utility.SetParameterValue(crpt, "sTitleReport", tieude); Utility.SetParameterValue(crpt, "Tongtien_chu", new MoneyByLetter().sMoneyToLetter(tong_tien.ToString())); Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(dtNgayInPhieu.Value)); Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition()); objForm.crptViewer.ReportSource = crpt; objForm.ShowDialog(); } catch (Exception ex) { Utility.CatchException("Lỗi khi in báo cáo", ex); } }
/// <summary> /// hàm thực hiên viecj in báo cáo doanh thu tiền khám chữa bệnh viện phí /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmdInPhieuXN_Click(object sender, EventArgs e) { DataTable m_dtReport = BAOCAO_THUOC.ThuocBaocaoTinhhinhBenhnhanlinhthuoc( chkByDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"), chkByDate.Checked ? dtToDate.Value : globalVariables.SysDate, Utility.Int32Dbnull(cboStock.SelectedValue, -1), Utility.Int32Dbnull(cboDoiTuong.SelectedValue, "-1")); Utility.SetDataSourceForDataGridEx(grdList, m_dtReport, false, true, "1=1", ""); Janus.Windows.GridEX.GridEXColumn gridExColumn = grdList.RootTable.Columns["THANH_TIEN"]; decimal tonghuy = Utility.DecimaltoDbnull(grdList.GetTotal(gridExColumn, Janus.Windows.GridEX.AggregateFunction.Sum)); THU_VIEN_CHUNG.CreateXML(m_dtReport, "thuoc_baocao_danhsachBenhnhan_linhthuoc"); if (m_dtReport.Rows.Count <= 0) { Utility.ShowMsg("Không tìm thấy dữ liệu cho báo cáo", "Thông báo", MessageBoxIcon.Warning); return; } Utility.AddColumToDataTable(ref m_dtReport, "STT", typeof(Int32)); int idx = 1; foreach (DataRow drv in m_dtReport.Rows) { drv["STT"] = idx; idx++; } m_dtReport.AcceptChanges(); Utility.UpdateLogotoDatatable(ref m_dtReport); string Condition = string.Format("Từ ngày {0} đến {1}- Đối tượng {2} - Thuộc kho :{3}", dtFromDate.Text, dtToDate.Text, cboDoiTuong.SelectedIndex > 0 ? Utility.sDbnull(cboDoiTuong.Text) : "Tất cả", cboStock.SelectedIndex > 0 ? Utility.sDbnull(cboStock.Text) : "Tất cả"); // Utility.AddColumToDataTable(ref m_dtReport, "SO_PHIEU_BARCODE", typeof(byte[])); // byte[] arrBarCode = Utility.GenerateBarCode(barcode); string StaffName = globalVariables.gv_strTenNhanvien; if (string.IsNullOrEmpty(globalVariables.gv_strTenNhanvien)) { StaffName = globalVariables.UserName; } try { string tieude = "", reportname = ""; string reportCode = kieuthuoc_vt == "THUOC" ? "thuoc_baocao_danhsachBenhnhan_linhthuoc" : "vt_baocao_danhsachBenhnhan_linhvt"; ReportDocument crpt = Utility.GetReport(reportCode, ref tieude, ref reportname); if (crpt == null) { return; } frmPrintPreview objForm = new frmPrintPreview(baocaO_TIEUDE1.TIEUDE, crpt, true, m_dtReport.Rows.Count <= 0 ? false : true); //try //{ crpt.SetDataSource(m_dtReport); objForm.mv_sReportFileName = Path.GetFileName(reportname); objForm.mv_sReportCode = reportCode; //crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34); // Utility.SetParameterValue(crpt,"ParentBranchName", globalVariables.ParentBranch_Name); Utility.SetParameterValue(crpt, "StaffName", StaffName); Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name); Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address); Utility.SetParameterValue(crpt, "Phone", globalVariables.Branch_Phone); Utility.SetParameterValue(crpt, "FromDateToDate", Condition); Utility.SetParameterValue(crpt, "sTitleReport", baocaO_TIEUDE1.TIEUDE); Utility.SetParameterValue(crpt, "sCurrentDate", Utility.FormatDateTimeWithThanhPho(dtNgayInPhieu.Value)); Utility.SetParameterValue(crpt, "BottomCondition", THU_VIEN_CHUNG.BottomCondition()); Utility.SetParameterValue(crpt, "Deparment_Name", globalVariables.KhoaDuoc); Utility.SetParameterValue(crpt, "txtTrinhky", Utility.getTrinhky(objForm.mv_sReportFileName, globalVariables.SysDate)); objForm.crptViewer.ReportSource = crpt; objForm.ShowDialog(); } catch (Exception exception) { } }
private void _grilla_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e) { Janus.Windows.GridEX.GridEXRow row = e.Row; if (row.RowType == Janus.Windows.GridEX.RowType.Record) { foreach (ConfiguracionStyleGrilla.ConfiguracionGrillaEstilosCondicionalesDet conf in _configuracionDet) { string key = conf.Columna.Name; string cond = conf.Condicion; Janus.Windows.GridEX.GridEXCell cell1 = row.Cells[key]; Janus.Windows.GridEX.GridEXColumn col2 = (Janus.Windows.GridEX.GridEXColumn)conf.Valor; Janus.Windows.GridEX.GridEXCell cell2 = row.Cells[col2.Key]; object valorCol1 = cell1.Value; object valorCol2 = cell2.Value; bool satisfaceCondicion = false; string type = conf.Columna.Type; switch (cond) { case ">": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D > val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I > val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT > val2DT; break; } break; } case "<": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D < val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I < val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT < val2DT; break; } break; } case "=": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D == val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I == val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT == val2DT; break; case "STRING": string val1S = (string)valorCol1; string val2S = (string)valorCol2; satisfaceCondicion = val1S == val2S; break; case "BOOL": bool val1B = (bool)valorCol1; bool val2B = (bool)valorCol2; satisfaceCondicion = val1B == val2B; break; } break; } case ">=": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D >= val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I >= val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT >= val2DT; break; } break; } case "<=": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D <= val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I <= val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT <= val2DT; break; } break; } case "!=": { switch (type) { case "DECIMAL": decimal val1D = (decimal)valorCol1; decimal val2D = (decimal)valorCol2; satisfaceCondicion = val1D != val2D; break; case "INT": int val1I = (int)valorCol1; int val2I = (int)valorCol2; satisfaceCondicion = val1I != val2I; break; case "DATETIME": DateTime val1DT = (DateTime)valorCol1; DateTime val2DT = (DateTime)valorCol2; satisfaceCondicion = val1DT != val2DT; break; case "STRING": string val1S = (string)valorCol1; string val2S = (string)valorCol2; satisfaceCondicion = val1S != val2S; break; case "BOOL": bool val1B = (bool)valorCol1; bool val2B = (bool)valorCol2; satisfaceCondicion = val1B != val2B; break; } break; } case "like": { switch (type) { case "STRING": string val1D = (string)valorCol1; string val2D = (string)valorCol2; satisfaceCondicion = val1D.IndexOf(val2D) != -1; break; } break; } } if (satisfaceCondicion) { Janus.Windows.GridEX.GridEXFormatStyle fs = conf.Estilo.ToFormatStyle(); row.RowStyle = fs; } } } }