private void BtnConfirmReturn_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("Car Record Management System." + Environment.NewLine + "Confirm Return?" + Environment.NewLine + Environment.NewLine + "Click [OK] to continue...", "Save Record", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dialogResult == DialogResult.OK) { dynamic RentProfile = new ExpandoObject(); Rents MyRent = new Rents(); RentProfile.RentID = TxtRentID.Text; RentProfile.ClientID = TxtClientID.Text; RentProfile.CarID = TxtCarID.Text; RentProfile.ClientName = TxtClientName.Text; RentProfile.CarModel = TxtCarModel.Text; RentProfile.CarBrand = TxtCarBrand.Text; RentProfile.CarRate = TxtCarRate.Text; RentProfile.RentDate = TxtRentDate.Text; RentProfile.RentFee = TxtRentFee.Text; RentProfile.InsuranceFee = TxtInsuranceFee.Text; RentProfile.TotalCost = TxtTotalCost.Text; RentProfile.NoofDays = TxtNoofDays.Text; RentProfile.IsReturn = "True"; RentProfile.Process = "UpdateRentsProfile"; String _Status = (String)MyRent.Update(RentProfile).Result; MessageBox.Show(_Status); } }
public void LoadRentRecord(String _RentID) { Rents MyProfile = new Rents(); dynamic RentProfile = (ExpandoObject)MyProfile.SearchRent(_RentID).Result; if ((String)RentProfile.Status == "Record_Found") { TxtRentID.Text = (String)RentProfile.Record.RentID; TxtClientID.Text = (String)RentProfile.Record.ClientID; TxtCarID.Text = (String)RentProfile.Record.CarID; TxtRentDate.Text = (String)RentProfile.Record.RentDate; TxtClientName.Text = (String)RentProfile.Record.ClientName; TxtCarModel.Text = (String)RentProfile.Record.CarModel; TxtCarBrand.Text = (String)RentProfile.Record.CarBrand; TxtCarRate.Text = (String)RentProfile.Record.CarRate; TxtInsuranceFee.Text = (String)RentProfile.Record.InsuranceFee; TxtRentFee.Text = (String)RentProfile.Record.RentFee; TxtTotalCost.Text = (String)RentProfile.Record.TotalCost; TxtNoofDays.Text = (String)RentProfile.Record.NoofDays; TxtIsReturn.Text = (String)RentProfile.Record.IsReturn; } else { MyFormControl.CleareAllControlsRecursive(this); MessageBox.Show((String)RentProfile.Status + Environment.NewLine + Environment.NewLine + "No Record Found"); } }
private void BtnPrint_Click(object sender, EventArgs e) { JsonProfile = MyRent.LoadTransactionList().Result; MyRent = new Rents(); Print_Dialog.Document = PrintDoc; // Print_Dialog.WindowState = FormWindowState.Maximized; Print_Dialog.Width = 1000; Print_Dialog.Height = 500; Print_Dialog.Text = "Transactions"; Print_Dialog.StartPosition = FormStartPosition.CenterScreen; Print_Dialog.ShowDialog(); }
private void Cost() { Rents MyRent = new Rents(); try { int noOfDays = Convert.ToInt32(TxtNoofDays.Text); int rentFee = Convert.ToInt32(TxtRentFee.Text); int insuranceFee = Convert.ToInt32(TxtInsuranceFee.Text); int carRate = Convert.ToInt32(TxtRate.Text); int total = MyRent.TotalCost(noOfDays, rentFee, insuranceFee, carRate); TxtTotalCost.Text = total.ToString(); } catch (Exception) { } }
private void RentData() { Rents MyRent = new Rents(); dynamic JsonProfile = MyRent.LoadTransactionList().Result; DataGrid.Rows.Clear(); DataGrid.RowCount = JsonProfile.Record.Count; for (int i = 0; i < JsonProfile.Record.Count; i++) { DataGrid.Rows[i].Cells[0].Value = JsonProfile.Record[i].RentID; DataGrid.Rows[i].Cells[1].Value = JsonProfile.Record[i].RentDate; DataGrid.Rows[i].Cells[2].Value = JsonProfile.Record[i].IsReturn; DataGrid.Rows[i].Cells[3].Value = JsonProfile.Record[i].ClientName; DataGrid.Rows[i].Cells[4].Value = JsonProfile.Record[i].CarBrand; DataGrid.Rows[i].Cells[5].Value = JsonProfile.Record[i].CarModel; DataGrid.Rows[i].Cells[6].Value = JsonProfile.Record[i].TotalCost; DataGrid.Rows[i].Cells[7].Value = JsonProfile.Record[i].NoofDays; } }
public void LoadCarRecord(String _CarID) { Rents MyProfile = new Rents(); dynamic CarProfile = (ExpandoObject)MyProfile.SearchCar(_CarID).Result; if ((String)CarProfile.Status == "Record_Found") { TxtCarID.Text = (String)CarProfile.Record.CarID; TxtRate.Text = (String)CarProfile.Record.Rate; TxtPlateNo.Text = (String)CarProfile.Record.PlateNo; TxtBrand.Text = (String)CarProfile.Record.Brand; TxtModel.Text = (String)CarProfile.Record.Model; TxtType.Text = (String)CarProfile.Record.Type; TxtSeater.Text = (String)CarProfile.Record.Seater; } else { MyFormControl.CleareAllControlsRecursive(this); MessageBox.Show((String)CarProfile.Status + Environment.NewLine + Environment.NewLine + "No Record Found"); } }
public void LoadClientRecord(String _ClientId) { Rents MyProfile = new Rents(); dynamic ClientProfile = (ExpandoObject)MyProfile.SearchClient(_ClientId).Result; if ((String)ClientProfile.Status == "Record_Found") { TxtClientID.Text = (String)ClientProfile.Record.ClientID; string firstName = (String)ClientProfile.Record.FirstName; string middleName = (String)ClientProfile.Record.MiddleName; string lastName = (String)ClientProfile.Record.LastName; TxtName.Text = firstName + " " + middleName + " " + lastName; TxtContactNo.Text = (String)ClientProfile.Record.ContactNo; TxtLicenseNo.Text = (String)ClientProfile.Record.LicenseNo; TxtAddress.Text = (String)ClientProfile.Record.Address; } else { MyFormControl.CleareAllControlsRecursive(this); MessageBox.Show((String)ClientProfile.Status + Environment.NewLine + Environment.NewLine + "No Record Found"); } }