Exemple #1
0
        void PrintData()
        {
            try
            {
                dsPrint =
                    SPs.BaocaoSoluongNhanguiMau(dtpFromDate.Value, dtpToDate.Value,
                                                Utility.Int32Dbnull(cboObjectType.SelectedValue),
                                                Utility.Int32Dbnull(cboLoaiXN.SelectedValue, -1),
                                                Utility.Int32Dbnull(cboDepartment.SelectedValue, -1),
                                                Utility.Int32Dbnull(cboTrangThaiBN.SelectedValue, -1),
                                                Utility.Int32Dbnull(cboTrangthai.SelectedValue, -1),
                                                Utility.sDbnull(cboNguoiNhan.SelectedValue, "-1"),
                                                Utility.sDbnull(cboNguoiGui.SelectedValue, "-1"), Utility.Int32Dbnull(cboStatusPrint.SelectedValue, -1), Utility.Int32Dbnull(chkGionhan.Checked, -1)).GetDataSet();
                _dtPrint = dsPrint.Tables[0];

                if (_dtPrint.Rows.Count <= 0)
                {
                    Utility.ShowMsg("Không có dữ liệu theo điều kiện bạn chọn");
                    return;
                }

                using (var Scope = new TransactionScope())
                {
                    using (var dbScope = new SharedDbConnectionScope())
                    {
                        foreach (Janus.Windows.GridEX.GridEXRow gridExRow in grdList.GetCheckedRows())
                        {
                            new Update(TTestInfo.Schema).Set(TTestInfo.Columns.PrintStatus).EqualTo(
                                Utility.Int32Dbnull(1)).Where(TTestInfo.Columns.PatientId).IsEqualTo(
                                Utility.Int32Dbnull(gridExRow.Cells[TTestInfo.Columns.PatientId].Value, -1)).Execute();
                            gridExRow.BeginEdit();
                            gridExRow.Cells[TTestInfo.Columns.PrintStatus].Value = 1;
                            gridExRow.EndEdit();
                        }
                    }
                    _dtPrint.AcceptChanges();
                    Scope.Complete();
                }
                PrintView(_dtPrint);
            }
            catch (Exception)
            {
                Utility.ShowMsg("Có lỗi trong quá trình lấy thông tin báo cáo");
            }
        }
Exemple #2
0
        private void cboThongKe_Click(object sender, EventArgs e)
        {
            try
            {
                _dtPrint =
                    SPs.BaocaoSoluongNhanguiMau(dtpFromDate.Value, dtpToDate.Value, Utility.Int32Dbnull(cboObjectType.SelectedValue),
                                                Utility.Int32Dbnull(cboLoaiXN.SelectedValue, -1),
                                                Utility.Int32Dbnull(cboDepartment.SelectedValue, -1),
                                                Utility.Int32Dbnull(cboTrangThaiBN.SelectedValue, -1), Utility.Int32Dbnull(cboTrangthai.SelectedValue, -1), Utility.sDbnull(cboNguoiNhan.SelectedValue, "-1"), Utility.sDbnull(cboNguoiGui.SelectedValue, "-1"), Utility.Int32Dbnull(cboStatusPrint.SelectedValue, -1), Utility.Int32Dbnull(chkGionhan.Checked, -1)).GetDataSet().
                    Tables[0];

                grdList.DataSource = _dtPrint;
            }
            catch (Exception)
            {
                Utility.ShowMsg("Có lỗi trong quá trình lấy dữ liệu");
            }
        }