Exemple #1
0
 void frm_themmoi_phieuthanhlythuoc_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         cmdExit_Click(cmdExit, new EventArgs());
     }
     if (e.Control && e.KeyCode == Keys.S)
     {
         cmdSave_Click(cmdSave, new EventArgs());
     }
     if (e.KeyCode == Keys.F2)
     {
         grdKhoXuat.Focus();
         grdKhoXuat.MoveFirst();
         Janus.Windows.GridEX.GridEXColumn gridExColumn = grdKhoXuat.RootTable.Columns["SO_LUONG_CHUYEN"];
         grdKhoXuat.Col = gridExColumn.Position;
     }
     if (e.KeyCode == Keys.Enter)
     {
         if (this.ActiveControl.Name == txtHoidong.Name)
         {
             return;
         }
         else
         {
             SendKeys.Send("{TAB}");
         }
     }
     if (e.Control && e.Alt && e.Shift && e.KeyCode == Keys.Z)
     {
         Test();
     }
 }
 private void UpdateSumOfChiDinh()
 {
     Janus.Windows.GridEX.GridEXColumn gridExColumn       = grdDetail.RootTable.Columns["TT"];
     Janus.Windows.GridEX.GridEXColumn gridExColumnPhuThu = grdDetail.RootTable.Columns[KcbChidinhclsChitiet.Columns.PhuThu];
     decimal Thanhtien = Utility.DecimaltoDbnull(grdDetail.GetTotal(gridExColumn, AggregateFunction.Sum));
     decimal phuthu    = Utility.DecimaltoDbnull(grdDetail.GetTotal(gridExColumnPhuThu, AggregateFunction.Sum));
 }
Exemple #3
0
 void frm_themmoi_PhieutrathuocNhacungcap_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SendKeys.Send("{TAB}");
     }
     if (e.KeyCode == Keys.Escape)
     {
         cmdExit_Click(cmdExit, new EventArgs());
     }
     if (e.Control && e.KeyCode == Keys.S)
     {
         cmdSave_Click(cmdSave, new EventArgs());
     }
     if (e.KeyCode == Keys.F2)
     {
         grdKhoXuat.Focus();
         grdKhoXuat.MoveFirst();
         Janus.Windows.GridEX.GridEXColumn gridExColumn = grdKhoXuat.RootTable.Columns["SO_LUONG_CHUYEN"];
         grdKhoXuat.Col = gridExColumn.Position;
     }
     if (e.Control && e.Alt && e.Shift && e.KeyCode == Keys.Z)
     {
         Test();
     }
 }
Exemple #4
0
 void grdKhoXuat_KeyDown(object sender, KeyEventArgs e)
 {
     Janus.Windows.GridEX.GridEXColumn gridExColumn = grdKhoXuat.RootTable.Columns["SO_LUONG_CHUYEN"];
     if (e.Control && e.KeyCode == Keys.Enter)// && Utility.Int32Dbnull(grdKhoXuat.GetValue(gridExColumn.Key), 0) > 0 && grdKhoXuat.CurrentColumn.Position == gridExColumn.Position)
     {
         grdKhoXuat.Focus();
         cmdNext_Click(cmdNext, new EventArgs());
     }
 }
 /// <summary>
 /// hàm thực hiện việc phím tắt của lọc thông tin
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void txtFilterName_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.PageDown)
     {
         grdKhoXuat.Focus();
         grdKhoXuat.MoveFirst();
         Janus.Windows.GridEX.GridEXColumn gridExColumn = grdKhoXuat.RootTable.Columns["SO_LUONG_CHUYEN"];
         grdKhoXuat.Col = gridExColumn.Position;
     }
 }
Exemple #6
0
        private void getData()
        {
            m_dtChiDinhCLS = null;
            //SPs.ClsLaokhoaInphieuChidinhCls(objAssignInfo.AssignCode, Utility.sDbnull(objAssignInfo.PatientCode),
            //                                Utility.Int32Dbnull(objAssignInfo.PatientId,-1)).GetDataSet().Tables[0];
            Utility.AddColumToDataTable(ref m_dtChiDinhCLS, "STT", typeof(Int32));
            Int32 idx = 1;

            foreach (DataRow drv in m_dtChiDinhCLS.Rows)
            {
                drv["STT"] = idx;
                idx++;
            }
            m_dtChiDinhCLS.AcceptChanges();
            Utility.SetDataSourceForDataGridEx(grdAssignInfo, m_dtChiDinhCLS, false, true, "1=1", "");

            try
            {
                grdAssignInfo.RootTable.SortKeys.Clear();
                Janus.Windows.GridEX.GridEXColumn  gridExColumnGroup  = grdAssignInfo.RootTable.Columns["IntOrderGroup"];
                Janus.Windows.GridEX.GridEXColumn  gridExColumn       = grdAssignInfo.RootTable.Columns["IntOrder"];
                Janus.Windows.GridEX.GridEXSortKey gridExSortKeyGroup = new GridEXSortKey(gridExColumnGroup, Janus.Windows.GridEX.SortOrder.Ascending);
                Janus.Windows.GridEX.GridEXSortKey gridExSortKey      = new GridEXSortKey(gridExColumn, Janus.Windows.GridEX.SortOrder.Ascending);
                grdAssignInfo.RootTable.SortKeys.Add(gridExSortKeyGroup);
                grdAssignInfo.RootTable.SortKeys.Add(gridExSortKey);
                grdAssignInfo.CheckAllRecords();
            }
            catch (Exception exception)
            {
                if (globalVariables.IsAdmin)
                {
                    Utility.ShowMsg(exception.ToString());
                }
            }
            ModifyCommand();
        }
