public async Task <IActionResult> PutAdmissions(int id, Admissions admissions) { if (id != admissions.AdmissionId) { return(BadRequest()); } _context.Entry(admissions).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdmissionsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public override void PerformTest() { GeneralName name = new GeneralName(new X509Name("CN=hello world")); NamingAuthority auth = new NamingAuthority(new DerObjectIdentifier("1.2.3"), "url", new DirectoryString("fred")); Admissions admissions = new Admissions(name, auth, new ProfessionInfo[0]); checkConstruction(admissions, name, auth); admissions = Admissions.GetInstance(null); if (admissions != null) { Fail("null GetInstance() failed."); } try { Admissions.GetInstance(new Object()); Fail("GetInstance() failed to detect bad object."); } catch (ArgumentException) { // expected } }
public async Task <ActionResult <Admissions> > PostAdmissions(Admissions admissions) { _context.Admissions.Add(admissions); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAdmissions", new { id = admissions.AdmissionId }, admissions)); }
private void btnDischarge_Click(object sender, System.EventArgs e) { string sMsg = ""; Admissions oAdmissions = new Admissions(); try { if (txtPatientID.Text != "") { sMsg = oAdmissions.SetPatientDischarge(txtPatientID.Text); } else { sMsg = "Input Patient ID to discharge"; } } catch { sMsg = "Error discharging patient" + "\n\n" + e.ToString(); } finally { MessageBox.Show(sMsg, "Patient Discharge", MessageBoxButtons.OK); } }
private void checkValues( Admissions admissions, GeneralName name, NamingAuthority auth) { checkMandatoryField("admissionAuthority", name, admissions.AdmissionAuthority); checkMandatoryField("namingAuthority", auth, admissions.NamingAuthority); }
public virtual Admissions[] GetContentsOfAdmissions() { Admissions[] array = new Admissions[contentsOfAdmissions.Count]; for (int i = 0; i < contentsOfAdmissions.Count; i++) { array[i] = Admissions.GetInstance(contentsOfAdmissions[i]); } return(array); }
public static int ProocessNewStudentAddmission(Students newStudent, Admissions newAdmission, FeeCollections newFeeCollection) { using (VedantaEntities ve = new VedantaEntities()) { Students oldStudent = ve.Students.FirstOrDefault(st => st.ID == newStudent.ID); int newStudentId = 0; int oldStudentId = 0; //Add A New Student Record in DataBase if that student does not exists if (oldStudent == null) { newStudent.CreatedDate = DateTime.Now.Date; ve.AddToStudents(newStudent); ve.SaveChanges(); newStudentId = newStudent.ID; } else { oldStudentId = oldStudent.ID; } //If Student is already enrolled with us then no need to add new record for same student if (newStudentId == 0 && oldStudentId > 0) { newStudentId = oldStudentId; } if (newStudentId > 0) { newAdmission.StudentId = newStudentId; Admissions oldAdmission = ve.Admissions.FirstOrDefault(ad => ad.StudentId == newStudentId && ad.CourseId == newAdmission.CourseId); if (oldAdmission == null) { ve.AddToAdmissions(newAdmission); int admResult = ve.SaveChanges(); return(admResult); //if (admResult > 0) //Admission of Student done successfully. //{ // newFeeCollection.AdmissionId = newAdmission.Id; // ve.AddToFeeCollections(newFeeCollection); // return ve.SaveChanges(); //Admission Fee Paid successfully. //} //else // return -2; } else { return(-2); //Student Record Entered but failed to take Admission of student. } } else { return(-1); //Student Record not entered; } } }
public async Task <IActionResult> Update(int?id) { if (id == null) { return(NotFound()); } Admissions admissions = await _db.Admissions.FindAsync(id); if (admissions == null) { return(NotFound()); } return(View(admissions)); }
private void button1_Click(object sender, EventArgs e) { Admissions admin = new Admissions(); try { DataSet tableSource = admin.GetData(); dataGridView1.DataSource = tableSource.Tables[0]; } catch { MessageBox.Show("Error"); } }
private void btnDischarge_Click(object sender, System.EventArgs e) { Admissions admin = new Admissions(); if (txtPatientID.Text.Length > 0) { admin.SetPatientDischarge(txtPatientID.Text); MessageBox.Show("Patient discharge date recorded and bed has been set as unoccupied."); txtPatientID.Clear(); } else { MessageBox.Show("Patient ID entered is not valid."); } }
private void button2_Click(object sender, EventArgs e) { string ID = textBox1.Text; Admissions admin = new Admissions(); try { int days = admin.GetDays(ID); MessageBox.Show("Patient ID " + ID + " has spent " + days + " days in hospital care."); } catch { MessageBox.Show("No Record Found with that ID"); } }
private void button3_Click(object sender, EventArgs e) { string ID = textBox2.Text; Admissions admin = new Admissions(); try { DataSet tableSource = admin.FindData(ID); dataGridView1.DataSource = tableSource.Tables[0]; } catch { MessageBox.Show("No Record Found with that ID"); } }
private void btnDischarge_Click(object sender, System.EventArgs e) { Admissions adminssions = new Admissions(); if (txtPatientID.Text.Length > 0) { adminssions.SetPatientDischarge(txtPatientID.Text); MessageBox.Show("Patient has successfuly been discharged."); txtPatientID.Clear(); } else { MessageBox.Show("Invalid Patient ID."); } }
public async Task <IActionResult> Update(int?id, Admissions admissions) { if (id == null) { return(NotFound()); } Admissions dbAdmissions = await _db.Admissions.FindAsync(id); if (dbAdmissions == null) { return(NotFound()); } if (admissions.Photo != null) { if (ModelState["Photo"].ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) { return(View()); } if (!admissions.Photo.IsImage()) { ModelState.AddModelError("Photo", "Zehmet olmasa shekil formati sechin"); return(View()); } if (admissions.Photo.MaxLength(2000)) { ModelState.AddModelError("Photo", "Shekilin olchusu max 2mb ola biler"); return(View()); } string path = Path.Combine("images", "admissions"); Helper.DeleteImage(_env.WebRootPath, path, dbAdmissions.Image); string fileName = await admissions.Photo.SaveImg(_env.WebRootPath, path); dbAdmissions.Image = fileName; } dbAdmissions.Title = admissions.Title; dbAdmissions.Description = admissions.Description; dbAdmissions.Form = admissions.Form; dbAdmissions.Card = admissions.Card; dbAdmissions.Transcript = admissions.Transcript; dbAdmissions.Certificate = admissions.Certificate; dbAdmissions.Picture = admissions.Picture; await _db.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); }
private string FillAdmissionInfo(string ID) { string admID = txtAdmissionID.Text; string sMsg = ""; DataSet o_Find = new DataSet(); Admissions oAdmissions = new Admissions(); try { o_Find = oAdmissions.FindData(admID); dtpAdmission.Value = Convert.ToDateTime(o_Find.Tables["Admissions"].Rows[0]["AdmissionDate"]); if (o_Find.Tables["Admissions"].Rows[0]["SurgeryDate"] != DBNull.Value) { dtpSurgery.Value = Convert.ToDateTime(o_Find.Tables["Admissions"].Rows[0]["SurgeryDate"]); } txtDoctorID.Text = o_Find.Tables["Admissions"].Rows[0]["DoctorID"].ToString(); txtPatientID.Text = o_Find.Tables["Admissions"].Rows[0]["PatientID"].ToString(); cboWard.SelectedValue = o_Find.Tables["Admissions"].Rows[0]["Ward"].ToString(); txtBed.Text = o_Find.Tables["Admissions"].Rows[0]["Bed"].ToString(); cbTV.Checked = Convert.ToBoolean(o_Find.Tables["Admissions"].Rows[0]["TV"]); cbPhone.Checked = Convert.ToBoolean(o_Find.Tables["Admissions"].Rows[0]["Phone"]); FillDoctorInfo(txtDoctorID.Text); FillPatientInfo(txtPatientID.Text); if (!o_Find.Tables["Admissions"].Rows[0].IsNull("DischargeDate")) { btnUpdate.Enabled = false; } Beds oBeds = new Beds(); o_Find = oBeds.FindData(txtBed.Text); cboBedType.SelectedValue = o_Find.Tables["Beds"].Rows[0]["BedType"].ToString(); sMsg = "Admission record found."; } catch { sMsg = "Admission not in database."; ResetFields(); return(sMsg); } return(sMsg); }
public async Task <ActionResult <Admissions> > PostAdmissions(Admissions admissions) { var data = _context.Database.ExecuteSqlCommand("spStudentAdmission @FatherName,@MotherName,@MobileNo,@Address,@StudentName,@Age,@StandardName ", new SqlParameter("@FatherName", admissions.FatherName), new SqlParameter("@MotherName", admissions.MotherName), new SqlParameter("@MobileNo", admissions.MobileNo), new SqlParameter("@Address", admissions.Address), new SqlParameter("@StudentName", admissions.StudentName), new SqlParameter("@Age", admissions.Age), new SqlParameter("@StandardName", admissions.StandardName) ); //_context.Admission.Add(admissions); //await _context.SaveChangesAsync(); return(Ok(data)); // return CreatedAtAction("GetAdmissions", new { id = admissions.AdmissionId }, admissions); }
private void btnUpdate_Click(object sender, EventArgs e) { string admID = txtAdmissionID.Text; DateTime admission = dtpAdmission.Value; DateTime surgery = dtpSurgery.Value; string docID = txtDoctorID.Text; string patID = txtPatientID.Text; string ward = cboWard.Text; string bedType = cboBedType.Text; string bed = txtBed.Text; bool tv = cbTV.Checked; bool phone = cbPhone.Checked; bool semi = false; bool priv = false; if (bedType.Equals("Semi-private")) { semi = true; } if (bedType.Equals("Private")) { priv = true; } string sMsg = ""; Admissions oAdmissions = new Admissions(); try { sMsg = oAdmissions.UpdateData(admID, admission, surgery, docID, patID, ward, bed, tv, phone, semi, priv); } catch { sMsg = "Error saving data." + "\n\n" + e.ToString(); } finally { MessageBox.Show(sMsg, "Record Update", MessageBoxButtons.OK); } }
private void checkConstruction( Admissions admissions, GeneralName name, NamingAuthority auth) { checkValues(admissions, name, auth); admissions = Admissions.GetInstance(admissions); checkValues(admissions, name, auth); Asn1InputStream aIn = new Asn1InputStream(admissions.ToAsn1Object().GetEncoded()); Asn1Sequence info = (Asn1Sequence)aIn.ReadObject(); admissions = Admissions.GetInstance(info); checkValues(admissions, name, auth); }
public async Task <IActionResult> DeletePost(int?id) { if (id == null) { return(NotFound()); } Admissions admissions = await _db.Admissions.FindAsync(id); if (admissions == null) { return(NotFound()); } string path = Path.Combine("images", "admissions"); Helper.DeleteImage(_env.WebRootPath, path, admissions.Image); _db.Admissions.Remove(admissions); await _db.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> Create(Admissions admissions) { if (ModelState["Photo"].ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) { return(View()); } if (!admissions.Photo.IsImage()) { ModelState.AddModelError("Photo", "Zehmet olmasa shekil formati sechin"); return(View()); } if (admissions.Photo.MaxLength(2000)) { ModelState.AddModelError("Photo", "Shekilin olchusu max 200kb ola biler"); return(View()); } string path = Path.Combine("images", "admissions"); string fileName = await admissions.Photo.SaveImg(_env.WebRootPath, path); Admissions newAdmissions = new Admissions(); newAdmissions.Image = fileName; newAdmissions.Title = admissions.Title; newAdmissions.Description = admissions.Description; newAdmissions.Form = admissions.Form; newAdmissions.Card = admissions.Card; newAdmissions.Transcript = admissions.Transcript; newAdmissions.Certificate = admissions.Certificate; newAdmissions.Picture = admissions.Picture; await _db.Admissions.AddAsync(newAdmissions); await _db.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); }
public static int UpdateAdmissionDetails(Admissions newAdmission) { using (VedantaEntities ve = new VedantaEntities()) { Admissions oldAdmission = ve.Admissions.FirstOrDefault(st => st.Id == newAdmission.Id); if (oldAdmission == null) { return(-1);//Admission record not found. } FeeCollections fee = ve.FeeCollections.FirstOrDefault(fe => fe.AdmissionId == newAdmission.Id && fe.ManualreceiptNumber.Equals(oldAdmission.ManualReceiptNumber, StringComparison.OrdinalIgnoreCase)); if (fee != null) { fee.Amount = newAdmission.DownPayment; fee.Description = newAdmission.Description; fee.TotalReceived = newAdmission.DownPayment; fee.PaymentDate = newAdmission.AdmissionDate; fee.PaymentHeadId = 1; fee.PaymentModeId = newAdmission.PaymentModeId; } newAdmission.StudentId = oldAdmission.StudentId; var updatedAdmission = ve.ApplyCurrentValues(oldAdmission.GetType().Name, newAdmission); return(ve.SaveChanges()); } }
public ActionResult EditAdmission(FormCollection form, Admissions admission) { ViewData["HowToKnowAboutUs"] = Utilities.GetHowToKnowAboutUsNamesList(); ViewData["ComputerKnoledgeLevels"] = Utilities.GetComputerKnowledgeLevelNameList(); ViewData["ComputerInterests"] = Utilities.GetComputerInterestNameList(); ViewData["PaymentModes"] = Utilities.GetPaymentModesNameList(); ViewData["PaymentHeads"] = Utilities.GetPaymentHeadsNameList(); ViewData["YesNo"] = Utilities.GetYesNoList(); ViewData["Next"] = null; if (Session["ClientId"] != null) { if (!Roles.IsUserInRole("CenterManager")) { ViewData["Branchs"] = Utilities.GetBranchNameList((int)Session["ClientId"]); ViewData["Courses"] = Utilities.GetCourseNameList((int)Session["ClientId"]); ViewData["CoursesBrands"] = Utilities.GetCourseBrandNameList((int)Session["ClientId"], null); ViewData["Batches"] = Utilities.GetBatchNameList((int)Session["ClientId"]); } else { if (Session["BranchId"] != null) { ViewData["Branches"] = Utilities.GetBlankBranchNameList(); ViewData["Courses"] = Utilities.GetCourseNameList((int)Session["ClientId"], (int)Session["BranchId"]); ViewData["CoursesBrands"] = Utilities.GetCourseBrandNameList((int)Session["ClientId"], (int)Session["BranchId"]); ViewData["Batches"] = Utilities.GetBatchNameList((int)Session["ClientId"], (int)Session["BranchId"]); } else { return(RedirectToAction("LogOff", "Account")); } } if (!ModelState.IsValid) { ViewData["Next"] = null; ApplicationMessages msg = new ApplicationMessages("Invalid entry.", MessageType.Error); ViewData["Message"] = msg; return(View()); } int result = StudentModels.UpdateAdmissionDetails(admission); if (result > 0) { ApplicationMessages msg = new ApplicationMessages("Admission Details updated successfully.", MessageType.Success); ViewData["Message"] = msg; // return View(); } else { ApplicationMessages msg = new ApplicationMessages("Failed to update Admission details.", MessageType.Error); ViewData["Message"] = msg; // return View(); } } else { if (Roles.IsUserInRole("SuperAdmin")) { return(RedirectToAction("List", "Client")); } } return(View()); }
private void btnRetrieve_Click(object sender, System.EventArgs e) { string pID; string ID; int days = 0; decimal grandTotal = 0.0M; DataSet pDataSet = new DataSet(); DataSet eDataSet = new DataSet(); Extras oExtras = new Extras(); Patients oPatients = new Patients(); Rates oRates = new Rates(); Admissions oAdmissions = new Admissions(); ID = txtID.Text; eDataSet = oExtras.FindData(ID); pID = eDataSet.Tables["Extras"].Rows[0]["PatientID"].ToString(); oPatients.GetPatientInfo(pID); oRates.GetRates(); lblHealth.Text = pID; lblHealth.Visible = true; lblPatient.Text = oPatients.pFirst + " " + oPatients.pLast; lblPatient.Visible = true; lblDays.Text = (oAdmissions.GetDays(ID)).ToString(); lblDays.Visible = true; days = Convert.ToInt32(lblDays.Text); if (Convert.ToBoolean(eDataSet.Tables ["Extras"].Rows[0]["TV"]) == true) { lblRTV.Text = Convert.ToString(oRates.TVRate); lblTotalTV.Text = Convert.ToString(days * oRates.TVRate); grandTotal = Convert.ToDecimal(lblTotalTV.Text); lblRTV.Text = "$" + lblRTV.Text.Substring(0, lblRTV.Text.Length - 2); lblTotalTV.Text = "$" + lblTotalTV.Text.Substring(0, lblTotalTV.Text.Length - 2); lblTotalTV.Visible = true; lblRTV.Visible = true; } if (Convert.ToBoolean(eDataSet.Tables ["Extras"].Rows[0]["Phone"]) == true) { lblRPhone.Text = Convert.ToString(oRates.PhoneRate); lblTotalPhone.Text = Convert.ToString(days * oRates.PhoneRate); grandTotal += Convert.ToDecimal(lblTotalPhone.Text); lblRPhone.Text = "$" + lblRPhone.Text.Substring(0, lblRPhone.Text.Length - 2); lblTotalPhone.Text = "$" + lblTotalPhone.Text.Substring(0, lblTotalPhone.Text.Length - 2); lblTotalPhone.Visible = true; lblRPhone.Visible = true; } if (Convert.ToBoolean(eDataSet.Tables ["Extras"].Rows[0]["SemiPrivate"]) == true) { lblRSemi.Text = Convert.ToString(oRates.SemiRate); lblTotalSemi.Text = Convert.ToString(days * oRates.SemiRate); grandTotal += Convert.ToDecimal(lblTotalSemi.Text); lblRSemi.Text = "$" + lblRSemi.Text.Substring(0, lblRSemi.Text.Length - 2); lblTotalSemi.Text = "$" + lblTotalSemi.Text.Substring(0, lblTotalSemi.Text.Length - 2); lblTotalSemi.Visible = true; lblRSemi.Visible = true; } if (Convert.ToBoolean(eDataSet.Tables ["Extras"].Rows[0]["Private"]) == true) { lblPRate.Text = Convert.ToString(oRates.PrivateRate); lblTotalPrivate.Text = Convert.ToString(days * oRates.PrivateRate); grandTotal += Convert.ToDecimal(lblTotalPrivate.Text); lblPRate.Text = "$" + lblPRate.Text.Substring(0, lblPRate.Text.Length - 2); lblTotalPrivate.Text = "$" + lblTotalPrivate.Text.Substring(0, lblTotalPrivate.Text.Length - 2); lblTotalPrivate.Visible = true; lblPRate.Visible = true; } lblGrandTotal.Text = Convert.ToString(grandTotal); lblGrandTotal.Text = "$" + lblGrandTotal.Text.Substring(0, lblGrandTotal.Text.Length - 2); lblGrandTotal.Visible = true; }
private void btnRetrieve_Click(object sender, System.EventArgs e) { string pID; string ID; int days = 0; decimal grandTotal = 0.0M; DataSet pDataSet = new DataSet(); DataSet eDataSet = new DataSet(); Patients oPatients = new Patients(); Rates oRates = new Rates(); Admissions oAdmissions = new Admissions(); try { ClearLabels(); ID = txtID.Text; eDataSet = oAdmissions.FindData(ID); //code added to stop user from billing a patient not discharged if (eDataSet.Tables["Admissions"].Rows[0]["DischargeDate"] == System.DBNull.Value) { MessageBox.Show("Patient not discharged yet. Patient can only be billed after discharge."); txtID.Text = ""; return; } //end code added pID = eDataSet.Tables["Admissions"].Rows[0]["PatientID"].ToString(); oPatients.GetPatientInfo(pID); oRates.GetRates(); lblHealth.Text = pID; lblHealth.Visible = true; lblPatient.Text = oPatients.pFirst + " " + oPatients.pLast; lblPatient.Visible = true; lblDays.Text = (oAdmissions.GetDays(ID)).ToString(); lblDays.Visible = true; days = Convert.ToInt32(lblDays.Text); lblRTV.Text = String.Format("{0:C2}", oRates.TVRate); lblRTV.Visible = true; lblRPhone.Text = String.Format("{0:C2}", oRates.PhoneRate); lblRPhone.Visible = true; lblRSemi.Text = String.Format("{0:C2}", oRates.SemiRate); lblRSemi.Visible = true; lblPRate.Text = String.Format("{0:C2}", oRates.PrivateRate); lblPRate.Visible = true; if (Convert.ToBoolean(eDataSet.Tables["Admissions"].Rows[0]["TV"]) == true) { decimal TotalTV = days * oRates.TVRate; lblTotalTV.Text = String.Format("{0:C2}", TotalTV); lblTotalTV.Visible = true; grandTotal = TotalTV; } if (Convert.ToBoolean(eDataSet.Tables["Admissions"].Rows[0]["Phone"]) == true) { decimal TotalPhone = days * oRates.PhoneRate; lblTotalPhone.Text = String.Format("{0:C2}", TotalPhone); lblTotalPhone.Visible = true; grandTotal += Convert.ToDecimal(TotalPhone); } if (Convert.ToBoolean(eDataSet.Tables["Admissions"].Rows[0]["SemiPrivate"]) == true) { decimal TotalSemi = days * oRates.SemiRate; lblTotalSemi.Text = String.Format("{0:C2}", TotalSemi); lblTotalSemi.Visible = true; grandTotal += Convert.ToDecimal(TotalSemi); } if (Convert.ToBoolean(eDataSet.Tables["Admissions"].Rows[0]["Private"]) == true) { decimal TotalPrivate = days * oRates.PrivateRate; lblTotalPrivate.Text = String.Format("{0:C2}", TotalPrivate); lblTotalPrivate.Visible = true; grandTotal += Convert.ToDecimal(TotalPrivate); } lblGrandTotal.Text = String.Format("{0:C2}", grandTotal); lblGrandTotal.Visible = true; } catch { MessageBox.Show("Not possible to retrieve informations."); } }
private void btnAdd_Click(object sender, System.EventArgs e) { string admID = txtAdmissionID.Text; DateTime admission = dtpAdmission.Value; DateTime surgery = dtpSurgery.Value; string docID = txtDoctorID.Text; string patID = txtPatientID.Text; string ward = cboWard.Text; string bedType = cboBedType.Text; string bed = txtBed.Text; bool tv = cbTV.Checked; bool phone = cbPhone.Checked; bool semi = false; bool priv = false; if (bedType.Equals("Semi-private")) { semi = true; } if (bedType.Equals("Private")) { priv = true; } string sMsg = ""; Admissions oAdmissions = new Admissions(); string obField = ""; if (admID == "") { obField = "Admission ID"; } else if (docID == "") { obField = "Doctor ID"; } else if (patID == "") { obField = "Patient ID"; } else if (bed == "") { obField = "Bed"; } if (obField == "") { MessageBox.Show("Field " + obField + "is obligatory."); return; } try { sMsg = oAdmissions.AddData(admID, admission, surgery, docID, patID, ward, bed, tv, phone, semi, priv); } catch { sMsg = "Error saving data." + "\n\n" + e.ToString(); } finally { MessageBox.Show(sMsg, "Add Record", MessageBoxButtons.OK); } }