private void InitQuyComboBox()
        {
            var currentYear   = DateUtil.GetNamHienTai();
            var currentQuater = DateUtil.GetQuyHienTai();
            var allDto        = new List <DanhMucDto>();

            for (int i = currentQuater; i > 0; i--)
            {
                var value = i + "/" + currentYear;
                allDto.Add(new DanhMucDto()
                {
                    Id  = Convert.ToString(value),
                    Ten = Convert.ToString(value)
                });
            }
            var previousYear = int.Parse(currentYear) - 1;

            for (int i = 4; i > 0; i--)
            {
                var value = i + "/" + previousYear;
                allDto.Add(new DanhMucDto()
                {
                    Id  = Convert.ToString(value),
                    Ten = Convert.ToString(value)
                });
            }
            MControlUtil.FillToComboBox(quyComboBox, allDto);
            quyComboBox.Text = currentQuater + "/" + currentYear;
        }
예제 #2
0
        public MenuProcessing(long categoryId, long menuId)
        {
            InitializeComponent();
            var allUnitDto = _billingDao.GetAllUnit();

            MControlUtil.FillToComboBox(cboUnit, allUnitDto);

            _categoryId = categoryId;
            _menuId     = menuId;
            if (categoryId != -1)
            {
                var categoryDto = _billingDao.getCategoryDto(categoryId);
                txtCategory.Text = categoryDto.Ten;
                txtMenuCode.Text = categoryDto.Id;
            }
            if (menuId != -1)
            {
                var menuDto = _billingDao.getMenuDto(menuId);
                txtMenuCode.Text    = menuDto.Code;
                txtMenuName.Text    = menuDto.Name;
                cboUnit.Text        = menuDto.UnitName;
                txtPrice.Text       = Convert.ToString(menuDto.Price);
                txtDescription.Text = menuDto.Description;
            }
        }
        private void InitComboTable()
        {
            var allResTableDtos = _billingDao.GetAllResTableDto();
            var allDanhMucDto   = new List <DanhMucDto>();

            foreach (ResTableDto dto in allResTableDtos)
            {
                allDanhMucDto.Add(new DanhMucDto()
                {
                    Id  = Convert.ToString(dto.Id),
                    Ma  = dto.Code,
                    Ten = dto.Position
                });
            }
            MControlUtil.FillToComboBox(tableComboBox, allDanhMucDto);
        }
        private void InitNamComboBox()
        {
            var currentYear = DateUtil.GetNamHienTai();
            var allDto      = new List <DanhMucDto>();

            for (int i = 0; i <= 10; i++)
            {
                var value = int.Parse(currentYear) - i;
                allDto.Add(new DanhMucDto()
                {
                    Id  = Convert.ToString(value),
                    Ten = Convert.ToString(value)
                });
            }
            MControlUtil.FillToComboBox(namComboBox, allDto);
            namComboBox.Text = currentYear;
        }
예제 #5
0
        public BillingAdd(long billId)
        {
            InitializeComponent();
            _billId = billId;

            var allResTableDtos = _billingDao.GetAllResTableDto();
            var allDanhMucDto   = new List <DanhMucDto>();

            foreach (ResTableDto dto in allResTableDtos)
            {
                allDanhMucDto.Add(new DanhMucDto()
                {
                    Id  = Convert.ToString(dto.Id),
                    Ma  = dto.Code,
                    Ten = dto.Position
                });
            }
            MControlUtil.FillToComboBox(cboBanSo, allDanhMucDto);

            var allEmployeeDto = _billingDao.GetAllEmployee();

            allDanhMucDto = new List <DanhMucDto>();
            foreach (EmployeeDto dto in allEmployeeDto)
            {
                allDanhMucDto.Add(new DanhMucDto()
                {
                    Id  = Convert.ToString(dto.Id),
                    Ma  = dto.EmployeeId,
                    Ten = dto.FullName
                });
            }
            MControlUtil.FillToComboBox(cboEmployee, allDanhMucDto);

            if (billId != -1)
            {
                var billDto = _billingDao.getBillDto(billId);
                cboBanSo.SelectedValue = Convert.ToString(billDto.TableId);
                cboEmployee.Text       = billDto.EmployeeName;
                txtHoaDonSo.Text       = Convert.ToString(billDto.BillingNumber);
                string tableNumber   = cboBanSo.Text;
                string billingNumber = txtHoaDonSo.Text;
                _billNumber  = tableNumber + "_" + billingNumber;
                this.Text    = "Cập nhật";
                btnThem.Text = "Cập nhật";
            }
        }
        private void InitThangComboBox()
        {
            var currentDate = DateUtil.GetCurrentDateTime();
            var allDto      = new List <DanhMucDto>();

            for (int i = 0; i <= 12; i++)
            {
                var value = DateUtil.GetDateTimeAsDdmmyyyy(currentDate.AddMonths(-i)).Substring(3);
                allDto.Add(new DanhMucDto()
                {
                    Id  = value,
                    Ten = value
                });
            }
            MControlUtil.FillToComboBox(thangComboBox, allDto);
            var currentMonth = DateUtil.GetDateTimeAsDdmmyyyy(currentDate).Substring(3);

            thangComboBox.Text = currentMonth;
        }
예제 #7
0
        public ThongTinKhachTT(float tongTien, string tenNhanVien)
        {
            InitializeComponent();
            _tongTien    = tongTien;
            _tenNhanVien = tenNhanVien;
            var allEmployeeDto = _billingDao.GetAllEmployee();
            var allDanhMucDto  = new List <DanhMucDto>();

            foreach (EmployeeDto dto in allEmployeeDto)
            {
                allDanhMucDto.Add(new DanhMucDto()
                {
                    Id  = Convert.ToString(dto.Id),
                    Ma  = dto.EmployeeId,
                    Ten = dto.FullName
                });
            }
            MControlUtil.FillToComboBox(cboEmployee, allDanhMucDto, tenNhanVien);
        }
예제 #8
0
        public BillingProcessing()
        {
            InitializeComponent();

            var allMenuDtos   = _billingDao.GetAllMenuDto();
            var allDanhMucDto = new List <DanhMucDto>();

            foreach (MenuDto dto in allMenuDtos)
            {
                allDanhMucDto.Add(new DanhMucDto()
                {
                    Id  = Convert.ToString(dto.Id),
                    Ma  = dto.Code,
                    Ten = dto.Name
                });
            }
            MControlUtil.FillToComboBox(cboMonAn, allDanhMucDto);
            txtChietKhau.Text = "0";

            FillBill2Grid();
        }
        private void InitComboStatus()
        {
            var allDanhMucDto = new List <DanhMucDto>();

            allDanhMucDto.Add(new DanhMucDto()
            {
                Id  = ConstUtil.CANCEL,
                Ma  = ConstUtil.CANCEL,
                Ten = "Hủy"
            });
            allDanhMucDto.Add(new DanhMucDto()
            {
                Id  = ConstUtil.NO,
                Ma  = ConstUtil.NO,
                Ten = "Chưa thanh toán"
            });
            allDanhMucDto.Add(new DanhMucDto()
            {
                Id  = ConstUtil.YES,
                Ma  = ConstUtil.YES,
                Ten = "Đã thanh toán"
            });
            MControlUtil.FillToComboBox(billStatusComboBox, allDanhMucDto);
        }