Example #1
0
        private void btnXoa_Click(object sender, EventArgs e)
        {
            if (fgQD.Row < fgQD.Rows.Fixed)
            {
                BaseMessages.ShowInformationMessage("Chưa chọn quyết định.");
                return;
            }
            if (BaseMessages.ShowDeleteQuestionMessage() == DialogResult.No)
            {
                return;
            }

            clsQD_NhapVatTu cls = new clsQD_NhapVatTu();

            cls.ID_QuyetDinh = int.Parse(fgQD.GetDataDisplay(fgQD.Row, "ID_QuyetDinh"));
            cls.SelectOne();
            cls.TonTai = false;
            cls.Update();
            BaseMessages.ShowInformationMessage("Xóa thành công!");

            LockEdit(true);
            Loadfg();

            ResetTextboxs();
            fgChiTiet.Rows.Count = fgChiTiet.Rows.Fixed;
        }
Example #2
0
        private void Duyet(string question, byte trangthai, string message)
        {
            if (fgQD.Row < fgQD.Rows.Fixed)
            {
                BaseMessages.ShowInformationMessage("Chưa chọn quyết định.");
                return;
            }
            if (MessageBox.Show(question, "Xác nhận", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }

            int  fgRow             = fgQD.Row;
            byte previousTrangThai = Convert.ToByte(fgQD[fgQD.Row, "TrangThai"]);

            clsQD_NhapVatTu cls = new clsQD_NhapVatTu();

            cls.ID_QuyetDinh = int.Parse(fgQD.GetDataDisplay(fgQD.Row, "ID_QuyetDinh"));
            cls.SelectOne();
            cls.TrangThai = trangthai;
            cls.Update();
            BaseMessages.ShowInformationMessage(message);
            if (trangthai == 1)
            {
                fgQD[fgQD.Row, "Ten_TrangThai"] = "Trình duyệt";
                fgQD[fgQD.Row, "TrangThai"]     = 1;
                fgQD.Rows[fgQD.Row].Style       = cs2;
            }
            else if (trangthai == 3)
            {
                fgQD[fgQD.Row, "Ten_TrangThai"] = "Hủy duyệt";
                fgQD[fgQD.Row, "TrangThai"]     = 3;
                fgQD.Rows[fgQD.Row].Style       = cs3;
                CapNhatSLVatTuKhoVer2(Convert.ToInt32(fgQD.GetDataDisplay(fgQD.Row, "ID_QuyetDinh")), 3);
            }
            else if (trangthai == 5)
            {
                fgQD[fgQD.Row, "Ten_TrangThai"] = "Phê duyệt";
                fgQD[fgQD.Row, "TrangThai"]     = 5;
                fgQD.Rows[fgQD.Row].Style       = cs4;
            }
            else if (trangthai == 6)
            {
                fgQD[fgQD.Row, "Ten_TrangThai"] = "Ghi thẻ kho";
                fgQD[fgQD.Row, "TrangThai"]     = 6;
                fgQD.Rows[fgQD.Row].Style       = cs5;
                CapNhatSLVatTuKhoVer2(Convert.ToInt32(fgQD.GetDataDisplay(fgQD.Row, "ID_QuyetDinh")), 6);
            }
            LockEdit(true);
            Lock(false, false, false, false, false, false);
            fgQD.Row = -1;

            ResetTextboxs();
            fgChiTiet.Rows.Count = fgChiTiet.Rows.Fixed;
            //focus
            fgQD.Row = fgRow;
        }