public ServiceNoteList()
        {
            InitializeComponent();
            dateTimePickerDate.MaxDate = DateTime.Now;
            dgvServiceNote.AutoGenerateColumns = false;
            txtTotalMoney.KeyPress += TxtMoney_KeyPress;
            Load += ServiceNoteList_Load;
            dgvServiceNote.SelectionChanged += DgvServiceNote_SelectionChanged;

            this.resetUI();

            this.serviceNoteBLT = new ServiceNoteBLT();
            this.contractBLT = new ContractBLT();
            this.roomBLT = new RoomBLT();
            this.tollBillsBLT = new TollBillsBLT();

            cmbContractId.DataSource = contractBLT.getListContract();
            cmbContractId.DisplayMember = "ID";
            cmbContractId.ValueMember = "ID";

            cmbRoomName.DataSource = roomBLT.getListRoom();
            cmbRoomName.DisplayMember = "NAME";
            cmbRoomName.ValueMember = "NAME";

            dgvServiceNote.DataSource = serviceNoteBLT.getListServiceNote();
        }
示例#2
0
        public void Init()
        {
            InitializeComponent();
            serviceNoteBLT = new ServiceNoteBLT();
            contractBLT = new ContractBLT();
            serviceBLT = new ServiceBLT();
            cmbContractId.DataSource = contractBLT.getListContract();
            cmbContractId.DisplayMember = "Name";
            cmbContractId.ValueMember = "Id";

            (this.dgvServiceNoteDetail.Columns["clServiceName"] as DataGridViewComboBoxColumn).DataSource = serviceBLT.getListService();
            (this.dgvServiceNoteDetail.Columns["clServiceName"] as DataGridViewComboBoxColumn).DisplayMember = "Name";
            (this.dgvServiceNoteDetail.Columns["clServiceName"] as DataGridViewComboBoxColumn).ValueMember = "Id";
            (this.dgvServiceNoteDetail.Columns["clServiceName"] as DataGridViewComboBoxColumn).DataPropertyName = "ServiceID";
        }
        public void Init()
        {
            InitializeComponent();
            dateTimePickerDate.MaxDate = DateTime.Now;
            dgvServiceNoteDetail.AutoGenerateColumns = false;
            dgvServiceNoteDetail.AllowUserToDeleteRows = false;
            dgvServiceNoteDetail.AllowUserToAddRows = false;

            serviceNoteBLT = new ServiceNoteBLT();
            contractBLT = new ContractBLT();
            tollBillsBLT = new TollBillsBLT();
            debtBLT = new DebtBLT();

            var temp = new Contract()
            {
                IsValid = true
            };

            cmbRoom.DisplayMember = "ROOMNAME";
            cmbRoom.ValueMember = "ROOMID";
            cmbRoom.DataSource = contractBLT.searchContract(temp);
        }
        public ContractList()
        {
            InitializeComponent();

            dateTimePickerDateBegin.MaxDate = DateTime.Now;
            dgvContract.AutoGenerateColumns = false;
            txtPriceRoom.KeyPress += TxtMoney_KeyPress;
            Load += ContractList_Load;
            dgvContract.SelectionChanged += DgvContract_SelectionChanged;

            this.resetUI();

            this.serviceNoteBLT = new ServiceNoteBLT();
            this.contractBLT = new ContractBLT();
            this.roomBLT = new RoomBLT();

            cmbContractStatus.DataSource = new List<ContractStatus>()
            {
                new ContractStatus()
                {
                    Value = false,
                    Display = "InValid"
                },
                new ContractStatus()
                {
                    Value = true,
                    Display = "Valid"
                }
            };
            cmbContractStatus.DisplayMember = "Display";
            cmbContractStatus.ValueMember = "Value";

            cmbRoom.DataSource = roomBLT.getListRoom();
            cmbRoom.DisplayMember = "NAME";
            cmbRoom.ValueMember = "ID";

            dgvContract.DataSource = contractBLT.getListContract();
        }
        public void Init()
        {
            InitializeComponent();
            Load += ContractEdit_Load;
            contractBLT = new ContractBLT();
            serviceBLT = new ServiceBLT();
            roomBLT = new RoomBLT();
            customerBLT = new CustomerBLT();
            dateTimePickerBeginDate.MaxDate = DateTime.Now;
            dateTimePickerBeginDate.Value = dateTimePickerBeginDate.MaxDate;
            dateTimePickerEndDate.Value = dateTimePickerBeginDate.MaxDate;
            dgvService.AutoGenerateColumns = false;
            dgvService.AllowUserToDeleteRows = false;
            dgvService.AllowUserToAddRows = false;

            cmbRoom.DisplayMember = "NAME";
            cmbRoom.ValueMember = "ID";

            cmbCustomer.DisplayMember = "NAME";
            cmbCustomer.ValueMember = "ID";
            cmbCustomer.DataSource = customerBLT.getListCustomer();

            txtDuration.KeyPress += TxtMoney_KeyPress;
            txtPriceRoom.KeyPress += TxtMoney_KeyPress;
            txtDeposit.KeyPress += TxtMoney_KeyPress;
            txtBail.KeyPress += TxtMoney_KeyPress;
            txtRest.KeyPress += TxtMoney_KeyPress;

            txtPriceRoom.TextChanged += TxtMoney_TextChanged;
            txtDeposit.TextChanged += TxtMoney_TextChanged;
        }