Exemple #1
0
        private void frmPhieuxuat_ng_Load(object sender, System.EventArgs e)
        {
            user       = d.user; stime = "'" + d.f_ngay + "'";
            i_dongiale = d.d_dongia_le(i_nhom);
            sql        = "select * from " + user + ".d_duockp ";
            sql       += " where nhom like '%" + i_nhom.ToString() + ",%'";
            if (s_makp != "")
            {
                string s = s_makp.Replace(",", "','");
                sql += " and makp in ('" + s.Substring(0, s.Length - 3) + "')";
            }
            sql               += " order by stt";
            dtkp               = d.get_data(sql).Tables[0];
            makp.DataSource    = dtkp;
            makp.DisplayMember = "TEN";
            makp.ValueMember   = "ID";

            sql = "select * from " + user + ".d_dmloaint where nhom=" + i_nhom;
            if (s_loaint != "")
            {
                sql += " and id in (" + s_loaint.Substring(0, s_loaint.Length - 1) + ")";
            }
            sql               += " order by stt";
            dtloai             = d.get_data(sql).Tables[0];
            loai.DataSource    = dtloai;
            loai.DisplayMember = "TEN";
            loai.ValueMember   = "ID";

            sql  = "select a.*,b.stt as sttnhom,b.ten as tennhom,c.ten as tenhang ";
            sql += " from " + user + ".d_dmbd a," + user + ".d_dmnhom b," + user + ".d_dmhang c where a.manhom=b.id and a.mahang=c.id and a.nhom=" + i_nhom;
            dt   = d.get_data(sql).Tables[0];

            s_makho = d.get_dmkho(7).Trim();
            s_makho = (s_makho == "") ? "" : s_makho.Substring(0, s_makho.Length - 1);

            sql = "select * from " + user + ".d_dmkho where hide=0 and nhom=" + i_nhom;
            if (s_makho != "")
            {
                sql += " and id in (" + s_makho + ")";
            }
            sql              += " order by stt";
            dtdmkho           = d.get_data(sql).Tables[0];
            kho.DataSource    = dtdmkho;
            kho.DisplayMember = "TEN";
            kho.ValueMember   = "ID";

            ds.ReadXml("..//..//..//xml//d_thkhoa.xml");
            dsxml.ReadXml("..//..//..//xml//d_thkhoa.xml");
        }