public ActionResult Edit(MyClinic.Infrastructure.Medicine medicine)
        {
            Medicine originMedicine = medicineRepository.GetMedicineById(medicine.Id);

            try
            {
                if (medicine == null)
                {
                    return(RedirectToAction("Error404", "Error"));
                }
                if (ModelState.IsValid)
                {
                    var objSession = Session["user"] as MyClinic.Infrastructure.SessUser;

                    medicine.CreatedBy   = originMedicine.CreatedBy;
                    medicine.CreatedDate = originMedicine.CreatedDate;

                    string diffString = originMedicine.EnumeratePropertyDifferencesInString(medicine);
                    medicineRepository.UpdateFieldChangedOnly(originMedicine, medicine);

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

            IMedicineTypeRepository    objMedicineType     = new MedicineTypeRepository();
            IMedicineUnitRepository    objMedicineUnit     = new MedicineUnitRepository();
            IEnumerable <MedicineType> medicineTypeRecords = null;
            IEnumerable <MedicineUnit> unitRecords         = null;

            try {
                medicineTypeRecords = objMedicineType.Get();
                unitRecords         = objMedicineUnit.Get();
            }
            catch (Exception ex)
            {
                log.Error(ex);
                ModelState.AddModelError("error", Translator.UnexpectedError);
            }

            medicineModel = new MedicineModels
            {
                medicine            = medicine,
                medicineTypeRecords = medicineTypeRecords,
                unitRecords         = unitRecords
            };
            return(View(medicineModel));
        }