Beispiel #1
0
 private void butIn_Click(object sender, System.EventArgs e)
 {
     sql  = "select a.mabv,a.tenbv,b.tentt,c.ten as vung,d.ten as tuyen,e.ten as loai,f.ten as hang";
     sql += " from " + user + ".tenvien a," + user + ".btdtt b," + user + ".dmvungbv c," + user + ".dmtuyenbv d," + user + ".dmloaibv e," + user + ".dmhangbv f";
     sql += " where a.matinh=b.matt and a.mavung=c.ma and a.matuyen=d.ma and a.maloai=e.ma and a.mahang=f.ma ";
     if (mavung.SelectedIndex != -1)
     {
         sql += " and a.mavung='" + mavung.SelectedValue.ToString() + "'";
     }
     if (matt.SelectedIndex != -1)
     {
         sql += " and a.matinh='" + matt.SelectedValue.ToString() + "'";
     }
     if (matuyen.SelectedIndex != -1)
     {
         sql += " and a.matuyen='" + matuyen.SelectedValue.ToString() + "'";
     }
     if (maloai.SelectedIndex != -1)
     {
         sql += " and a.maloai='" + maloai.SelectedValue.ToString() + "'";
     }
     if (mahang.SelectedIndex != -1)
     {
         sql += " and a.mahang='" + mahang.SelectedValue.ToString() + "'";
     }
     sql += " order by a.mabv";
     ds   = m.get_data(sql);
     dllReportM.frmReport f = new dllReportM.frmReport(m, ds, this.Text.ToUpper(), "tenvien.rpt");
     f.ShowDialog();
 }
Beispiel #2
0
 private void get_data()
 {
     ds.Clear();
     items_tondau();
     items_nhap();
     items_xuat();
     if (ds.Tables[0].Rows.Count == 0)
     {
         MessageBox.Show(
             lan.Change_language_MessageText("Không có số liệu !"), d.Msg);
         return;
     }
     else
     {
         try
         {
             ds.Tables[0].Columns.Add("nuocsx");
         }
         catch {}
         foreach (DataRow r in ds.Tables[0].Rows)
         {
             r2 = d.getrowbyid(dt, "id=" + int.Parse(r["mabd"].ToString()));
             if (r2 != null)
             {
                 r["nuocsx"] = r2["nuocsx"].ToString();
             }
         }
     }
     get_sort();
     dllReportM.frmReport f = new dllReportM.frmReport(m, dsxml.Tables[0], (chkSoluong.Checked)?"d_khoacstt_sl.rpt":"d_khoacstt.rpt", makp.Text, (tu.Text == den.Text)?"Ngày " + tu.Text:"Từ ngày " + tu.Text + " đến " + den.Text, "", "", "", "", "", "", "", "");
     f.ShowDialog();
 }
Beispiel #3
0
        private void butin_Click(object sender, EventArgs e)
        {
            sql  = "select a.mabn,m.hoten,case when m.phai='0' then '" + lan.Change_language_MessageText("Nam") + "' else '" + lan.Change_language_MessageText("Nữ") + "' end phai,case when k.sonha='' then '' else k.sonha||', ' end || case when k.thon='' then '' else  k.thon||', ' end ||k3.tenpxa||', '||k2.tenquan||', '||k1.tentt as diachi, ";
            sql += " substr(k.tuoivao,1,3)||case when substr(k.tuoivao,4,1)='0' then '' else case when substr(k.tuoivao,4,1)='1' then ' " + lan.Change_language_MessageText("tháng") + "' else case when substr(k.tuoivao,4,1)='2' then ' " + lan.Change_language_MessageText("ngày") + "' else case when substr(k.tuoivao,4,1)='2' then ' " + lan.Change_language_MessageText("giờ") + "' end end end end as tuoi, ";
            sql += " j.ten loai,b.ten thuoc,a.muitiem,b.duongdung,a.vitritiem,c.hoten nguoitiem,to_char(a.ngaytiem,'dd/mm/yyyy hh24:mi') ngaytiem , d.sttt,g.ten hangsx,h.ten nhacungcap,  ";
            sql += " case when to_number(f.handung)=0 then '' else f.handung end handung,f.losx,a.phanung,a.mabd ,n.tenkp,a.makp   ";
            sql += " from " + m.user + ".phieutiemchung a left join " + m.user + ".dmbs c on a.mabs=c.ma left join " + m.user + ".btdkp_bv n on a.makp=n.makp, " + m.user + ".d_dmbd b, xxx.v_chidinh e,xxx.d_xuatsdct d,  xxx.d_theodoi f, ";
            sql += " " + m.user + ".d_dmhang g, " + m.user + ".d_dmnx h ," + m.user + ".d_dmloai j," + m.user + ".btdbn m,xxx.lienhe k ";
            sql += " left join " + m.user + ".btdtt k1 on k.matt=k1.matt left join " + m.user + ".btdquan k2 on k.maqu=k2.maqu left join " + m.user + ".btdpxa k3 on k.maphuongxa=k3.maphuongxa  ";
            sql += " where a.mabd=b.id and e.idduoc=d.id and a.mabd=d.mabd and e.id=a.id and f.id=d.sttt and b.mahang=g.id and f.nhomcc=h.id and j.id=b.maloai and k.maql=e.maql and m.mabn=a.mabn ";

            ds = m.get_data_mmyy(sql, tungay.Text.Substring(0, 10), denngay.Text.Substring(0, 10), 0);
            if (ds.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show(lan.Change_language_MessageText("Không có số liệu!"), LibMedi.AccessData.Msg);
                return;
            }
            if (chkXml.Checked)
            {
                if (!System.IO.Directory.Exists("..\\..\\dataxml"))
                {
                    System.IO.Directory.CreateDirectory("..\\..\\dataxml");
                }
                ds.WriteXml("..\\..\\dataxml\\rptSoquanlyTiem.xml", XmlWriteMode.WriteSchema);
            }

            if (ds.Tables[0].Rows.Count > 0)
            {
                dllReportM.frmReport f = new dllReportM.frmReport(m, ds.Tables[0], "rptSoquanlyTiem.rpt", s_chinhanh, tungay.Text.Substring(0, 10), denngay.Text.Substring(0, 10), "", "", "", "", "", "", "");
                f.ShowDialog();
            }
        }
