Exemple #1
0
        public TinhGiaForm(ThongTinBanDauChoTinhGia thongTinBanDau)
        {
            InitializeComponent();
            this.TinhTrangForm = thongTinBanDau.TinhTrangForm;
            this.TenNhanVien   = thongTinBanDau.TenNguoiDung;
            this.TieuDeTinhGia = "Tính giá";
            //Rồi mới tiếp tục
            tinhGiaPres = new TinhGiaPresenter(this);
            tinhGiaPres.NoiDungBanDau();
            LoadHangKhachHang();
            cboHangKH.SelectedIndex = 0;

            //event
            this.FormClosing += new FormClosingEventHandler(Forms_FormClosing);

            lvwBaiIn.SelectedIndexChanged     += new EventHandler(ListView_SelectedIndexChanged);
            lvwDanhThiep.SelectedIndexChanged += new EventHandler(ListView_SelectedIndexChanged);
            lvwCuon.SelectedIndexChanged      += new EventHandler(ListView_SelectedIndexChanged);
            lvwTheNhua.SelectedIndexChanged   += new EventHandler(ListView_SelectedIndexChanged);

            txtTieuDeTinhGia.TextChanged += new EventHandler(TextBoxe_TextChanged);
            txtTenNV.TextChanged         += new EventHandler(TextBoxe_TextChanged);
            txtTenKhachHang.TextChanged  += new EventHandler(TextBoxe_TextChanged);
            dtpNgay.ValueChanged         += new EventHandler(TextBoxe_TextChanged);
            //
        }
Exemple #2
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.TenNguoiDung))
            {
                MessageBox.Show("Bạn cần điền tên người dùng");
                return;
            }
            var thongTinBanDau = new ThongTinBanDauChoTinhGia();

            thongTinBanDau.TenNguoiDung  = this.TenNguoiDung;
            thongTinBanDau.TinhTrangForm = FormStateS.New;
            //Kiểm tra người dùng có trong database không
            var nguoiDung = NguoiDung.DocTheoTenDangNhap(thongTinBanDau.TenNguoiDung);

            if (nguoiDung.ID == 0)
            {
                MessageBox.Show("Bạn chưa có tài khoản sử dụng");
                return;
            }

            var frm = new TinhGiaForm(thongTinBanDau);

            frm.MaximizeBox = false;
            frm.MinimizeBox = false;

            //frm.FormState = (int)Ennums.FormState.New;
            frm.Text = "Tính giá sản phẩm";
            frm.ShowDialog();
        }
        public void ThemTinhGia(ClientMainForm parentMDIForm)
        {
            var thongTinBanDau = new ThongTinBanDauChoTinhGia();

            thongTinBanDau.TenNguoiDung  = "";
            thongTinBanDau.TinhTrangForm = FormStateS.New;

            this.WindowState = FormWindowState.Maximized;
            var frm = new TinhGiaForm(thongTinBanDau);

            frm.MaximizeBox = false;
            frm.MinimizeBox = false;
            frm.MdiParent   = parentMDIForm;
            //frm.FormState = (int)Ennums.FormState.New;
            frm.Text = "Tính giá sản phẩm";
            frm.Show();
        }