private void btnHoanThanh_Click(object sender, EventArgs e) { DialogResult dialog = MessageBox.Show("Bạn có chắc chắn hoàn thành đơn này?", "Xác nhận hoàn thành", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialog == DialogResult.Yes) { List <Inf_Repair> Inf_Repair = DRP.FindBy_ID(id); foreach (var item in Inf_Repair) { if (DRP.Done_RP(item.Repair_Id)) { HoaDon hoaDon = new HoaDon(); hoaDon.CreateReport(id); hoaDon.Show(); DRP.Delete_KH(item.Customer_Id); DRP = new Data_RP(); Load_TinhTrang(DRP.Inf_Repair()); btnHoanThanh.Enabled = false; } else { MessageBox.Show("Không thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }
public long getSoLuong() { DRP = new Data_RP(); List <Inf_Repair> Inf_Repair = DRP.Inf_Repair(); return(Inf_Repair.Count()); }
private void btnTiepNhan_Click(object sender, EventArgs e) { if (Data.SelectedRows[0].Cells[9].Value.ToString() == Name) { openButton(false); MessageBox.Show("Tiếp tục đơn thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (Data.SelectedRows[0].Cells[9].Value.ToString() != "Chưa biết") { MessageBox.Show("Nhân viên " + Data.SelectedRows[0].Cells[9].Value.ToString() + " đã nhận đơn này rồi, vui lòng chọn đơn khác", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); DRP = new Data_RP(); Load_RP(DRP.Inf_Repair()); } else { DialogResult dialog = MessageBox.Show("Bạn có muốn nhận đơn này?", "Xác nhận nhận đơn", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialog == DialogResult.Yes) { openButton(false); if (DRP.Update_NhanDon(Name, txtMaSuaChua.Text)) { DRP = new Data_RP(); Load_RP(DRP.Inf_Repair()); txtNVTN.Text = Name; } } else { openButton(true); } } } }
private async void btnHoanThanhSua_Click(object sender, EventArgs e) { DialogResult dialog = MessageBox.Show("Bạn có chắc chắn hoàn thành sửa cho đơn này?", "Xác nhận hoàn thành", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialog == DialogResult.Yes) { l1.Show(); l2.Show(); if (DRP.Update_Status("1", id, note)) { await Task.Delay(5000); l1.Hide(); l2.Hide(); d1.Show(); d2.Show(); DRP = new Data_RP(); Load_TinhTrang(DRP.Inf_Repair()); await Task.Delay(2000); d1.Hide(); d2.Hide(); btnHoanThanhSua.Enabled = false; btnHoanThanh.Enabled = false; } } }
private void Btn_ReFresh_Click(object sender, EventArgs e) { openButton(true); Data_RP DRP = new Data_RP(); Load_RP(DRP.Inf_Repair()); }
//private void txtSoTien_Leave(object sender, EventArgs e) //{ // float value = float.Parse(txtSoTien.Text); // txtSoTien.Text = String.Format("{0:N0}", value); //} private void btnUpdate_Click(object sender, EventArgs e) { if (txtTenMay.Text != "" && txtTinhTrang.Text != "" && txtHenSua.Text != "" && txtDateHen.Text != "" && txtSoTien.Text != "" && txtSoTien.Text != "" && txtCanSua.Text != "") { DialogResult dialog = MessageBox.Show("Bạn có chắn chắn muốn cập nhật đơn này?", "Xác nhận cập nhật", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialog == DialogResult.Yes) { if (DRP.Update_RP(txtTenMay.Text, txtTinhTrang.Text, txtCanSua.Text, txtHenSua.Text, txtDateHen.Value, txtSoTien.Text, txtMaSuaChua.Text)) { if (txtHenSua.Text == "Hẹn ngày lấy") { BaoCao bc = new BaoCao(); bc.CreateReport(txtMaSuaChua.Text); bc.Show(); } DRP = new Data_RP(); Load_RP(DRP.Inf_Repair()); openButton(true); } else { MessageBox.Show("Cập nhật thất bại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } else { MessageBox.Show("Vui lòng điền đầy đủ thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void TinhTrangSua_Load(object sender, EventArgs e) { d1.Hide(); d2.Hide(); l1.Hide(); l2.Hide(); DRP = new Data_RP(); Load_TinhTrang(DRP.Inf_Repair()); }
private void btnRefresh_Click(object sender, EventArgs e) { Data_RP DRP = new Data_RP(); Load_TinhTrang(DRP.Inf_Repair()); }
private void TinhTrangSua_Enter(object sender, EventArgs e) { Data_RP DRP = new Data_RP(); Load_TinhTrang(DRP.Inf_Repair()); }
private void NhanMayBaoGia_Load(object sender, EventArgs e) { DRP = new Data_RP(); Load_RP(DRP.Inf_Repair()); }