Esempio n. 1
0
        public void Loadfg()
        {
            fgQDX.Tag = 0;
            fgQDX.BeginUpdate();
            clsQD_XuatVatTu cls = new clsQD_XuatVatTu();
            DataTable       dt  = cls.SelectAllDayDu();

            dt.DefaultView.RowFilter = "TonTai = 1";
            int iSTT = 1;

            fgQDX.Rows.Count = fgQDX.Rows.Fixed;
            foreach (DataRow dr in dt.DefaultView.ToTable().Rows)
            {
                Row fgRow = fgQDX.Rows.Add();
                fgRow["STT"] = iSTT;
                iSTT++;
                fgRow["ID_PhieuXuat"]   = dr["ID_PhieuXuat"];
                fgRow["ID_Kho"]         = dr["ID_Kho"];
                fgRow["Ten_kho"]        = dr["Ten_kho"];
                fgRow["So_PhieuXuat"]   = dr["So_PhieuXuat"];
                fgRow["Ngay_XuatKho"]   = dr["Ngay_XuatKho"];
                fgRow["Ngay_HachToan"]  = dr["Ngay_HachToan"];
                fgRow["Nguoi_Lap"]      = dr["Nguoi_Lap"];
                fgRow["Ngay_Lap"]       = dr["Ngay_Lap"];
                fgRow["Nguoi_PheDuyet"] = dr["Nguoi_PheDuyet"];
                fgRow["Ngay_PheDuyet"]  = dr["Ngay_PheDuyet"];
                fgRow["TrangThai"]      = dr["TrangThai"];
                fgRow["Ten_TrangThai"]  = dr["Ten_TrangThai"];
                fgRow["TonTai"]         = dr["TonTai"];
                if (fgRow["Ten_TrangThai"].ToString() == "Đang lập")
                {
                    fgRow.Style = cs1;
                }
                if (fgRow["Ten_TrangThai"].ToString() == "Trình duyệt")
                {
                    fgRow.Style = cs2;
                }
                else if (fgRow["Ten_TrangThai"].ToString() == "Hủy duyệt")
                {
                    fgRow.Style = cs3;
                }
                else if (fgRow["Ten_TrangThai"].ToString() == "Phê duyệt")
                {
                    fgRow.Style = cs4;
                }
                else if (fgRow["Ten_TrangThai"].ToString() == "Ghi thẻ kho")
                {
                    fgRow.Style = cs5;
                }
            }

            fgQDX.Row = -1;
            fgQDX.AutoSizeRows();
            fgQDX.EndUpdate();
            fgQDX.Tag = 1;
        }
Esempio n. 2
0
        private void LoadTrangThai()
        {
            var cbo = cboTrangThai;

            cbo.Tag = 0;
            clsQD_XuatVatTu cls = new clsQD_XuatVatTu();
            DataTable       dt  = cls.SelectAllDayDu();

            dt = dt.DefaultView.ToTable();
            //cbo.Properties.DataSource = dt;
            //cbo.Properties.DisplayMember = "Ten_TrangThai";
            //cbo.Properties.ValueMember = "TrangThai";
            //cbo.EditValue = 0;
            cbo.Tag = 1;
        }