Beispiel #4
0
        private void butOk_Click(object sender, EventArgs e)
        {
            if (cmbten.SelectedIndex == -1)
            {
                cmbten.Focus();
                return;
            }
            string xxx = user + ds.Tables[0].Rows[cmbten.SelectedIndex]["mmyy"].ToString();

            sql  = "select a.mabn,a.hoten,a.namsinh,case when a.phai=1 then 'Nữ' else 'Nam' end as phai,";
            sql += "to_char(b.ngay,'dd/mm/yyyy') as ngay,c.ten as donvi,b.ketluan,e.ten as loai,d.hoten as tenbs ";
            sql += " from " + xxx + ".ct_btdbn a inner join " + xxx + ".ct_ketqua b on a.mabn=b.mabn ";
            sql += " inner join " + user + ".ct_donvi c on a.iddonvi=c.id ";
            sql += " left join " + user + ".dmbs d on b.mabs=d.ma ";
            sql += " inner join " + user + ".ct_loai e on b.loai=e.id ";
            sql += " where c.iddoan=" + decimal.Parse(cmbten.SelectedValue.ToString());
            if (donvi.SelectedIndex != -1)
            {
                sql += " and c.id=" + decimal.Parse(donvi.SelectedValue.ToString());
            }
            sql += " order by c.stt,a.stt";
            DataSet dsxml = m.get_data(sql);

            if (dsxml.Tables[0].Rows.Count > 0)
            {
                dllReportM.frmReport f = new dllReportM.frmReport(m, dsxml, cmbten.Text, "rptDsksk.rpt");
                f.ShowDialog();
            }
            else
            {
                MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg);
            }
        }
Beispiel #5
0
        private void butIN_Click(object sender, System.EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            string s_ma = "", s_ten = "";

            for (int i = 0; i < madoituong.Items.Count; i++)
            {
                if (madoituong.GetItemChecked(i))
                {
                    s_ma  += dtdt.Rows[i]["madoituong"].ToString().Trim() + ",";
                    s_ten += dtdt.Rows[i]["doituong"].ToString().Trim() + ",";
                }
            }
            sql  = "select a.mabn,a.idcls,a.idvp,b.hoten,to_number(to_char(now(),'yyyy'))-to_number(b.namsinh) as tuoi,";
            sql += "to_char(a.ngay,'dd/mm/yy') as ngay,abs(a.cp) as cp,abs(a.lt) as lt,c.ten as vung,trim(b.sonha)||' '||trim(b.thon)||' '||case when substr(b.maphuongxa,6,2)='00' then '' else trim(f.tenpxa) end||' '||case when substr(b.maqu,4,2)='00' then '' else trim(e.tenquan) end ||' '||case when b.matt='000' then '' else d.tentt end as diachi,g.ten as may,j.doituong ";
            sql += " from xxx.cls_ketqua a inner join " + user + ".btdbn b on a.mabn=b.mabn ";
            sql += " inner join " + user + ".cls_noidung c on a.idvung=c.id ";
            sql += " inner join " + user + ".btdtt d on b.matt=d.matt ";
            sql += " inner join " + user + ".btdquan e on b.maqu=e.maqu ";
            sql += " inner join " + user + ".btdpxa f on b.maphuongxa=f.maphuongxa ";
            sql += " left join " + user + ".cls_may g on a.idmay=g.id ";
            sql += " left join xxx.cls_motact i on a.id=i.id";
            sql += " left join " + user + ".doituong j on a.madoituong=j.madoituong";
            sql += " where " + m.for_ngay("a.ngay", stime) + " between to_date('" + tu.Text + "'," + stime + ") and to_date('" + den.Text + "'," + stime + ")";
            sql += " and a.loai=" + int.Parse(loai.SelectedValue.ToString());
            if (rb1.Checked)
            {
                sql += " and i.canquang=1";
            }
            else if (rb2.Checked)
            {
                sql += " and (i.canquang=0 or i.canquang is null)";
            }
            if (may.SelectedIndex != -1)
            {
                sql += " and a.idmay=" + int.Parse(may.SelectedValue.ToString());
            }
            if (s_madoituong != "")
            {
                sql += " and (a.cp<0 or a.madoituong in (" + s_madoituong.Substring(0, s_madoituong.Length - 1) + "))";
            }
            if (s_ma != "")
            {
                sql += " and a.madoituong in (" + s_ma.Substring(0, s_ma.Length - 1) + ")";
            }
            sql   += " order by j.doituong,a.idcls";
            ds     = m.get_data_mmyy(sql, tu.Text, den.Text, false);
            Cursor = Cursors.Default;
            if (ds.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg);
            }
            else
            {
                string title = (rb1.Checked) ? "CE, " : (rb2.Checked) ? "NE, " : "";
                title += (tu.Text == den.Text) ? "Ngày " + tu.Text : "Từ ngày " + tu.Text + " đến " + den.Text;
                dllReportM.frmReport f = new dllReportM.frmReport(m, ds, s_ten + ", " + title, "rpttkclsds.rpt");
                f.ShowDialog();
            }
        }
Beispiel #6
0
        private void butIn_Click(object sender, System.EventArgs e)
        {
            string  sql = "select * from " + xxx + ".bavv_rhm where maql=" + l_maql;
            DataSet ds  = m.get_data(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (chkXML.Checked)
                {
                    if (!System.IO.Directory.Exists("..\\xml"))
                    {
                        System.IO.Directory.CreateDirectory("..\\xml");
                    }
                    ds.WriteXml("..\\xml\\barhm.xml", XmlWriteMode.WriteSchema);
                }
                if (chkXem.Checked)
                {
                    dllReportM.frmReport f = new dllReportM.frmReport(m, ds, "", "rptBaRHM.rpt");
                    f.ShowDialog();
                }
                else
                {
                    print.Printer(m, ds, "rptBaRHM.rpt", "", 1, 1);
                }
            }
        }
