public ActionResult RevertUser(int Id) { object result = ""; try { B_Personels bPersonel = new B_Personels(); var personel = bPersonel.GetPersonelById(Id); personel.IsDeleted = false; bPersonel.Edit(personel); result = "Success"; } catch (Exception ex) { M_SystemLog exx = new M_SystemLog(E_SystemType.SHAHRDARI_WEB_APPLICATION, E_LogType.ERROR, ex); result = "Error"; if (ex.Source == E_LogType.SYSTEM_ERROR.ToString()) { exx.LogType = E_LogType.SYSTEM_ERROR; result = exx; } L_Log.SubmitLog(exx); } return(Json(result)); }
public ActionResult Modify(M_Personels Personel, M_CarInfo CareInfo, M_BoothInfo BoothInfo) { object result = ""; try { B_Personels bPersonel = new B_Personels(); var oldPersonel = bPersonel.GetPersonelById(Personel.Id); if (oldPersonel.ImageName.ToLower() != "default.jpg" && oldPersonel.ImageName.ToLower() != Personel.ImageName) { System.IO.File.Delete(Server.MapPath("~/Areas/Admin/Images/Profile") + "/" + oldPersonel.ImageName); } bPersonel.Edit(Personel); if (CareInfo != null) { if (CareInfo.Id == 0) { CareInfo.PersonelId = Personel.Id; new B_CarInfo().Add(CareInfo); } else { new B_CarInfo().Edit(CareInfo); } } if (BoothInfo != null) { if (BoothInfo.Id == 0) { BoothInfo.PersonelId = Personel.Id; new B_Booth().Add(BoothInfo); } else { new B_Booth().Edit(BoothInfo); } } result = "Success"; } catch (Exception ex) { M_SystemLog exx = new M_SystemLog(E_SystemType.SHAHRDARI_WEB_APPLICATION, E_LogType.ERROR, ex); result = "Error"; if (ex.Source == E_LogType.SYSTEM_ERROR.ToString()) { exx.LogType = E_LogType.SYSTEM_ERROR; result = exx; } L_Log.SubmitLog(exx); } return(Json(result)); }