private void btnAddHospital_Click(object sender, EventArgs e) { string name = txtHospitalName.Text.Trim(); string location = txtLocation.Text.Trim(); if (name == "" || location == "") { MessageBox.Show("Enter name and location"); return; } else { Hospital hospital = new Hospital() { HospitalName = name, Location = location, CreatedOn = DateTime.Now }; bool result = new MasterData().AddHospital(hospital); if (result) { txtHospitalName.Text = ""; txtLocation.Text = ""; MessageBox.Show("Hospital added successfully"); } else { MessageBox.Show("Cannot add hospital : contact Admin"); } } }
public static void PopulateRoles(RadDropDownList ddl) { try { List<Role> roles = new MasterData().GetRoles(); roles.Insert(0, new Role() { RoleId = 0, RoleName = "Select" }); ddl.DataSource = roles; ddl.ValueMember = "RoleId"; ddl.DisplayMember = "RoleName"; } catch (Exception x) { FileLogger.LogError(x); } }
public static void PopulateOperations(RadDropDownList ddl) { try { List<Operation> operations = new MasterData().GetOperations(); operations.Insert(0, new Operation() { OperationId = 0, OperationName = "Select Operation" }); ddl.DataSource = operations; ddl.ValueMember = "OperationId"; ddl.DisplayMember = "OperationName"; } catch (Exception x) { FileLogger.LogError(x); } }
public static void PopulateHospital(RadDropDownList ddl) { try { List<Hospital> hospitals = new MasterData().GetHospitals(); hospitals.Insert(0, new Hospital() { HospitalId = 0, HospitalName = "Select Hospital" }); ddl.DataSource = hospitals; ddl.ValueMember = "HospitalId"; ddl.DisplayMember = "HospitalName"; } catch (Exception x) { FileLogger.LogError(x); } }
private void btnAddOperation_Click(object sender, EventArgs e) { string name = txtOperationName.Text.Trim(); if (name == "") { MessageBox.Show("Enter operation name"); return; } else { Operation operation = new Operation() { OperationName = name, CreatedOn = DateTime.Now }; bool result = new MasterData().AddOperation(operation); if (result) { txtOperationName.Text = ""; MessageBox.Show("Operation added successfully"); } else { MessageBox.Show("Cannot add operation : contact Admin"); } } }
private void btnAddDiagnosis_Click(object sender, EventArgs e) { string name = txtDiagnosisName.Text.Trim(); if (name == "") { MessageBox.Show("Enter diagnosis name"); return; } else { Diagnosis diagnosis = new Diagnosis() { DiagnosisName = name, CreatedOn = DateTime.Now }; bool result = new MasterData().AddDiagnosis(diagnosis); if (result) { txtDiagnosisName.Text = ""; MessageBox.Show("Diagnosis added successfully"); } else { MessageBox.Show("Cannot add operation : contact Admin"); } } }
private void btnAddImaging_Click(object sender, EventArgs e) { string name = txtImagingName.Text.Trim(); if (name == "") { MessageBox.Show("Enter imaging"); return; } else { Imaging imaging = new Imaging() { ImagingName = name, CreatedOn = DateTime.Now }; bool result = new MasterData().AddImaging(imaging); if (result) { txtImagingName.Text = ""; MessageBox.Show("Imaging added successfully"); } else { MessageBox.Show("Cannot add imaging : contact Admin"); } } }
private void btnAddOtherAdvise_Click(object sender, EventArgs e) { string name = txtOtherAdvise.Text.Trim(); if (name == "") { MessageBox.Show("Enter advise"); return; } else { OtherAdvise otheradvise = new OtherAdvise() { OtherAdviseName = name, CreatedOn = DateTime.Now }; bool result = new MasterData().AddOtherAdvise(otheradvise); if (result) { txtOtherAdvise.Text = ""; MessageBox.Show("Advise added successfully"); } else { MessageBox.Show("Cannot add advise : contact Admin"); } } }
private void btnAddDosageFrequency_Click(object sender, EventArgs e) { string name = txtDosageFrequency.Text.Trim(); if (name == "") { MessageBox.Show("Enter dosage frequency"); return; } else { DosageFrequency dosagefrequency = new DosageFrequency() { DosageFrequencyName = name, CreatedOn = DateTime.Now }; bool result = new MasterData().AddDosageFrequency(dosagefrequency); if (result) { txtDosageFrequency.Text = ""; MessageBox.Show("Dosage frequency added successfully"); } else { MessageBox.Show("Cannot add dosage frequency : contact Admin"); } } }
private void btnAddInvestigation_Click(object sender, EventArgs e) { string name = txtInvestigationName.Text.Trim(); string value = txtInvestigationValue.Text.Trim(); if (name == "" || value == "") { MessageBox.Show("Enter name and value"); return; } else { LabInvestigation labinvestigation = new LabInvestigation () { LabInvestigationName = name, NormalValue = value, CreatedOn = DateTime.Now }; bool result = new MasterData().AddLabInvestigation(labinvestigation); if (result) { txtInvestigationName.Text = ""; txtInvestigationValue.Text = ""; MessageBox.Show("Lab Investigation added successfully"); } else { MessageBox.Show("Cannot add Lab Investigation : contact Admin"); } } }
private void btnAddService_Click(object sender, EventArgs e) { string name = txtServiceName.Text.Trim(); double cost = 0; if (name == "") { MessageBox.Show("Enter service name"); return; } else { try { cost = Convert.ToDouble(txtCharges.Text.Trim()); } catch { MessageBox.Show("Enter valid charge value"); return; } Service service = new Service() { ServiceName = name, Cost = cost, CreatedOn = DateTime.Now }; bool result = new MasterData().AddService(service); if (result) { txtServiceName.Text = ""; txtCharges.Text = ""; MessageBox.Show("Service added successfully"); } else { MessageBox.Show("Cannot add service : contact Admin"); } } }
private void btnAddEmployee_Click(object sender, EventArgs e) { string name = txtEmployee.Text.Trim(); int role = Convert.ToInt32(ddlRole.SelectedValue); if (name == "") { MessageBox.Show("Enter employee name"); return; } else if (role == 0) { MessageBox.Show("Select role"); return; } else { Employee employee = new Employee() { FirstName = name, RoleId = role, CreatedOn = DateTime.Now }; employee.Password = Encryption.Encrypt(Resources.EncryptionKey, Resources.DefaultPassword); bool result = new MasterData().AddEmployee(employee); if (result) { txtEmployee.Text = ""; ddlRole.SelectedIndex = ddlRole.FindString("Select"); MessageBox.Show("Employee added successfully"); } else { MessageBox.Show("Cannot add employee : contact Admin"); } } }
public static void PopulateDosage(RadDropDownList ddl) { try { List<DosageFrequency> dosage = new MasterData().GetDosageFrequencies(); dosage.Insert(0, new DosageFrequency() { DosageFrequencyId = 0, DosageFrequencyName = "Select" }); ddl.DataSource = dosage; ddl.ValueMember = "DosageFrequencyId"; ddl.DisplayMember = "DosageFrequencyName"; } catch (Exception x) { FileLogger.LogError(x); } }
public static void PopulateImaging(RadDropDownList ddl) { try { List<Imaging> imaging = new MasterData().GetImagings(); imaging.Insert(0, new Imaging() { ImagingId = 0, ImagingName = "Select" }); ddl.DataSource = imaging; ddl.ValueMember = "ImagingId"; ddl.DisplayMember = "ImagingName"; } catch (Exception x) { FileLogger.LogError(x); } }
public static void PopulateLabInvestigation(RadDropDownList ddl) { try { List<LabInvestigation> lab = new MasterData().GetLabInvestigations(); lab.Insert(0, new LabInvestigation() { LabInvestigationId = 0, LabInvestigationName = "Select" }); ddl.DataSource = lab; ddl.ValueMember = "LabInvestigationId"; ddl.DisplayMember = "LabInvestigationName"; } catch (Exception x) { FileLogger.LogError(x); } }