public ActionResult DeletePetService(int serviceID) { int intVisitId = (int)Session["intVisitId"]; TVisitService visitService = db.TVisitServices.Where(x => x.intVisitServiceID == serviceID).FirstOrDefault(); db.TVisitServices.Remove(visitService); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create(VisitVaccination vaccination) { int intVisitId = (int)Session["intVisitId"]; int intPetId = (int)Session["intPetID"]; int serviceID = (int)Session["intServiceId"]; if (ModelState.IsValid) { TVisitService newVisitService = new TVisitService() { intVisitID = intVisitId, intServiceID = serviceID }; db.TVisitServices.Add(newVisitService); db.SaveChanges(); int lastInsertedVisitServiceID = db.TVisitServices.Max(v => v.intVisitServiceID); if (vaccination.strRabiesNumber == null) { vaccination.strRabiesNumber = string.Empty; } TVaccination newVisitVaccination = new TVaccination() { intVisitServiceID = lastInsertedVisitServiceID, dtmDateOfVaccination = Convert.ToDateTime(vaccination.dtmDateofVaccination), dtmDateOfExpiration = Convert.ToDateTime(vaccination.dtmDateOfExpiration), strVaccineDesc = vaccination.strVaccineNotes, strRabiesNumber = vaccination.strRabiesNumber }; db.TVaccinations.Add(newVisitVaccination); db.SaveChanges(); return(RedirectToAction("Index", "VisitServices")); } return(View(vaccination)); }
public ActionResult AddPetService(int serviceID) { int intPetId = (int)Session["intPetID"]; //int lastInsertedVisitServiceID = db.TVisitServices.Max(v => v.intVisitServiceID); int healthExamService = db.TServices.Where(x => x.strServiceDesc == "Health Exam").Select(z => z.intServiceID).FirstOrDefault(); if (serviceID == healthExamService) { return(RedirectToAction("Create", "THealthExam", new { id = intPetId })); } else { TVisitService visitService = new TVisitService() { intServiceID = serviceID, intVisitID = (int)Session["intVisitId"] }; db.TVisitServices.Add(visitService); db.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Create(HealthExam healthExam) { int healthExamService = db.TServices.Where(x => x.strServiceDesc == "Health Exam").Select(z => z.intServiceID).FirstOrDefault(); int lastInsertedVisitID = (int)Session["intVisitId"]; TVisitService visitService = new TVisitService() { intVisitID = lastInsertedVisitID, intServiceID = healthExamService }; db.TVisitServices.Add(visitService); db.SaveChanges(); int lastInsertedVisitServiceID = db.TVisitServices.Max(v => v.intVisitServiceID); SqlParameter[] param = new SqlParameter[] { //Health exam parameters new SqlParameter("@dblWeight", healthExam.dblWeight), new SqlParameter("@dblTemperature", healthExam.dblTemperature), new SqlParameter("@intHeartRate", healthExam.intHeartRate), new SqlParameter("@intRespRate", healthExam.intRespRate), new SqlParameter("@intCapillaryRefillTime", healthExam.intCapillaryRefillTime), new SqlParameter("@strMucousMembrane", healthExam.strMucousMembrane), new SqlParameter("@intVisitServiceID", lastInsertedVisitServiceID), new SqlParameter("@strNotes", healthExam.strNotes), //Eye status parameters new SqlParameter("@isEyeNormal", SqlDbType.Bit) { Value = healthExam.isEyeNormal }, new SqlParameter("@isDischarge", SqlDbType.Bit) { Value = healthExam.isDischarge }, new SqlParameter("@isInfection", SqlDbType.Bit) { Value = healthExam.isInfection }, new SqlParameter("@isSclerosisLeft", SqlDbType.Bit) { Value = healthExam.isSclerosisLeft }, new SqlParameter("@isSclerosisRight", SqlDbType.Bit) { Value = healthExam.isSclerosisRight }, new SqlParameter("@isCataractLeft", SqlDbType.Bit) { Value = healthExam.isCataractLeft }, new SqlParameter("@isCataractRight", SqlDbType.Bit) { Value = healthExam.isCataractRight }, new SqlParameter("@isEyeInflamed", SqlDbType.Bit) { Value = healthExam.isEyeInflamed }, new SqlParameter("@isEyelidTumor", SqlDbType.Bit) { Value = healthExam.isEyelidTumor }, //Ear status information new SqlParameter("@isEarNormal", SqlDbType.Bit) { Value = healthExam.isEarNormal }, new SqlParameter("@isEarInflamed", SqlDbType.Bit) { Value = healthExam.isEarInflamed }, new SqlParameter("@isEarTumor", SqlDbType.Bit) { Value = healthExam.isEarTumor }, new SqlParameter("@isDirty", SqlDbType.Bit) { Value = healthExam.isDirty }, new SqlParameter("@isEarPainful", SqlDbType.Bit) { Value = healthExam.isEarPainful }, new SqlParameter("@isExcessiveHair", SqlDbType.Bit) { Value = healthExam.isExcessiveHair }, //Skin status information new SqlParameter("@isSkinNormal", SqlDbType.Bit) { Value = healthExam.isSkinNormal }, new SqlParameter("@isScaly", SqlDbType.Bit) { Value = healthExam.isScaly }, new SqlParameter("@isInfected", SqlDbType.Bit) { Value = healthExam.isInfected }, new SqlParameter("@isMatted", SqlDbType.Bit) { Value = healthExam.isMatted }, new SqlParameter("@isSkinScrape", SqlDbType.Bit) { Value = healthExam.isSkinScrape }, new SqlParameter("@isPruritus", SqlDbType.Bit) { Value = healthExam.isPruritus }, new SqlParameter("@isHairLoss", SqlDbType.Bit) { Value = healthExam.isHairLoss }, new SqlParameter("@isMass", SqlDbType.Bit) { Value = healthExam.isMass }, new SqlParameter("@isSkinParasites", SqlDbType.Bit) { Value = healthExam.isSkinParasites }, //Mouth status information new SqlParameter("@isMouthNormal", SqlDbType.Bit) { Value = healthExam.isMouthNormal }, new SqlParameter("@isMouthTumor", SqlDbType.Bit) { Value = healthExam.isMouthTumor }, new SqlParameter("@isGingivitis", SqlDbType.Bit) { Value = healthExam.isGingivitis }, new SqlParameter("@isPeriodontitis", SqlDbType.Bit) { Value = healthExam.isPeriodontitis }, new SqlParameter("@isTartarBuildup", SqlDbType.Bit) { Value = healthExam.isTartarBuildup }, new SqlParameter("@isLooseTeeth", SqlDbType.Bit) { Value = healthExam.isLooseTeeth }, new SqlParameter("@isBiteOVerUnder", SqlDbType.Bit) { Value = healthExam.isBiteOVerUnder }, //Nose and Throat status information new SqlParameter("@isNoseThroatNormal", SqlDbType.Bit) { Value = healthExam.isNoseThroatNormal }, new SqlParameter("@isLargeLymphNodes", SqlDbType.Bit) { Value = healthExam.isLargeLymphNodes }, new SqlParameter("@isInflamedThroat", SqlDbType.Bit) { Value = healthExam.isInflamedThroat }, new SqlParameter("@isNasalDishcharge", SqlDbType.Bit) { Value = healthExam.isNasalDishcharge }, new SqlParameter("@isInflamedTonsils", SqlDbType.Bit) { Value = healthExam.isInflamedTonsils }, //GI status information new SqlParameter("@isGINormal", SqlDbType.Bit) { Value = healthExam.isGINormal }, new SqlParameter("@isExcessiveGas", SqlDbType.Bit) { Value = healthExam.isExcessiveGas }, new SqlParameter("@isGIParasites", SqlDbType.Bit) { Value = healthExam.isGIParasites }, new SqlParameter("@isAbnormalFeces", SqlDbType.Bit) { Value = healthExam.isAbnormalFeces }, new SqlParameter("@isAnorexia", SqlDbType.Bit) { Value = healthExam.isAnorexia }, //Neurological status information new SqlParameter("@isNeurologicalNormal", SqlDbType.Bit) { Value = healthExam.isNeurologicalNormal }, new SqlParameter("@isPLRL", SqlDbType.Bit) { Value = healthExam.isPLRL }, new SqlParameter("@isPLRR", SqlDbType.Bit) { Value = healthExam.isPLRR }, new SqlParameter("@isCPLF", SqlDbType.Bit) { Value = healthExam.isCPLF }, new SqlParameter("@isCPRF", SqlDbType.Bit) { Value = healthExam.isCPRF }, new SqlParameter("@isCPLR", SqlDbType.Bit) { Value = healthExam.isCPLR }, new SqlParameter("@isCPRR", SqlDbType.Bit) { Value = healthExam.isCPRR }, new SqlParameter("@isPalpebralL", SqlDbType.Bit) { Value = healthExam.isPalpebralL }, new SqlParameter("@isPalpebralR", SqlDbType.Bit) { Value = healthExam.isPalpebralR }, //Abdomen status information new SqlParameter("@isAbdomenNormal", SqlDbType.Bit) { Value = healthExam.isAbdomenNormal }, new SqlParameter("@isAbnormalMass", SqlDbType.Bit) { Value = healthExam.isAbnormalMass }, new SqlParameter("@isAbdomenPainful", SqlDbType.Bit) { Value = healthExam.isAbdomenPainful }, new SqlParameter("@isBloated", SqlDbType.Bit) { Value = healthExam.isBloated }, new SqlParameter("@isEnlarged", SqlDbType.Bit) { Value = healthExam.isEnlarged }, new SqlParameter("@isFluid", SqlDbType.Bit) { Value = healthExam.isFluid }, new SqlParameter("@isHernia", SqlDbType.Bit) { Value = healthExam.isHernia }, //Urogenital status information new SqlParameter("@isUrogenitalNormal", SqlDbType.Bit) { Value = healthExam.isUrogenitalNormal }, new SqlParameter("@isUrogenAbnormalUrination", SqlDbType.Bit) { Value = healthExam.isUrogenAbnormalUrination }, new SqlParameter("@isGenitalDischarge", SqlDbType.Bit) { Value = healthExam.isGenitalDischarge }, new SqlParameter("@isAnalSacs", SqlDbType.Bit) { Value = healthExam.isAnalSacs }, new SqlParameter("@isRectal", SqlDbType.Bit) { Value = healthExam.isRectal }, new SqlParameter("@isMammaryTumors", SqlDbType.Bit) { Value = healthExam.isMammaryTumors }, new SqlParameter("@isAbnormalTesticles", SqlDbType.Bit) { Value = healthExam.isAbnormalTesticles }, new SqlParameter("@isBloodSeen", SqlDbType.Bit) { Value = healthExam.isBloodSeen }, //Musculoskeletal status information new SqlParameter("@isMusculoskeletalNormal", SqlDbType.Bit) { Value = healthExam.isMusculoskeletalNormal }, new SqlParameter("@isJointProblems", SqlDbType.Bit) { Value = healthExam.isJointProblems }, new SqlParameter("@isNailProblems", SqlDbType.Bit) { Value = healthExam.isNailProblems }, new SqlParameter("@isLamenessLF", SqlDbType.Bit) { Value = healthExam.isLamenessLF }, new SqlParameter("@isLamenessRF", SqlDbType.Bit) { Value = healthExam.isLamenessRF }, new SqlParameter("@isLamenessLR", SqlDbType.Bit) { Value = healthExam.isLamenessLR }, new SqlParameter("@isLamenessRR", SqlDbType.Bit) { Value = healthExam.isLamenessRR }, new SqlParameter("@isLigaments", SqlDbType.Bit) { Value = healthExam.isLigaments }, //Lung status information new SqlParameter("@isLungNormal", SqlDbType.Bit) { Value = healthExam.isLungNormal }, new SqlParameter("@isBreathingDifficulty", SqlDbType.Bit) { Value = healthExam.isBreathingDifficulty }, new SqlParameter("@isRapidRespiration", SqlDbType.Bit) { Value = healthExam.isRapidRespiration }, new SqlParameter("@isTrachealPinchPositive", SqlDbType.Bit) { Value = healthExam.isTrachealPinchPositive }, new SqlParameter("@isTrachealPinchNegative", SqlDbType.Bit) { Value = healthExam.isTrachealPinchNegative }, new SqlParameter("@isCongestion", SqlDbType.Bit) { Value = healthExam.isCongestion }, new SqlParameter("@isAbnormalSound", SqlDbType.Bit) { Value = healthExam.isAbnormalSound }, //Heart status information new SqlParameter("@isHeartNormal", SqlDbType.Bit) { Value = healthExam.isHeartNormal }, new SqlParameter("@isMurMur", SqlDbType.Bit) { Value = healthExam.isMurMur }, new SqlParameter("@isFast", SqlDbType.Bit) { Value = healthExam.isFast }, new SqlParameter("@isSlow", SqlDbType.Bit) { Value = healthExam.isSlow }, new SqlParameter("@isMuffled", SqlDbType.Bit) { Value = healthExam.isMuffled } }; db.Database.ExecuteSqlCommand("uspAddPetVisit @dblWeight, @dblTemperature,@intHeartRate,@intRespRate,@intCapillaryRefillTime,@strMucousMembrane,@intVisitServiceID,@strNotes,@isEyeNormal, @isDischarge, @isInfection,@isSclerosisLeft, @isSclerosisRight, @isCataractLeft, @isCataractRight, @isEyeInflamed, @isEyelidTumor,@isEarNormal,@isEarInflamed,@isEarTumor,@isDirty,@isEarPainful,@isExcessiveHair,@isSkinNormal,@isScaly,@isInfected,@isMatted,@isSkinScrape,@isPruritus,@isHairLoss,@isMass,@isSkinParasites,@isMouthNormal,@isMouthTumor,@isGingivitis,@isPeriodontitis,@isTartarBuildup,@isLooseTeeth,@isBiteOVerUnder,@isNoseThroatNormal,@isLargeLymphNodes,@isInflamedThroat,@isNasalDishcharge,@isInflamedTonsils,@isGINormal,@isExcessiveGas,@isGIParasites,@isAbnormalFeces,@isAnorexia,@isNeurologicalNormal,@isPLRL,@isPLRR,@isCPLF,@isCPRF,@isCPLR,@isCPRR,@isPalpebralL,@isPalpebralR,@isAbdomenNormal, @isAbnormalMass,@isAbdomenPainful,@isBloated, @isEnlarged,@isFluid,@isHernia,@isUrogenitalNormal, @isUrogenAbnormalUrination, @isGenitalDischarge, @isAnalSacs, @isRectal, @isMammaryTumors, @isAbnormalTesticles, @isBloodSeen,@isMusculoskeletalNormal,@isJointProblems,@isNailProblems,@isLamenessLF,@isLamenessRF,@isLamenessLR,@isLamenessRR,@isLigaments,@isLungNormal, @isBreathingDifficulty, @isRapidRespiration,@isTrachealPinchPositive,@isTrachealPinchNegative,@isCongestion,@isAbnormalSound,@isHeartNormal,@isMurMur,@isFast,@isSlow,@isMuffled" , param ); int lastInsertedHealthExamId = db.THealthExams.Max(v => v.intHealthExamID); Session["intHealthExamId"] = lastInsertedHealthExamId; return(RedirectToAction("Index", "VisitServices")); }