public ActionResult Add(MyClinic.Infrastructure.Disease disease)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    /*disease disease = new disease();
                     * Dictionary<string, string> dictItem = TransactionHelper.processGenerateArray(disease);
                     * disease = TransactionHelper.TransDict<disease>(dictItem, disease);*/

                    var objSession = Session["user"] as MyClinic.Infrastructure.SessUser;
                    disease.CreateBy   = objSession.UserId;
                    disease.CreateDate = DateTime.Now;

                    //disease.ModifiedBy = 0;
                    var      strValue = "1990-01-01";
                    DateTime objDate;
                    DateTime.TryParse(strValue, out objDate);
                    disease.ModifiedDate = objDate;
                    disease.Status       = 1;
                    diseaseRepository.Add(disease);
                    /*For Add New Record to LogTable*/
                    logTran.UserId      = objSession.UserId;
                    logTran.ProcessType = "Add disease";
                    logTran.Description = "Add New disease Name :" + disease.Name;
                    logTran.LogDate     = DateTime.Now;
                    logRepository.Add(logTran);
                    return(RedirectToAction("Index", "disease"));
                }
                else
                {
                    diseaseModel = new DiseaseModels
                    {
                        disease = disease
                    };
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);
                ModelState.AddModelError("error", Translator.UnexpectedError);
            }
            return(View(diseaseModel));
        }
        public ActionResult Edit(MyClinic.Infrastructure.Disease disease)
        {
            Disease originDisease = diseaseRepository.GetDiseaseById(disease.Id);

            try
            {
                if (ModelState.IsValid)
                {
                    var objSession = Session["user"] as MyClinic.Infrastructure.SessUser;
                    disease.ModifiedBy   = objSession.UserId;
                    disease.ModifiedDate = DateTime.Now;
                    disease.CreateBy     = originDisease.CreateBy;
                    disease.CreateDate   = originDisease.CreateDate;
                    disease.Status       = originDisease.Status;
                    string diffString = originDisease.EnumeratePropertyDifferencesInString(disease);

                    diseaseRepository.UpdateFieldChangedOnly(originDisease, disease);
                    /*For Add New Record to LogTable*/
                    logTran.UserId      = objSession.UserId;
                    logTran.ProcessType = "Edit Disease";
                    logTran.Description = "Edit Disease value as follow: " + diffString;
                    logTran.LogDate     = DateTime.Now;
                    logRepository.Add(logTran);
                    return(RedirectToAction("Index", "Disease"));
                }
            }
            catch (Exception ex)
            {
                log.Error(ex);
                ModelState.AddModelError("error", Translator.UnexpectedError);
            }
            diseaseModel = new DiseaseModels
            {
                disease = disease,
            };
            return(View(diseaseModel));
        }