Exemple #1
0
        private void frmTuden_Load(object sender, System.EventArgs e)
        {
            chkChuyen.Visible = i_loai == 2;
            if (d.bIntheocstt(i_nhom) && i_loai == 2)
            {
                label3.Text = "Tủ trực :";
            }
            user = d.user; xxx = user + s_mmyy; f_ngay = d.f_ngay;
            load_ngay_duyet();
            phieu.DisplayMember = "TEN";
            phieu.ValueMember   = "ID";
            phieu.DataSource    = dtphieu;
            phieu.SelectedValue = i_phieu.ToString();

            makp.DisplayMember = "TEN";
            makp.ValueMember   = "ID";
            makp.DataSource    = dtkp;
            makp.SelectedValue = i_makp.ToString();
            if (makp.Items.Count > 0)
            {
                kp.Text = dtkp.Rows[makp.SelectedIndex]["ma"].ToString();
            }
            string sql = "select * from " + user + ".d_loaiphieu ";

            if (bThua)
            {
                sql += " where id=0";
            }
            else
            {
                sql += " where nhom=" + i_nhom + " and loai=" + i_loai;
                sql += " and id<>0 order by stt";
            }
            dtph = d.get_data(sql).Tables[0];
            phieudutru.DataSource    = dtph;
            phieudutru.DisplayMember = "TEN";
            phieudutru.ValueMember   = "ID";
            if (!d.bLocphieu_duyet(i_nhom) && !bCongdon && i_loai != 2)
            {
                Check_phieu_default();
            }
            else if (!d.bLocphieu_bu_khiduyet(i_nhom) && !bCongdon && i_loai == 2)
            {
                Check_phieu_default();
            }
            load_phieu();
        }