Пример #1
0
        private void frmInphieuxuat_Load(object sender, System.EventArgs e)
        {
            user          = d.user; stime = "'" + d.f_ngay + "'";
            loai.Enabled  = d.bChonloaiphieu_xuat(i_nhom);
            phieu.Enabled = loai.Enabled;
            imp.Visible   = m.Mabv_so == 701424;
            ds.ReadXml("..\\..\\..\\xml\\d_xuatkho.xml");
            ds.Tables[0].Columns.Add("manhom", typeof(decimal)).DefaultValue = 0;
            ds.Tables[0].Columns.Add("tennhom");
            //dsxml.ReadXml("..\\..\\..\\xml\\d_xuatkho.xml");
            dsxml = ds.Copy();
            makp.DisplayMember = "TEN";
            makp.ValueMember   = "ID";

            dtloai             = d.get_data("select * from " + user + ".d_dmphieu where id<5 order by stt").Tables[0];
            loai.DataSource    = dtloai;
            loai.DisplayMember = "TEN";
            loai.ValueMember   = "ID";

            phieu.DisplayMember = "TEN";
            phieu.ValueMember   = "ID";

            makho.DisplayMember = "TEN";
            makho.ValueMember   = "ID";

            nhom.DisplayMember = "TEN";
            nhom.ValueMember   = "ID";
            load_nhom();
            load_makp();
            load_makho();

            load_dmnhom();
            dmnhom.DisplayMember = "TEN";
            dmnhom.ValueMember   = "ID";
        }
Пример #2
0
 private void load_nhom()
 {
     sql = "select * from " + user + ".d_dmnhomkho ";
     if (s_nhomkho != "")
     {
         sql += " where id in (" + s_nhomkho.Substring(0, s_nhomkho.Length - 1) + ")";
     }
     sql            += " order by stt";
     nhom.DataSource = d.get_data(sql).Tables[0];
     i_nhom          = (nhom.SelectedIndex != -1)?int.Parse(nhom.SelectedValue.ToString()):0;
     loai.Enabled    = d.bChonloaiphieu_xuat(i_nhom);
     phieu.Enabled   = loai.Enabled;
 }