Exemplo n.º 1
0
 /// <summary>
 /// hàm thực hiện in phiếu báo cáo
 /// thông tin
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cmdBaoCao_Click(object sender, EventArgs e)
 {
     try
     {
         int       trangthai       = Trangthai();
         int       kieungaytimkiem = chkKieungaytimkiem.Checked ? 1 : 0;
         DataTable m_dtReport      =
             BAOCAO_THUOC.ThuocBaocaoTinhhinhnhapkhothuoc(chkByDate.Checked ? dtFromDate.Value.ToString("dd/MM/yyyy") : "01/01/1900",
                                                          chkByDate.Checked ? dtToDate.Value.ToString("dd/MM/yyyy") : "01/01/1900", trangthai,
                                                          Utility.Int32Dbnull(cboKho.SelectedValue), Utility.Int32Dbnull(txtthuoc.MyID, -1), (byte)LoaiPhieu.PhieuThanhly, kieungaytimkiem, Utility.DoTrim(txtLydothanhly.Text), "-1", KIEU_THUOC_VT);
         THU_VIEN_CHUNG.CreateXML(m_dtReport, "thuoc_baocaochitiet_nhapkho.xml");
         Utility.SetDataSourceForDataGridEx(grdList, m_dtReport, true, true, "1=1", "");
         if (m_dtReport.Rows.Count <= 0)
         {
             Utility.ShowMsg("Không tìm thấy dữ liệu", "Thông báo", MessageBoxIcon.Warning);
             return;
         }
         string FromDateToDate = Utility.FromToDateTime(dtFromDate.Text, dtToDate.Text);
         thuoc_baocao.BaocaoThanhlythuoc(m_dtReport, KIEU_THUOC_VT == "THUOC"?"thuoc_baocao_thanhly":"vt_baocao_thanhly", baocaO_TIEUDE1.TIEUDE, dtNgayIn.Value, FromDateToDate);
     }
     catch (Exception)
     {
     }
 }