Beispiel #7
0
        private void butIn_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (thang.Text == "00" || int.Parse(thang.Text) > 12)
                {
                    MessageBox.Show(lan.Change_language_MessageText("Tháng không hợp lệ !"), AccessData.Msg);
                    thang.Focus();
                    return;
                }
                tu  = "01/" + thang.Text + "/" + nam.Text;
                den = DateTime.DaysInMonth(int.Parse(nam.Text), int.Parse(thang.Text)).ToString().PadLeft(2, '0') + "/" + thang.Text + "/" + nam.Text;
                string s_ngayhientai = m.ngayhienhanh_server.Substring(0, 10);
                if (m.bNgay(den, s_ngayhientai))
                {
                    den = s_ngayhientai;
                }

                ds = exp.upd_ththbn(tu, den, (makp.SelectedIndex == -1)?"":makp.SelectedValue.ToString(), time.Checked);
                if (ds.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), AccessData.Msg);
                    return;
                }
                else
                {
                    string title           = "Tháng " + thang.Text + " năm " + nam.Text;
                    dllReportM.frmReport f = new dllReportM.frmReport(m, ds, title, "rptTkdieutri.rpt");
                    f.ShowDialog();
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Beispiel #8
0
        private void butIn_Click(object sender, EventArgs e)
        {
            decimal stt = 0;

            try
            {
                stt = decimal.Parse(m.get_data("select sott from " + m.user + ".blgd_sangloc where mavaovien=" + d_mavaovien).Tables[0].Rows[0][0].ToString());
            }
            catch
            {
                stt = m.sttSangLocBLGD;
            }
            DataSet dsthongtin = new DataSet();

            sql        = "select a.*,b.*,d.hoten as bacsi,e.ten as trinhdo from " + m.user + ".blgd_vao a left join " + m.user + m.mmyy(s_ngay) + ".benhanpk c on a.maql=c.maql left join " + m.user + ".dmbs d on c.mabs=d.ma inner join " + m.user + ".blgd_tdhv e on a.tdhv=e.id," + m.user + ".blgd_ra b where a.mavaovien=b.mavaovien and a.mavaovien=" + d_mavaovien;
            dsthongtin = m.get_data(sql);
            if (dsthongtin.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show(lan.Change_language_MessageText("Phiếu sàng lọc nạn nhân bạo lực gia đình chưa lưu!"), s_msg);
                return;
            }
            dsthongtin.WriteXml("..\\..\\dataxml\\rptThongtinBLGD.xml");
            dllReportM.frmReport f = new dllReportM.frmReport(m, dsthongtin.Tables[0], "rptThongtinBLGD.rpt", stt.ToString(), s_mabn, txtHoten.Text, txtTuoi.Text, txtGioitinh.Text, txtDiachi.Text, txtDienthoai.Text, txtNguoilienhe.Text, txtNghenghiep.Text, "", 10);
            f.ShowDialog();
        }
Beispiel #9
0
        private void f_print(string s_tenrp)
        {
            DataSet dsinhc = new DataSet();
            String  xxx    = s_user + m.mmyy(s_ngay);
            string  sql    = " select a.id,a.mabn,to_char(a.ngayhoichan,'dd/mm/yyyy hh24:mi') ngayhoichan,a.lamsang,a.chandoan,a.xquang,a.sieuam,a.xetnghiem,a.sdthuoccanquangco thuocco,a.sdthuoccanquangkhong thuock,b.iddmbophan,c.ten,d.hoten,d.namsinh,d.phai";

            sql   += " ,f.ten tencls,g.ten tenloaicls,f.id_loai idloai,";
            sql   += " (h.sonha ||' '||h.thon||' '||i.tenpxa||' '||l.tenquan||' '||m.tentt) diachi,n.nha sodtnha,n.coquan sodtcq,n.didong,n1.tennn,n2.dantoc,h.cholam ";
            sql   += " from " + s_user + ".hoichan_cdha a left join " + s_user + ".hoichan_cdha_ct b on a.id=b.id left join " + s_user + ".dmbophan_hoichan c on b.iddmbophan=c.id ";
            sql   += " left join " + s_user + ".btdbn d on a.mabn=d.mabn";
            sql   += " left join " + xxx + ".v_chidinh e on a.id=e.id left join " + s_user + ".v_giavp f on e.mavp=f.id left join " + s_user + ".v_loaivp g on f.id_loai=g.id ";
            sql   += " inner join " + s_user + ".btdbn h on a.mabn=h.mabn inner join " + s_user + ".btdpxa i on h.maphuongxa=i.maphuongxa inner join " + s_user + ".btdquan l on h.maqu=l.maqu ";
            sql   += " inner join " + s_user + ".btdtt m on h.matt=m.matt left join " + s_user + ".dienthoai n on a.mabn=n.mabn left join " + s_user + ".btdnn n1 on h.mann=n1.mann left join " + s_user + ".btddt n2 on h.madantoc=n2.madantoc";
            sql   += " left join " + xxx + ".xn_phieu n3 on a.mabn=n3.mabn and a.maql=n3.maql ";
            sql   += " where a.id in(" + decimal.Parse(cbLoaicls.SelectedValue.ToString()) + ")";
            dsinhc = m.get_data_mmyy(sql, s_ngay, s_ngay, 31);
            if (dsinhc.Tables[0].Rows.Count > 0)
            {
                if (!System.IO.Directory.Exists("..//xml"))
                {
                    System.IO.Directory.CreateDirectory("..//xml");
                }
                dsinhc.WriteXml("..//xml//rptBienbanhoichan.xml", XmlWriteMode.WriteSchema);
                dllReportM.frmReport f = new dllReportM.frmReport(m, dsinhc, s_ngay.Substring(0, 10), s_tenrp);
                f.ShowDialog();
            }
            else
            {
                MessageBox.Show(lan.Change_language_MessageText(" Chưa có dữ liệu."), "Medisoft THIS", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
        }
Beispiel #10
0
        private void butIn_Click(object sender, System.EventArgs e)
        {
            string s_makp = "";

            if (makp.SelectedItems.Count > 0)
            {
                for (int i = 0; i < makp.Items.Count; i++)
                {
                    if (makp.GetItemChecked(i))
                    {
                        s_makp += dtkp.Rows[i]["makp"].ToString() + ",";
                    }
                }
            }
            s_makp = (s_makp != "")?s_makp.Substring(0, s_makp.Length - 1):"";
            ds     = exp.get_btngtru(tu.Text, den.Text, s_makp, time.Checked);
            if (ds.Tables[0].Rows.Count > 0)
            {
                dllReportM.frmReport f = new dllReportM.frmReport(m, ds, (tu.Text == den.Text)?
                                                                  lan.Change_language_MessageText("Ngày") + " " + tu.Text:
                                                                  lan.Change_language_MessageText("Từ ngày") + " " + tu.Text + " " +
                                                                  lan.Change_language_MessageText("đến") + " " + den.Text, "rptbtngtr.rpt", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
                f.ShowDialog();
            }
            else
            {
                MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), AccessData.Msg);
            }
        }
Beispiel #11
0
        private void butIn_Click(object sender, System.EventArgs e)
        {
            string s_makp = "";

            if (makp.SelectedItems.Count > 0)
            {
                for (int i = 0; i < makp.Items.Count; i++)
                {
                    if (makp.GetItemChecked(i))
                    {
                        s_makp += dtkp.Rows[i]["makp"].ToString() + ",";
                    }
                }
            }
            s_makp = (s_makp != "")?s_makp.Substring(0, s_makp.Length - 1):"";
            ds     = exp.get_bctiepbenh(mm.Value.ToString().PadLeft(2, '0') + yyyy.Value.ToString(), s_makp);
            if (ds.Tables[0].Rows.Count > 0)
            {
                dllReportM.frmReport f = new dllReportM.frmReport(m, ds,
                                                                  lan.Change_language_MessageText("Tháng") + " " + mm.Value.ToString().PadLeft(2, '0') + " " +
                                                                  lan.Change_language_MessageText("năm") + " " + yyyy.Value.ToString(), "rptBctiepbenh.rpt");
                f.ShowDialog();
            }
            else
            {
                MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), AccessData.Msg);
            }
        }
Beispiel #12
0
        private void butIn_Click(object sender, System.EventArgs e)
        {
            string  sql = "select a.*,b.stt,b.taip,b.tait from " + xxx + ".bavv_tmh a," + xxx + ".bavv_tmhct b where a.maql=b.maql and a.maql=" + l_maql + " order by b.stt";
            DataSet ds  = m.get_data(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (chkXML.Checked)
                {
                    if (!System.IO.Directory.Exists("..\\xml"))
                    {
                        System.IO.Directory.CreateDirectory("..\\xml");
                    }
                    ds.WriteXml("..\\xml\\batmh.xml", XmlWriteMode.WriteSchema);
                }
                if (chkXem.Checked)
                {
                    dllReportM.frmReport f = new dllReportM.frmReport(m, ds, "", "rptBaTMH.rpt");
                    f.ShowDialog();
                }
                else
                {
                    print.Printer(m, ds, "rptBaTMH.rpt", "", 1, 1);
                }
            }
        }
Beispiel #13
0
        private void butin_Click(object sender, EventArgs e)
        {
            sql  = "select to_char(b.ngaysp,'dd/mm/yyyy') ngaysp,b.sohd,a.ten tenbd,a.ma, a.id mabd,a.hamluong,a.dang,a.tenhc,d1.ten nhomcc,nvl(b.soluong,0) slnhap,nvl(f.soluong,0) slxuat,d.losx, ";
            sql += " d.handung,aa.ten||case when a.manuoc=0 then '' else ' ('||ab.ten||')' end hang,nvl(g.soluong,0) slhuy,e.tondau+e.slnhap-e.slxuat ton  ";
            sql += " from " + m.user + ".d_dmbd a left join " + m.user + ".d_dmhang aa on a.mahang=aa.id left join " + m.user + ".d_dmnuoc ab on a.manuoc=ab.id  , xxx.d_theodoi d  ";
            sql += " left join  (select b.sttt,sum(b.soluong) soluong from xxx.d_xuatsdll a, xxx.d_xuatsdct b where a.id=b.id and a.loai=2 and a.ngay between to_date('" + tungay.Text.Substring(0, 10) + "','dd/mm/yyyy')  ";
            sql += " and to_date('" + denngay.Text.Substring(0, 10) + "','dd/mm/yyyy') group by b.sttt) f on d.id=f.sttt  ";
            sql += " left join  (select b.sttt,sum(b.soluong) soluong from xxx.d_xuatll a, xxx.d_xuatct b where a.id=b.id and a.loai='XK' and a.ngay between to_date('" + tungay.Text.Substring(0, 10) + "','dd/mm/yyyy')  ";
            sql += " and to_date('" + denngay.Text.Substring(0, 10) + "','dd/mm/yyyy') group by b.sttt) g on d.id=g.sttt   ";
            sql += " left join xxx.d_tonkhoct e on d.id=e.stt left join ( select b.ngaysp,b.sohd,b.id,c.stt,c.soluong from xxx.d_nhapct c  ,xxx.d_nhapll b where b.id=c.id  ";
            sql += " and b.ngaysp between to_date('" + tungay.Text.Substring(0, 10) + "','dd/mm/yyyy') and to_date('" + denngay.Text.Substring(0, 10) + "','dd/mm/yyyy') ) b on e.idn=b.id and e.sttn=b.stt ";
            sql += " left join medibv.d_dmnx d1 on d.nhomcc=d1.id   ";
            sql += " where a.vacxin=1 and a.id=d.mabd ";

            ds = m.get_data_mmyy(sql, tungay.Text.Substring(0, 10), denngay.Text.Substring(0, 10), 0);
            if (ds.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show(lan.Change_language_MessageText("Không có số liệu!"), LibMedi.AccessData.Msg);
                return;
            }
            if (chkXml.Checked)
            {
                if (!System.IO.Directory.Exists("..\\..\\dataxml"))
                {
                    System.IO.Directory.CreateDirectory("..\\..\\dataxml");
                }
                ds.WriteXml("..\\..\\dataxml\\rptSoquanlyVacxin.xml", XmlWriteMode.WriteSchema);
            }

            if (ds.Tables[0].Rows.Count > 0)
            {
                dllReportM.frmReport f = new dllReportM.frmReport(m, ds.Tables[0], "rptSoquanlyVacxin.rpt", s_chinhanh, tungay.Text.Substring(0, 10), denngay.Text.Substring(0, 10), "", "", "", "", "", "", "");
                f.ShowDialog();
            }
        }
Beispiel #14
0
        private void butin_Click(object sender, EventArgs e)
        {
            DataSet dsxml = new DataSet();

            dsxml = ds.Clone();
            int i = 0;

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                dsxml.Clear();
                if (dataGridView1["In", i].Value.ToString() == "1" || dataGridView1["In", i].Value.ToString() == "True")
                {
                    if (dataGridView1["cungtuyen", i].Value.ToString() == "1" || dataGridView1["cungtuyen", i].Value.ToString() == "True")//cung tuyen
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            foreach (DataRow r1 in ds.Tables[0].Select("mabn='" + dataGridView1["mabn", i].Value.ToString() + "'"))
                            {
                                dsxml.Tables[0].Rows.Add(r1.ItemArray);
                            }
                            dllReportM.frmReport f = new dllReportM.frmReport(m, dsxml, "GIẤY CHUYỂN VIỆN", "rptGiaycv.rpt", true);
                            f.ShowDialog();
                        }
                        else
                        {
                            MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg);
                            //return;
                        }
                    }
                    else //khong cung tuyen
                    {
                        try
                        {
                            DataSet ds_duyet = m.get_data("select daduyet from " + user + ".chuyenvien where maql=" + l_maql + "");
                            if (ds_duyet.Tables[0].Rows[0]["daduyet"].ToString() == "1")
                            {
                                if (ds.Tables[0].Rows.Count > 0)
                                {
                                    foreach (DataRow r2 in ds.Tables[0].Select("mabn='" + dataGridView1["mabn", i].Value.ToString() + "'"))
                                    {
                                        dsxml.Tables[0].Rows.Add(r2.ItemArray);
                                    }
                                    dllReportM.frmReport f = new dllReportM.frmReport(m, dsxml, "GIẤY CHUYỂN VIỆN", "rptGiaycv.rpt", true);
                                    f.ShowDialog();
                                }
                            }
                            else
                            {
                                MessageBox.Show(lan.Change_language_MessageText("Bệnh nhân chưa được duyệt chuyển viện !"), LibMedi.AccessData.Msg);
                                //return;
                            }
                        }
                        catch { }
                    }
                }
                dataGridView1["In", i].Value = 0;
                i++;
            }
        }
