public ActionResult Patient(Patient_Info a) { Database1Entities2 D = new Database1Entities2(); D.Patient_Infoes.Add(a); var st = D.SaveChanges(); if (st > 0) { } else { } ModelState.Clear(); return(View()); }
public void MapDatabaseValueToObjectGivenPatientInfoObjectMapsValueCorrectly() { PatientBO resultData = new PatientBO(); Patient_Info actualData = GetTestPatient(); resultData.MapDatabaseValueToObject(actualData); Assert.AreEqual(actualData.Gu_No, resultData.GUNo); Assert.AreEqual(actualData.Gu_Year, resultData.GUYear); Assert.AreEqual(actualData.Salutation, resultData.Salutation); Assert.AreEqual(actualData.Patient_Name, resultData.PatientName); Assert.AreEqual(actualData.At_Post, resultData.AtPost); Assert.AreEqual(actualData.Town, resultData.Town); Assert.AreEqual(actualData.District, resultData.District); Assert.AreEqual(actualData.State, resultData.State); Assert.AreEqual(actualData.Phone, resultData.PhoneNumber); Assert.AreEqual(actualData.Mobile, resultData.Mobile); Assert.AreEqual(actualData.Age_Yr, resultData.AgeYear); Assert.AreEqual(actualData.Age_Mnth, resultData.AgeMonths); Assert.AreEqual((SexEnum)actualData.Sex, resultData.Sex); Assert.AreEqual(actualData.Occupation, resultData.Occupation); }
/// <summary> /// Get test patient /// </summary> /// <returns>Returns patient info object</returns> private Patient_Info GetTestPatient() { Patient_Info testPatient = new Patient_Info(); testPatient.Gu_No = 1; testPatient.Gu_Year = 2015; testPatient.Salutation = "Mr"; testPatient.Patient_Name = "nilesh"; testPatient.At_Post = "Atul Nagar"; testPatient.Town = "Pune"; testPatient.District = "Pune"; testPatient.State = "Maharashtra"; testPatient.Phone = "66425646"; testPatient.Mobile = "9881230729"; testPatient.Age_Yr = 33; testPatient.Age_Mnth = 11; testPatient.Sex = 0; testPatient.Occupation = "service"; testPatient.Doctors_List = new Doctors_List(); return(testPatient); }