public JsonResult UpdateComplain(ENT.Complain model) { try { using (BAL.Complain objBAL = new BAL.Complain()) { objBAL.Entity.UpdatedBy = _LoginUserId; objBAL.Entity.UpdatedDateTime = DateTime.Now; objBAL.Entity.complainid = model.complainid; objBAL.Entity.complainstatus = (int)COM.MyEnumration.TICKETSTATUS.RESOLVED; objBAL.Entity.adminremarks = model.adminremarks; if (objBAL.UpdateStatus(objBAL.Entity)) { GlobalVarible.AddMessage("Complain updated successfully."); } else { GlobalVarible.AddError("Unable to update complain.Please try again."); } } } catch (Exception ex) { ERRORREPORTING.Report(ex, _REQUESTURL, _LoginUserId, _ERRORKEY, new JavaScriptSerializer().Serialize(model)); GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public JsonResult SaveComplain(ENT.Complain model) { try { using (BAL.Complain objBAL = new BAL.Complain()) { model.CreatedDateTime = DateTime.Now; model.CreatedBy = _LoginUserId; model.complainstatus = (int)COM.MyEnumration.TICKETSTATUS.CREATED; model.adminremarks = string.Empty; if (objBAL.Insert(model)) { GlobalVarible.AddMessage("Complain registered successfully."); } else { GlobalVarible.AddError("Unable to register complain.Please contact your administrator."); } } } catch (Exception ex) { ERRORREPORTING.Report(ex, _REQUESTURL, _LoginUserId, _ERRORKEY, new JavaScriptSerializer().Serialize(model)); GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }