예제 #1
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();
        }
예제 #2
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();
		}
예제 #3
0
        private void butIn_Click(object sender, EventArgs e)
        {
            DataSet ds_in = new DataSet();
            string  nv1 = "", nv2 = "", nv3 = "", nv4 = "";
            string  cv1 = "", cv2 = "", cv3 = "", cv4 = "";
            string  s_ngayin = "";

            sql  = " select a.mabn,c.hoten,c.namsinh,case when phai=1 then 'Nữ' else 'Nam' end as phai,e.tennn,trim(c.sonha)||' '||trim(c.thon)||' '||trim(i.tenpxa)||','||trim(h.tenquan)||','||trim(g.tentt) as diachi,a.*,ct.hoten as chutoa,tk.hoten as thuky,khth.hoten as khth";
            sql += ",0 as stt, ' ' as chucvu1,' ' as tennv1, ' ' as chucvu2,' ' as tennv2, ' ' as chucvu3,' ' as tennv3, ' ' as chucvu4,' ' as tennv4, a.maql ";//binh230908
            sql += ", c.phai as gioitinh";
            //sql += " from medibv.bbtuvong a left join medibv.bbtuvongnv b on a.maql=b.maql inner join medibv.btdbn c on a.mabn=c.mabn inner join medibv.btdnn_bv e on c.mann=e.mann inner join medibv.btddt f on c.madantoc=f.madantoc inner join medibv.btdtt g on c.matt=g.matt inner join medibv.btdquan h on c.maqu=h.maqu inner join medibv.btdpxa i on c.maphuongxa=i.maphuongxa";
            sql  += " from medibv.bbtuvong a inner join medibv.btdbn c on a.mabn=c.mabn inner join medibv.btdnn_bv e on c.mann=e.mann inner join medibv.btddt f on c.madantoc=f.madantoc inner join medibv.btdtt g on c.matt=g.matt inner join medibv.btdquan h on c.maqu=h.maqu inner join medibv.btdpxa i on c.maphuongxa=i.maphuongxa ";
            sql  += " inner join medibv.dmbs ct on a.chutoa=ct.ma inner join medibv.dmbs tk on a.thuky=tk.ma inner join medibv.dmbs khth on a.khth=khth.ma";// inner join medibv.dmbs nv on b.manv=nv.ma";
            sql  += " where a.maql=" + ngayvao.SelectedValue.ToString() + "";
            ds_in = m.get_data(sql);
            //
            //
            sql = "select a.*, b.hoten as tennv from medibv.bbtuvongnv a, medibv.dmbs b where a.manv=b.ma and a.maql=" + ngayvao.SelectedValue.ToString() + " order by a.stt";
            DataSet lds = m.get_data(sql);
            int     ii  = 0;

            foreach (DataRow r in lds.Tables[0].Rows)
            {
                ii += 1;
                string  s_exp = "maql=" + ngayvao.SelectedValue.ToString() + "";;
                DataRow ldr   = m.getrowbyid(ds_in.Tables[0], s_exp);
                if (ldr != null)
                {
                    ldr["chucvu" + ii.ToString()] = r["chucvu"].ToString();
                    ldr["tennv" + ii.ToString()]  = r["tennv"].ToString();
                }
                //
                if (r["stt"].ToString() == "1")
                {
                    nv1 = r["tennv"].ToString();
                    cv1 = r["chucvu"].ToString();
                }
                else if (r["stt"].ToString() == "2")
                {
                    nv2 = r["tennv"].ToString();
                    cv2 = r["chucvu"].ToString();
                }
                else if (r["stt"].ToString() == "3")
                {
                    nv3 = r["tennv"].ToString();
                    cv3 = r["chucvu"].ToString();
                }
                else if (r["stt"].ToString() == "4")
                {
                    nv4 = r["tennv"].ToString();
                    cv4 = r["chucvu"].ToString();
                }
            }
            ds_in.AcceptChanges();
            //

            /*
             * foreach (DataRow r in ds_in.Tables[0].Select("stt=1"))
             * {
             *  nv1 = r["tennv"].ToString();
             *  cv1 = r["chucvu"].ToString();
             * }
             * foreach (DataRow r in ds_in.Tables[0].Select("stt=2"))
             * {
             *  nv2 = r["tennv"].ToString();
             *  cv2 = r["chucvu"].ToString();
             * }
             * foreach (DataRow r in ds_in.Tables[0].Select("stt=3"))
             * {
             *  nv3 = r["tennv"].ToString();
             *  cv3 = r["chucvu"].ToString();
             * }
             * foreach (DataRow r in ds_in.Tables[0].Select("stt=4"))
             * {
             *  nv4 = r["tennv"].ToString();
             *  cv4 = r["chucvu"].ToString();
             * }
             */
            s_ngayin = "Ngày " + DateTime.Now.Day.ToString() + " tháng " + DateTime.Now.Month.ToString() + " năm " + DateTime.Now.Year.ToString() + "";

            if (chkXML.Checked)
            {
                if (!System.IO.Directory.Exists("..//xml"))
                {
                    System.IO.Directory.CreateDirectory("..//xml");
                }
                ds_in.WriteXml("..//xml//tuvong.xml", XmlWriteMode.WriteSchema);
            }
            dllReportM.frmReport f = new dllReportM.frmReport(m, ds_in.Tables[0], "rpt_bienbankiemtuvong.rpt", nv1, cv1, nv2, cv2, nv3, cv3, nv4, cv4, s_ngayin, "");
            f.Show();
        }