Exemple #1
0
        private void butIn_Click(object sender, System.EventArgs e)
        {
            s_mmyy = mm.Value.ToString().PadLeft(2, '0') + yyyy.Value.ToString().PadLeft(4, '0').Substring(2, 2);
            ds.Clear();
            Loc();
            ds.Merge(ttb.get_tondau(ds, dt, s_mmyy, -1, (manguon.SelectedIndex == -1)?-1:int.Parse(manguon.SelectedValue.ToString()), i_nhom));
            ds.Merge(ttb.get_nhap(ds, dt, dtkp, tmpkho, s_mmyy.Substring(0, 2), s_mmyy.Substring(0, 2), s_mmyy.Substring(2, 2), -1, (manguon.SelectedIndex == -1)?-1:int.Parse(manguon.SelectedValue.ToString()), i_nhom));
            ds.Merge(ttb.get_xuat(ds, dt, dtkp, dtloaint, dtkhac, tmpkho, s_mmyy.Substring(0, 2), s_mmyy.Substring(0, 2), s_mmyy.Substring(2, 2), -1, (manguon.SelectedIndex == -1)?-1:int.Parse(manguon.SelectedValue.ToString()), i_nhom));
            get_sort();
            if (dsxml.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("Không có số liệu !", ttb.Msg);
                return;
            }
            frmReport f = new frmReport(ttb, dsxml.Tables[0], "d_sochitiet.rpt", ttb.Thongso("ttb_thongso", "kho"), "Tháng " + mm.Value.ToString().PadLeft(2, '0') + " năm " + yyyy.Value.ToString(), (manguon.SelectedIndex == -1)?"":manguon.Text, "", "", "", "", "", "", "");

            f.ShowDialog();
        }
Exemple #2
0
 private void rptBctheonhom_Load(object sender, System.EventArgs e)
 {
     ds.ReadXml("..\\..\\..\\xml\\ttb_bctheoloai.xml");
     dsxml.ReadXml("..\\..\\..\\xml\\ttb_bctheoloai.xml");
     dtdmnhom = ttb.get_data("select * from ttb_dmnhom where stt<>0 and nhom=" + i_nhom + " order by stt").Tables[0];
     manguon.DisplayMember = "TEN";
     manguon.ValueMember   = "ID";
     if (ttb.bQuanlynguon(i_nhom))
     {
         manguon.DataSource = ttb.get_data("select * from ttb_dmnguon where nhom=" + i_nhom + " order by stt").Tables[0];
     }
     else
     {
         manguon.DataSource = ttb.get_data("select * from ttb_dmnguon where id=0 or nhom=" + i_nhom + " order by stt").Tables[0];
     }
     nhomcc.DisplayMember = "TEN";
     nhomcc.ValueMember   = "ID";
     if (ttb.bQuanlynhomcc(i_nhom))
     {
         nhomcc.DataSource = ttb.get_data("select * from ttb_nhomcc where nhom=" + i_nhom + " order by stt").Tables[0];
     }
     else
     {
         nhomcc.DataSource = ttb.get_data("select * from ttb_nhomcc where id=0 or nhom=" + i_nhom + " order by stt").Tables[0];
     }
     dt  = ttb.get_data("select a.*,b.ten tennhom from ttb_dmbd a,ttb_dmnhom b where a.manhom=b.id and a.nhom=" + i_nhom + " order by a.id").Tables[0];
     sql = "select * from ttb_dmkho where nhom=" + i_nhom;
     if (s_makho != "")
     {
         sql += " and id in (" + s_makho.Substring(0, s_makho.Length - 1) + ")";
     }
     sql                 += " order by stt";
     dtdmkho              = ttb.get_data(sql).Tables[0];
     kho.DisplayMember    = "TEN";
     kho.ValueMember      = "ID";
     kho.DataSource       = dtdmkho;
     manhom.DisplayMember = "TEN";
     manhom.ValueMember   = "ID";
     manhom.DataSource    = dtdmnhom;
     s_manhom             = ttb.Thongso("manhom").Trim();
 }