Exemple #7
0
 void frm_Themmoi_PhieuTrathuocThua_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         cmdExit_Click(cmdExit, new EventArgs());
     }
     if (e.Control && e.KeyCode == Keys.S)
     {
         cmdSave_Click(cmdSave, new EventArgs());
     }
     if (e.KeyCode == Keys.F2)
     {
         grdKhoXuat.Focus();
         grdKhoXuat.MoveFirst();
         Janus.Windows.GridEX.GridEXColumn gridExColumn = grdKhoXuat.RootTable.Columns["SO_LUONG_CHUYEN"];
         grdKhoXuat.Col = gridExColumn.Position;
     }
     if (e.KeyCode == Keys.Enter)
     {
         SendKeys.Send("{TAB}");
     }
     //if (e.Control && e.Alt && e.Shift && e.KeyCode == Keys.Z) Test();
     if (e.Control && e.Alt && e.Shift && e.KeyCode == Keys.H)
     {
         if (panel2.Height == 0)
         {
             uiGroupBox1.Height = 148;
             panel2.Height      = 54;
         }
         else
         {
             uiGroupBox1.Height = 0;
             panel2.Height      = 0;
         }
     }
 }
Exemple #8
0
        /// <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
            {
                if (!isValidData())
                {
                    return;
                }
                _reportTable =
                    BAOCAO_NGOAITRU.BaocaoDanhsachhoadonThuphi(chkByDate.Checked ? dtFromDate.Value : Convert.ToDateTime("01/01/1900"),
                                                               chkByDate.Checked ? dtToDate.Value : globalVariables.SysDate, chkLoaitimkiem.Checked ? 1 : 0,
                                                               Utility.sDbnull(cboDoituongKCB.SelectedValue, -1),
                                                               Utility.sDbnull(cbonhanvien.SelectedValue, -1),
                                                               Utility.Int32Dbnull(cboNTNT.SelectedValue, -1),
                                                               Utility.Int32Dbnull(cboHoadon.SelectedValue, -1), chkMaQuyen.Checked? Utility.sDbnull(cboQuyen.SelectedValue, "-1"):"-1",
                                                               Utility.Int32Dbnull(Utility.DecimaltoDbnull(txtfromSerie.Text)), Utility.Int32Dbnull(Utility.DecimaltoDbnull(txtToserie.Text)),
                                                               Utility.sDbnull(cbokhoa.SelectedValue, -1));

                Utility.SetDataSourceForDataGridEx(grdList, _reportTable, false, true, "1=1", "");
                Janus.Windows.GridEX.GridEXColumn gridExColumnTientong = grdList.RootTable.Columns["tong_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} -TNV :{3} - Loại điều trị :{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ả", cboNTNT.SelectedIndex > 0 ? Utility.sDbnull(cboNTNT.Text) : "Tất cả");
                Utility.UpdateLogotoDatatable(ref _reportTable);

                var crpt = Utility.GetReport("baocao_danhsachhoadonthuphi", 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     = "baocao_danhsachhoadonthuphi";
                Utility.SetParameterValue(crpt, "StaffName", StaffName);
                Utility.SetParameterValue(crpt, "BranchName", globalVariables.Branch_Name);
                Utility.SetParameterValue(crpt, "ParentBranchName", globalVariables.ParentBranch_Name);
                Utility.SetParameterValue(crpt, "Address", globalVariables.Branch_Address);
                Utility.SetParameterValue(crpt, "Phone", globalVariables.Branch_Phone);
                Utility.SetParameterValue(crpt, "FromDateToDate", Condition);
                Utility.SetParameterValue(crpt, "Hienthinhom", Utility.Int32Dbnull(cboHoadon.SelectedValue, -1) == 0 ? 0 : 1);
                Utility.SetParameterValue(crpt, "sTitleReport", tieude);
                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);
            }
        }