public ActionResult EditDisease(lmsDiseaseMaster objDiseaseMaster)
        {
            var saveDiseaseDetails = _objIAdminOperations.SaveDisease(objDiseaseMaster);

            //ViewBag.Message = viewMessage;
            return(RedirectToAction("ViewDisease", new { DiseaseId = saveDiseaseDetails, viewMessage = "Disease Details Saved Successfully" }));
        }
Example #2
0
        public int SaveDisease(lmsDiseaseMaster objlmsDiseaseMaster)
        {
            var resultId = 0;

            try
            {
                if (objlmsDiseaseMaster.DISEASEID > 0)
                {
                    _objLabManagementEntities.lmsDiseaseMasters.Attach(objlmsDiseaseMaster);
                    _objLabManagementEntities.Entry(objlmsDiseaseMaster).State = EntityState.Modified;
                    _objLabManagementEntities.SaveChanges();
                    return(objlmsDiseaseMaster.DISEASEID);
                }
                _objLabManagementEntities.lmsDiseaseMasters.Add(objlmsDiseaseMaster);
                _objLabManagementEntities.SaveChanges();
                resultId = _objLabManagementEntities.lmsDiseaseMasters.AsEnumerable().LastOrDefault().DISEASEID;
            }
            catch (Exception ex)
            {
                _objIAppLogger.LogError(ex);
            }

            return(resultId);
        }