Exemple #1
0
        private void btnHoanTat_Click_1(object sender, EventArgs e)
        {
            var result = MessageBox.Show("Bạn có muốn lưu sự thay đổi xuống cơ sở dữ liệu hay không?", "Lưu thông tin", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                KiemKho_View kiemkhoNew = new KiemKho_View();
                kiemkhoNew.MaKiemKho = txtMaPhieu.Text;
                kiemkhoNew.NgayKiem  = dateNgayBan.Value;
                kiemkhoNew.NhanVien  = Context.getInstance().nv.MaNhanVien;
                kiemkhoNew.TrangThai = 1;

                foreach (var item in ct_kiemkhos)
                {
                    item.MaKiemKho = kiemkhoNew.MaKiemKho;
                    if (item.TonSoSach == 0)
                    {
                        item.TonSoSach = item.SoLuong;
                    }
                    item.ChenhLech = item.SoLuong - item.TonSoSach;
                    dt.Inserts.Add(item.toCT_KiemKho());
                }

                if (KiemKho_DAL.add_KiemKho(kiemkhoNew, dt))
                {
                    MessageBox.Show("Lưu thông tin thành công!");
                }
                else
                {
                    MessageBox.Show("Đã có lỗi xảy ra, vui lòng kiểm tra dữ liệu!");
                }
            }
        }
Exemple #2
0
        private void UpdateGridView()
        {
            string maThuongHieu = this.list_NCC[cbxNhomHang.SelectedIndex].MaThuongHieu;

            this.ct_kiemkhos        = KiemKho_DAL.get_AllLinhKien(maThuongHieu);
            gridControl1.DataSource = this.ct_kiemkhos;// KiemKho_DAL.get_AllLinhKien(maThuongHieu);// this.list_KiemKho;
            gridControl1.RefreshDataSource();
        }
Exemple #3
0
        private void InnitVal()
        {
            this.list_NCC    = new List <ThuongHieu_View>();
            this.kiemkho     = new KiemKho_View();
            this.ct_kiemkhos = new List <CT_KiemKho_View>();
            this.dt          = new DataUpdate <CT_KIEMKHO>();
            txtNhanVien.Text = Context.getInstance().nv.TenNhanVien;
            txtMaPhieu.Text  = KiemKho_DAL.getMaxKiemKho(1);

            setCbxThuongHieu("");
            UpdateGridView();
        }