private void frmRepair_Load(object sender, EventArgs e) { repairController.LsvRepair = LsvRepair; LsvRepair.Columns.Add("ID", 0, HorizontalAlignment.Left); LsvRepair.Columns.Add("Customer Name", 200, HorizontalAlignment.Left); LsvRepair.Columns.Add("contact No", 143, HorizontalAlignment.Left); LsvRepair.Columns.Add("Item", 300, HorizontalAlignment.Left); LsvRepair.Columns.Add("Issue", 200, HorizontalAlignment.Left); LsvRepair.Columns.Add("Status", 143, HorizontalAlignment.Left); LsvRepair.Columns.Add("Imei", 143, HorizontalAlignment.Left); LsvRepair.Columns.Add("Downpayment", 143, HorizontalAlignment.Left); LsvRepair.Columns.Add("Repair Price", 143, HorizontalAlignment.Left); LsvRepair.Columns.Add("Representative", 143, HorizontalAlignment.Left); LsvRepair.Columns.Add("Date Added", 200, HorizontalAlignment.Left); repairController.display(); btnRepaired.Enabled = false; btnCancel.Enabled = false; btnUpdate.Enabled = false; }
private void btnSave_Click(object sender, EventArgs e) { if (state == "New") { repairController.ItemName = txtItem.Text; repairController.Imei = txtImei.Text; repairController.Issue = txtIssue.Text; repairController.CustomerName = txtCustomerName.Text; repairController.ContactNo = txtContactNo.Text; repairController.Status = "Pending"; repairController.Downpayment = double.Parse(txtDownpayment.Text); repairController.RepairPrice = double.Parse(txtRepairPrice.Text); repairController.StoreRepresentative = txtStoreRepresentative.Text; repairController.add(); MessageBox.Show("Repair Added"); repairController.display(); this.Close(); } else { repairController.RepairId = repair_id; repairController.ItemName = txtItem.Text; repairController.Imei = txtImei.Text; repairController.Issue = txtIssue.Text; repairController.CustomerName = txtCustomerName.Text; repairController.ContactNo = txtContactNo.Text; repairController.Status = "Pending"; repairController.Downpayment = double.Parse(txtDownpayment.Text); repairController.RepairPrice = double.Parse(txtRepairPrice.Text); repairController.StoreRepresentative = txtStoreRepresentative.Text; repairController.update(); MessageBox.Show("Updated"); repairController.display(); this.Close(); } }
private void button1_Click(object sender, EventArgs e) { if (status == "Order") { userController.Username = txtUsername.Text; userController.Password = txtPassword.Text; if (userController.verify()) { orderController.OrderId = order_id; orderController.Status = "Cancelled"; orderController.UserId = userController.UserId; orderController.cancelOrder(); MessageBox.Show("Order Cancelled"); orderController.display(); this.Close(); } else { MessageBox.Show("Access Denied"); } } else if (status == "Repair") { userController.Username = txtUsername.Text; userController.Password = txtPassword.Text; if (userController.verify()) { repairController.RepairId = repairController.RepairId; repairController.Status = "Cancelled"; repairController.UserId = userController.UserId; repairController.cancelRepair(); MessageBox.Show("Cancelled"); repairController.display(); this.Close(); } else { MessageBox.Show("Access Denied"); } } else { //userController.Username = txtUsername.Text; //userController.Password = txtPassword.Text; //if (userController.verify()) //{ // repairController.RepairId = repairController.RepairId; // repairController.Status = "Cancelled"; // repairController.UserId = userController.UserId; // repairController.cancelRepair(); // MessageBox.Show("Cancelled"); // repairController.display(); // // frmDefectiveItem(); // state = true; // this.Close(); //} //else //{ // MessageBox.Show("Access Denied"); //} } }