Beispiel #15
0
 private void butIn_Click(object sender, System.EventArgs e)
 {
     sql  = "select d.stt as manhom,d.ten as tennhom,b.ma,trim(b.ten)||' '||b.hamluong as ten,b.tenhc,b.dang,c.ten as tenhang,a.tondau,a.slnhap,a.slxuat ";
     sql += " from " + xxx + ".ttb_tutructh a," + user + ".ttb_dmbd b," + user + ".ttb_dmhang c," + user + ".ttb_dmnhom d";
     sql += " where a.mabd=b.id and b.mahang=c.id and b.manhom=d.id and a.makho=" + i_kho + " and a.makp=" + i_makp + " order by d.stt,b.ten";
     dllReportM.frmReport f1 = new dllReportM.frmReport(m, ttb.get_data(sql).Tables[0], "d_cstt_khoa.rpt", s_tenkp, "Tháng " + s_mmyy.Substring(0, 2) + " Năm 20" + s_mmyy.Substring(2), "", "", "", "", "", "", "", "");
     f1.ShowDialog(this);
 }
Beispiel #16
0
        private void butIn_Click(object sender, System.EventArgs e)
        {
            if (!kiemtra(false))
            {
                return;
            }
            dsxml.Clear();
            string stt = "tenkho,stt,";

            foreach (DataRow r1 in dstt.Tables[0].Select("stt<>0", "stt"))
            {
                stt += r1["ma"].ToString().Trim() + ",";
            }
            stt = stt.Substring(0, stt.Length - 1);
            dsxml.Merge(ds.Tables[0].Select("true", stt));
            bool bDuoc = false, bDieutri = false;

            if (bChuky)
            {
                DataRow r1 = m.getrowbyid(dtbs, "makp='" + makp.SelectedValue.ToString() + "'");
                if (r1 != null)
                {
                    string truongkhoa = r1["ma"].ToString().Trim();
                    if (File.Exists("..//..//..//chuky//" + truongkhoa + ".bmp"))
                    {
                        fstr          = new FileStream("..//..//..//chuky//" + truongkhoa + ".bmp", FileMode.Open, FileAccess.Read);
                        image_dieutri = new byte[fstr.Length];
                        fstr.Read(image_dieutri, 0, System.Convert.ToInt32(fstr.Length));
                        fstr.Close();
                        bDieutri = true;
                    }
                }
                string truongkho = "kho" + i_nhom.ToString();
                if (File.Exists("..//..//..//chuky//" + truongkho + ".bmp"))
                {
                    fstr       = new FileStream("..//..//..//chuky//" + truongkho + ".bmp", FileMode.Open, FileAccess.Read);
                    image_duoc = new byte[fstr.Length];
                    fstr.Read(image_duoc, 0, System.Convert.ToInt32(fstr.Length));
                    fstr.Close();
                    bDuoc = true;
                }
                foreach (DataRow r in dsxml.Tables[0].Rows)
                {
                    if (bDuoc)
                    {
                        r["Image_duoc"] = image_duoc;
                    }
                    if (bDieutri)
                    {
                        r["Image_dieutri"] = image_dieutri;
                    }
                }
            }
            string title = (tu.Text == den.Text)?"Ngày " + tu.Text:"Từ ngày " + tu.Text + " đến " + den.Text;

            dllReportM.frmReport f = new dllReportM.frmReport(m, dsxml.Tables[0], "d_phieulanh_dg.rpt", makp.Text, (rb1.Checked)?"PHIẾU LĨNH":"PHIẾU HOÀN TRẢ", title, s_tenloai, "", kho.Text, "", s_mmyy, "", s_userid);
            f.ShowDialog(this);
        }
Beispiel #17
0
 private void butIn_Click(object sender, System.EventArgs e)
 {
     sql  = "SELECT c.mabn,c.hoten,to_number(to_char(now(),'yyyy'))-to_number(c.namsinh) as tuoi,to_char(a.ngay,'dd/mm/yyyy hh24:mi') as ngay,";
     sql += "a.phai,a.cannang,a.tinhtrang,a.ditat,c.sonha||' '||c.thon||' '||f.tenpxa||','||e.tenquan||','||d.tentt as diachi,g.lansinh ";
     sql += "FROM " + m.user + ".TRESOSINH a," + m.user + ".BENHANDT b," + m.user + ".BTDBN c," + m.user + ".BTDTT d," + m.user + ".BTDQUAN e," + m.user + ".BTDPXA f," + m.user + ".ddsosinh g ";
     sql += " where a.MAQL = b.MAQL and b.MABN = c.MABN and c.MATT = d.MATT and c.MAQU = e.MAQU and c.MAPHUONGXA = f.MAPHUONGXA and a.id_ss=g.maql ";
     sql += " and " + m.for_ngay("a.ngay", "'dd/mm/yyyy'") + " between to_date('" + tu.Text + "','dd/mm/yyyy') and to_date('" + den.Text + "','dd/mm/yyyy')";
     if (phai.SelectedIndex != -1)
     {
         sql += " and a.phai=" + phai.SelectedIndex;
     }
     if (tinhtrang.SelectedIndex != -1)
     {
         sql += " and a.tinhtrang=" + tinhtrang.SelectedIndex;
     }
     if (ditat.SelectedIndex != -1)
     {
         sql += " and a.ditat=" + ditat.SelectedIndex;
     }
     if (cn1.Text != "" && cn2.Text != "")
     {
         sql += " and a.cannang between " + decimal.Parse(cn1.Text) + " and " + decimal.Parse(cn2.Text);
     }
     if (cboLanSinh.SelectedIndex != -1)
     {
         if (cboLanSinh.SelectedIndex == 2)
         {
             sql += " and g.lansinh>=3";
         }
         else
         {
             int i_lansinh = cboLanSinh.SelectedIndex + 1;
             sql += " and g.lansinh=" + i_lansinh;
         }
     }
     ds = m.get_data(sql);
     if (ds.Tables[0].Rows.Count == 0)
     {
         MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), AccessData.Msg);
         return;
     }
     else
     {
         if (!System.IO.Directory.Exists("..//xml"))
         {
             System.IO.Directory.CreateDirectory("..//xml");
         }
         ds.WriteXml("..//xml//tktresosinh.xml", XmlWriteMode.WriteSchema);
         string title = lan.Change_language_MessageText("Từ ngày ") + tu.Text + lan.Change_language_MessageText(" Đến ngày ") + den.Text;
         if (tu.Text == den.Text)
         {
             title = "Ngày " + tu.Text;
         }
         dllReportM.frmReport f = new dllReportM.frmReport(m, ds, title, "rptTKtresosinh.rpt");
         f.ShowDialog();
     }
 }
Beispiel #18
0
 private void butIn_Click(object sender, EventArgs e)
 {
     butLuu_Click(null, null);
     if (chkXml.Checked)
     {
         ds.WriteXml("..//dataxml//rptPhieukhamck.xml", XmlWriteMode.WriteSchema);
     }
     dllReportM.frmReport f = new dllReportM.frmReport(m, ds.Tables[0], "rptPhieukhamck.rpt", benhvien, hoten, namsinh, tuoi, phai, diachi, s_ngay, bacsi, txtYeucau.Text, "");
     f.ShowDialog();
 }
Beispiel #19
0
 private void butIn_Click(object sender, System.EventArgs e)
 {
     if (ds.Tables[0].Rows.Count == 0)
     {
         MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), AccessData.Msg);
         return;
     }
     dllReportM.frmReport f = new dllReportM.frmReport(m, ds.Tables[0], "sbanhapkho.rpt", m.Syte, m.Tenbv, (tu.Text == den.Text)?"Ngày :" + tu.Text:"Từ ngày :" + tu.Text + " đến ngày :" + den.Text, loaibn.Text, s_tinh, "", "", "", "", "");
     f.ShowDialog(this);
 }
Beispiel #20
0
        private void btReport_Click(object sender, EventArgs e)
        {
            DataSet ds    = ads.Clone();
            string  sText = txtTim.Text.Trim().Replace("'", "''");
            string  aft   = "hoten like '%" + sText + "%' or mabn like '%" + sText + "%' or soluutru like '%" + sText + "%'";

            ds.Merge(ads.Tables[0].Select(aft));
            ds.WriteXml("..//..//dataxml//hosobenhan.xml", XmlWriteMode.WriteSchema);
            dllReportM.frmReport f = new dllReportM.frmReport(m, ds.Tables[0], "hosobenhan.rpt", "", "SỔ LƯU TRỮ HỒ SƠ BỆNH ÁN", (tu.Text == den.Text) ? "Ngày " + tu.Text : "Từ ngày " + tu.Text + " đến " + den.Text, "", "", "", "", "", den.Text, "");
            f.ShowDialog(this);
        }
Beispiel #21
0
 private void butIn_Click(object sender, System.EventArgs e)
 {
     if (ds.Tables[0].Rows.Count == 0)
     {
         MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), AccessData.Msg);
         tu.Focus();
         return;
     }
     dllReportM.frmReport f = new dllReportM.frmReport(m, ds, noidung.Text.ToUpper(), "rptTruyvan.rpt", ts, 0, 0, 0, 0, 0, 0, 0, 0, 0);
     f.ShowDialog();
 }
Beispiel #22
0
 private void butIN_Click(object sender, System.EventArgs e)
 {
     Cursor  = Cursors.WaitCursor;
     namsinh = int.Parse(tu.Text.ToString().Substring(6, 4));
     s_makp  = "'";
     for (int i = 0; i < makp.Items.Count; i++)
     {
         if (makp.GetItemChecked(i))
         {
             s_makp += dtkp.Rows[i]["makp"].ToString().Trim() + "','";
         }
     }
     ds.Clear();
     sql  = "select to_char(a.ngay,'yyyymmdd') as ngay,";
     sql += " sum(1) as ts,";
     sql += " sum(case when a.kham=1 and " + namsinh + "-to_number(b.namsinh)<=6 then 1 else 0 end) as c01,";
     sql += " sum(case when a.kham=1 and " + namsinh + "-to_number(b.namsinh)>6 and " + namsinh + "-to_number(b.namsinh)<=14 then 1 else 0 end) as c02,";
     sql += " sum(case when a.kham=1 and " + namsinh + "-to_number(b.namsinh)>14 and b.phai=0 then 1 else 0 end) as c03,";
     sql += " sum(case when a.kham=1 and " + namsinh + "-to_number(b.namsinh)>14 and b.phai=1 then 1 else 0 end) as c04,";
     sql += " sum(case when a.kham=0 and " + namsinh + "-to_number(b.namsinh)<=6 then 1 else 0 end) as c05,";
     sql += " sum(case when a.kham=0 and " + namsinh + "-to_number(b.namsinh)>6 and " + namsinh + "-to_number(b.namsinh)<=14 then 1 else 0 end) as c06,";
     sql += " sum(case when a.kham=0 and " + namsinh + "-to_number(b.namsinh)>14 and b.phai=0 then 1 else 0 end) as c07,";
     sql += " sum(case when a.kham=0 and " + namsinh + "-to_number(b.namsinh)>14 and b.phai=1 then 1 else 0 end) as c08,";
     sql += " sum(case when b.matt='" + matt + "' and a.madoituong=1 then 1 else 0 end) as c09,";
     sql += " sum(case when b.matt='" + matt + "' and " + namsinh + "-to_number(b.namsinh)<=6 and a.madoituong<>1 and c.mien=0 then 1 else 0 end) as c10,";
     sql += " sum(case when b.matt='" + matt + "' and " + namsinh + "-to_number(b.namsinh)>6 and " + namsinh + "-to_number(b.namsinh)<=14 and a.madoituong<>1 and c.mien=0 then 1 else 0 end) as c11,";
     sql += " sum(case when b.matt='" + matt + "' and " + namsinh + "-to_number(b.namsinh)<=6 and a.madoituong<>1 and c.mien=1 then 1 else 0 end) as c12,";
     sql += " sum(case when b.matt='" + matt + "' and " + namsinh + "-to_number(b.namsinh)>6 and " + namsinh + "-to_number(b.namsinh)<=14 and a.madoituong<>1 and c.mien=1 then 1 else 0 end) as c13,";
     sql += " sum(case when b.matt<>'" + matt + "' and a.madoituong=1 then 1 else 0 end) as c14,";
     sql += " sum(case when b.matt<>'" + matt + "' and " + namsinh + "-to_number(b.namsinh)<=6 and a.madoituong<>1 and c.mien=0 then 1 else 0 end) as c15,";
     sql += " sum(case when b.matt<>'" + matt + "' and " + namsinh + "-to_number(b.namsinh)>6 and " + namsinh + "-to_number(b.namsinh)<=14 and a.madoituong<>1 and c.mien=0 then 1 else 0 end) as c16,";
     sql += " sum(case when b.matt<>'" + matt + "' and " + namsinh + "-to_number(b.namsinh)<=6 and a.madoituong<>1 and c.mien=1 then 1 else 0 end) as c17,";
     sql += " sum(case when b.matt<>'" + matt + "' and " + namsinh + "-to_number(b.namsinh)>6 and " + namsinh + "-to_number(b.namsinh)<=14 and a.madoituong<>1 and c.mien=1 then 1 else 0 end) as c18";
     sql += " from le_thuchien a,btdbn b,doituong c";
     sql += " where a.mabn=b.mabn and a.madoituong=c.madoituong";
     sql += " and to_date(a.ngay,'dd/mm/yy') between to_date('" + tu.Text + "','dd/mm/yy') and to_date('" + den.Text + "','dd/mm/yy')";
     if (s_makp.Length > 1)
     {
         sql += " and a.makp in (" + s_makp.Substring(0, s_makp.Length - 2) + ")";
     }
     sql   += " group by to_char(a.ngay,'yyyymmdd')";
     sql   += " order by to_char(a.ngay,'yyyymmdd')";
     ds     = m.get_data(sql);
     Cursor = Cursors.Default;
     if (ds.Tables[0].Rows.Count == 0)
     {
         MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg);
     }
     else
     {
         dllReportM.frmReport f = new dllReportM.frmReport(m, ds, "KHÁM LÉ" + "," + ((tu.Text == den.Text)?"Ngày :" + tu.Text:"Từ ngày " + tu.Text + " đến " + den.Text), "rpttkthle.rpt");
         f.ShowDialog();
     }
 }
Beispiel #23
0
        private void butIn_Click(object sender, EventArgs e)
        {
            string s = "'";

            if (chkAll.Checked)
            {
                s = "','";
            }
            else if (chkAlldv.Checked)
            {
                foreach (DataRow r in dtlist.Rows)
                {
                    s += r["mabn"].ToString() + "','";
                }
            }
            else if (mabn.Text != "")
            {
                s += mabn.Text + "','";
            }
            if (s.Length > 1)
            {
                s    = s.Substring(0, s.Length - 2);
                sql  = "select f.ten as donvi,a.mabn,a.hoten,a.namsinh,case when a.phai=1 then 'Nữ' else 'Nam' end as phai,";
                sql += "to_char(b.ngay,'dd/mm/yyyy') as ngay,c.ten,c.ketqua,b.ketluan,e.ten as loai,d.hoten as tenbs ";
                sql += " from " + xxx + ".ct_btdbn a inner join " + xxx + ".ct_ketqua b on a.mabn=b.mabn ";
                sql += " inner join " + xxx + ".ct_chitiet c on b.id=c.id ";
                sql += " left join " + user + ".dmbs d on b.mabs=d.ma ";
                sql += " inner join " + user + ".ct_loai e on b.loai=e.id ";
                sql += " inner join " + user + ".ct_donvi f on a.iddonvi=f.id ";
                if (chkAll.Checked)
                {
                    sql += " where f.iddoan=" + l_doan;
                }
                else
                {
                    sql += " where a.mabn in (" + s + ")";
                }
                sql += " order by f.stt,a.stt,c.stt";
                DataSet dsxml = m.get_data(sql);
                if (dsxml.Tables[0].Rows.Count > 0)
                {
                    dllReportM.frmReport f = new dllReportM.frmReport(m, dsxml, s_doan, "rptKetquaksk.rpt");
                    f.ShowDialog();
                }
                else
                {
                    MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg);
                }
            }
            else
            {
                MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg);
            }
        }
Beispiel #24
0
        private void butInReport_Click(object sender, System.EventArgs e)
        {
            if (ds.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), AccessData.Msg);
                return;
            }
            string msg = "Phòng lưu";

            dllReportM.frmReport f = new dllReportM.frmReport(m, ds, msg, "dshiendien.rpt");
            f.Show();
        }
Beispiel #25
0
 private void butIn_Click(object sender, System.EventArgs e)
 {
     if (ds.Tables[0].Rows.Count == 0)
     {
         MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg);
     }
     else
     {
         dllReportM.frmReport f = new dllReportM.frmReport(m, ds.Tables[0], "m_doichieu.rpt", (tu.Text == den.Text)?"Ngày " + tu.Text:"Từ ngày " + tu.Text + " đến " + den.Text, (madoituong.SelectedIndex != -1)?madoituong.Text:"", (tenloai.SelectedIndex != -1)?tenloai.Text:"", (tenkp.SelectedIndex != -1)?tenkp.Text:"", "", "", "", "", "", "");
         f.ShowDialog();
     }
 }
Beispiel #26
0
		private void butInReport_Click(object sender, System.EventArgs e)
		{
			if (ds.Tables[0].Rows.Count==0)
			{
				MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"),AccessData.Msg);
				return;
			}
			string msg;
			if (makp.SelectedIndex!=-1) msg="Khoa "+" "+makp.Text.ToString();
			else msg="Toàn viện";
			dllReportM.frmReport f = new dllReportM.frmReport(m,ds,msg,"dshiendien.rpt");
			f.Show();
		}
Beispiel #27
0
 private void butIn_Click(object sender, System.EventArgs e)
 {
     if (m.bInchidinh_dien)
     {
         foreach (DataRow r in ds.Tables[0].Select("chon=true"))
         {
             DLLPrintchidinh.frmPrintchidinh f1 = new DLLPrintchidinh.frmPrintchidinh();
             f1.f_Print_Chidinh(false, r["mabn"].ToString(), r["maql"].ToString(), "", ngay.Text.Substring(0, 10), "");
             m.execute_data("update " + xxx + ".v_chidinh set lan=lan+1 where mabn='" + r["mabn"].ToString() + "' and to_char(ngay,'dd/mm/yyyy')='" + ngay.Text + "' and loai=2 and makp='" + r["ghichu"].ToString() + "'");
         }
     }
     else
     {
         dsxml.Clear();
         string sid = "";
         foreach (DataRow r in ds.Tables[0].Select("chon=true"))
         {
             sid += r["id"].ToString() + ",";
             sql  = "update " + xxx + ".v_chidinh set lan=lan+1 where id=" + decimal.Parse(r["id"].ToString());
             m.execute_data(sql);
         }
         if (sid == "")
         {
             MessageBox.Show(lan.Change_language_MessageText("Đề nghị chọn bệnh nhân !"), LibMedi.AccessData.Msg);
             try
             {
                 mabn.Focus();
             }
             catch {}
             return;
         }
         in_toa(sid);
         if (dsxml.Tables[0].Rows.Count > 0)
         {
             if (chkXem.Checked)
             {
                 dllReportM.frmReport f = new dllReportM.frmReport(m, dsxml, "", "rptChidinh.rpt", true);
                 f.ShowDialog();
             }
             else
             {
                 print.Printer(m, dsxml, "rptChidinh.rpt", "", 1);
             }
         }
         else
         {
             MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg);
         }
     }
     butTim_Click(sender, e);
 }
Beispiel #28
0
        private void butIn_Click(object sender, EventArgs e)
        {
            if (ds.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show(lan.Change_language_MessageText("Không có số liệu!"), LibMedi.AccessData.Msg);
                return;
            }
            DataSet dstmp = new DataSet();

            dstmp.Tables.Add(ds.Tables[0].Clone());

            dstmp.Tables[0].Columns.Add("hoten");
            dstmp.Tables[0].Columns["hoten"].DefaultValue = s_hoten;
            dstmp.Tables[0].Columns.Add("tuoi");
            dstmp.Tables[0].Columns["tuoi"].DefaultValue = s_tuoi;
            dstmp.Tables[0].Columns.Add("gioi");
            dstmp.Tables[0].Columns["gioi"].DefaultValue = s_phai;
            dstmp.Tables[0].Columns.Add("diachi");
            dstmp.Tables[0].Columns["diachi"].DefaultValue = s_diachi;
            dstmp.Tables[0].Columns.Add("dienthoai");
            dstmp.Tables[0].Columns["dienthoai"].DefaultValue = s_dienthoai;
            dstmp.Tables[0].Columns.Add("doituong");
            dstmp.Tables[0].Columns["doituong"].DefaultValue = s_doituong;
            dstmp.Tables[0].Columns.Add("bacsi");
            dstmp.Tables[0].Columns["bacsi"].DefaultValue = txtChidinh.Text.Trim();
            dstmp.Tables[0].Columns.Add("chandoan");
            dstmp.Tables[0].Columns["chandoan"].DefaultValue = s_chandoan;
            DataRow r  = dstmp.Tables[0].NewRow();
            DataRow r1 = m.getrowbyid(ds.Tables[0], "id=" + d_id);

            //id,mabn,to_char(ngay,'dd/mm/yyyy hh24:mi') ngay,mabs,sieuam,keodan,dien,tutruong,apsuat,khac

            for (int i = 0; i < r1.Table.Columns.Count; i++)
            {
                r[i] = r1[i];
            }
            dstmp.Tables[0].Rows.Add(r);
            if (chkXml.Checked)
            {
                if (!System.IO.Directory.Exists("..\\..\\dataxml"))
                {
                    System.IO.Directory.CreateDirectory("..\\..\\dataxml");
                }
                dstmp.WriteXml("..\\..\\dataxml\\rptPhieutheodoivltl.xml", XmlWriteMode.WriteSchema);
            }
            dllReportM.frmReport f = new dllReportM.frmReport(m, dstmp.Tables[0], "rptPhieutheodoivltl.rpt", "", "", "", "", "", "", "", "", "", "");
            f.ShowDialog();
            dllReportM.frmReport f1 = new dllReportM.frmReport(m, ds.Tables[0], "rptPhieutheodoivltl1.rpt", "", "", "", "", "", "", "", "", "", "");
            f1.ShowDialog();
        }
Beispiel #29
0
 private void butIn_Click(object sender, System.EventArgs e)
 {
     if (manhom.SelectedIndex == -1)
     {
         manhom.Focus();
         return;
     }
     s_makp = ""; s_madoituong = "";
     for (int i = 0; i < makp.Items.Count; i++)
     {
         if (makp.GetItemChecked(i))
         {
             s_makp += "'" + dtmakp.Rows[i]["makp"].ToString().Trim() + "',";                                                              //Tu: 22/08/2011
         }
     }
     for (int i = 0; i < madoituong.Items.Count; i++)
     {
         if (madoituong.GetItemChecked(i))
         {
             s_madoituong += dtmadt.Rows[i]["madoituong"].ToString().Trim() + ",";
         }
     }
     int yy1 = int.Parse(tu.Text.Substring(8, 2)), yy2 = int.Parse(den.Text.Substring(8, 2));
     ds.Clear();
     dsxml.Clear();
     if (rb1.Checked)
     {
         get_data("v_vpkhoa");
         get_data("v_chidinh");
     }
     else if (rb2.Checked)
     {
         get_data("v_chidinh");
     }
     else
     {
         get_data("v_vpkhoa");
     }
     dsxml.Merge(ds.Tables[0].Select("soluong>0", "loaivp,tenvp"));
     if (dsxml.Tables[0].Rows.Count > 0)
     {
         dllReportM.frmReport f = new dllReportM.frmReport(m, dsxml, (tu.Text == den.Text)?" Ngày " + tu.Text:"Từ ngày " + tu.Text + " đến " + den.Text, "rptDscdvp.rpt");
         f.ShowDialog();
     }
     else
     {
         MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), LibMedi.AccessData.Msg);
     }
 }
Beispiel #30
0
 private void butIn_Click(object sender, System.EventArgs e)
 {
     try
     {
         if (ds.Tables[0].Rows.Count == 0)
         {
             MessageBox.Show(lan.Change_language_MessageText("Không có số liệu !"), AccessData.Msg);
             return;
         }
         string tuden           = (tu.Text == "")?"":" Từ ngày " + tu.Text + " đến " + den.Text;
         dllReportM.frmReport f = new dllReportM.frmReport(m, ds, solieu.Text.ToUpper() + " " + tuden, "rptTknhiem.rpt");
         f.ShowDialog();
     }
     catch {}
 }