private void btnCamKet_Click(object sender, EventArgs e) { try { if (this.verify()) { string idContract = this.txtIDContract.Text.Trim(); string idCustomer = this.cbCustomer.Text.Trim(); string idVehicle = this.btnIDXe.Text.Trim(); DateTime dateSign = this.dtPicker1.Value; float TotalCost = float.Parse(this.txtGia.Text.Trim()) + (1 / 10); string idEmployee = Global.GlobalEmployeeId; contract_ChoThueDTO contract_ChoThueDTO = new contract_ChoThueDTO(idContract, idCustomer, idVehicle, dateSign, TotalCost, idEmployee); if (this.contract_ChoThueBUS.insertContract_ChoThue(contract_ChoThueDTO)) { MessageBox.Show("Thêm hợp đồng thành công", "Thêm hợp đồng cho thuê", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Thêm hợp đồng không thành công", "Thêm hợp đồng cho thuê", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); } }
//insert public bool insertContract_ChoThue(contract_ChoThueDTO contract_ChoThueDTO) { return(this.contract_ChoThueDAL.insertContract_ChoThue(contract_ChoThueDTO)); }