示例#1
0
        private void frmThuhoi_Load(object sender, System.EventArgs e)
        {
            user = d.user; xxx = user + s_mmyy;
            f_capnhat_db(s_mmyy);
            //
            bNguoiduyet_nguoithuhoi = d.bNguoiduyet_nguoithuhoi(i_nhom);
            bIntheocstt             = d.bIntheocstt(i_nhom);
            if (bIntheocstt && i_loai == 2)
            {
                label1.Text = "Tủ trực :";
            }
            if (bBuhaophi)
            {
                s_noidung = "PHIEU HAO PHI";
            }
            else
            {
                switch (i_loai)
                {
                case 1: s_noidung = "PHIEU LINH";
                    break;

                case 2: s_noidung = "PHIEU TU TRUC";
                    break;

                case 3: s_noidung = "PHIEU HOAN TRA";
                    break;

                default: s_noidung = "PHIEU HAO PHI";
                    break;
                }
            }
            bKiemtra            = d.bKiemtra_phat_thuhoi(i_nhom);
            phieu.DisplayMember = "TEN";
            phieu.ValueMember   = "ID";
            phieu.DataSource    = dtphieu;
            if (i_phieu != -1)
            {
                phieu.SelectedValue = i_phieu.ToString();
            }
            else
            {
                phieu.SelectedIndex = 0;
            }

            makp.DisplayMember = "TEN";
            makp.ValueMember   = "ID";
            makp.DataSource    = dtkp;
            if (i_makp != -1)
            {
                makp.SelectedValue = i_makp.ToString();
            }
            else
            {
                makp.SelectedIndex = 0;
            }
            b1kho = d.b1kho(s_makho);
            load_phieu();
        }
示例#2
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();
        }