public ActionResult Hold(int id, string reason) { if (getCurrentUser() == null) { return(RedirectToAction("Index", "Login")); } else { OverTimeRequest overTimeRequest = ioverTimeRequest.GetOverTimeRequest(id); overTimeRequest.rq_hold_yn = "Y"; overTimeRequest.rq_hold_by = getCurrentUser().u_id; overTimeRequest.rq_hold_by_name = getCurrentUser().u_name; overTimeRequest.rq_hold_date = DateTime.Now; ioverTimeRequest.Update(overTimeRequest); Hold hold = new Hold(); hold.h_doc_id = overTimeRequest.rq_doc_id; hold.h_fun_doc_id = overTimeRequest.rq_id; hold.h_reasons = reason; hold.h_type = "Hold"; hold.h_cre_by = getCurrentUser().u_id; hold.h_cre_date = DateTime.Now; ihold.Add(hold); return(RedirectToAction(nameof(LiveMonitoring))); } }
public String Hold(int id, string reason, int u_id) { Result result = new Result(); try { User user = iuser.GetUser(u_id); if (user != null) { OverTimeRequest overTimeRequest = ioverTimeRequest.GetOverTimeRequest(id); overTimeRequest.rq_hold_yn = "Y"; overTimeRequest.rq_hold_by = u_id; overTimeRequest.rq_hold_by_name = user.u_name; overTimeRequest.rq_hold_date = DateTime.Now; ioverTimeRequest.Update(overTimeRequest); Hold hold = new Hold(); hold.h_doc_id = overTimeRequest.rq_doc_id; hold.h_fun_doc_id = overTimeRequest.rq_id; hold.h_reasons = reason; hold.h_type = "Hold"; hold.h_cre_by = user.u_id; hold.h_cre_date = DateTime.Now; ihold.Add(hold); result.Objects = null; result.Message = "Success"; return(JsonConvert.SerializeObject(result)); } else { result.Objects = null; result.Message = "You have No privilage to Hold"; return(JsonConvert.SerializeObject(result)); } } catch (Exception ex) { result.Objects = null; result.Message = ex.Message; return(JsonConvert.SerializeObject(result)); } }
public void Add(bool addAll = false, Infastructure.ProgressReporter pg = null) { _hold.Add(addAll, pg); }