Exemplo n.º 1
0
        public M_PhieuNoEdit() // them chay
        {
            Edit = 0;
            InitializeComponent();

            comboBoxPhieuBan.DataSource    = PhieuBanBLL.SelectTop(0);
            comboBoxPhieuBan.ValueMember   = "SoPhieuBan";
            comboBoxPhieuBan.DisplayMember = "SoPhieuBan";

            txtSoPhieuNo.Text    = PhieuNoBLL.GetSoPhieuNo().ToString();
            txtSoPhieuNo.Enabled = false;
        }
Exemplo n.º 2
0
        private void M_PhieuBanHanhEdit_Load(object sender, EventArgs e)
        {
            dateTimePickerNgayBan.MaxDate   = DateTime.Now;
            comboBoxKhachHang.DataSource    = KhachHang.SelectTop(0);
            comboBoxKhachHang.ValueMember   = "MaKH";
            comboBoxKhachHang.DisplayMember = "TenKh";


            txtSPhieu.Text = SoPhieuBan.ToString();
            if (Edit == 1)
            {
                PhieuBanHang_DTO phieuban = new PhieuBanHang_DTO();
                phieuban = PhieuBan.SelectTop(SoPhieuBan, 0).FirstOrDefault();
                dateTimePickerNgayBan.Text       = phieuban.NgayBan;
                dateTimePickerNgayThanhToan.Text = phieuban.NgayThanhToan;
                txtTongTien.Text = phieuban.TongTien.ToString();
                comboBoxKhachHang.SelectedValue = phieuban.MaKH;

                BindingList <CTPhieuBan_DTO> dschitiet = CTPhieuBan.SelectTop(int.Parse(txtSPhieu.Text), 0);
                loadgridview(dschitiet);
            }
            else
            {
                PhieuBan.Insert(1, "1/1/1900", "1/1/1900", 0, 0); // them vo moi them chi tiet dc vi co rang buoc khoa ngoai
            }
        }
Exemplo n.º 3
0
        private void M_PhieuBanHang_Load(object sender, EventArgs e)
        {
            var pbh = p.SelectTop(0);

            loadgridview(pbh);

            if (Quyen == 1)
            {
                toolStripXoa.Visible = false;
                toolStripSửa.Visible = false;
            }
            if (Quyen == 2)
            {
                toolstripThem.Visible = false;
            }
        }