public ActionResult UpdateRQKosBranch(string id, string verb, IEnumerable <RQKosTransfer> RQKosTransferBranch) { if (MvcRQ.Helpers.AccessRightsResolver.HasAddAccess()) { RQKosEditModel editModel = new RQKosEditModel(RQKosTransferBranch); if ((!string.IsNullOrEmpty(verb)) && ((verb.ToLower() == "check"))) { return(View(editModel.IsValid())); } else if ((!string.IsNullOrEmpty(verb)) && ((verb.ToLower() == "new"))) { return(View("ClientRQKosEditor", editModel.AppendClass())); } else if ((!string.IsNullOrEmpty(verb)) && ((verb.ToLower() == "update"))) { if (editModel.Update()) { return(View("ClientRQKosEditor", editModel.RQKosEditSet)); } else { return(View("ClientRQKosEditor", editModel.RQKosEditStatus)); } } else if ((!string.IsNullOrEmpty(verb)) && ((verb.ToLower() == "delete"))) { if (editModel.Delete()) { return(View("ClientRQKosEditor", editModel.RQKosEditSet)); } else { return(View("ClientRQKosEditor", editModel.RQKosEditStatus)); } } else { return(View()); } } else { throw new System.AccessViolationException(RQResources.Views.Shared.SharedStrings.err_not_authorized); } }
public RQKosBranch Update(string id, [FromBody] IEnumerable <RQKosTransfer> RQKosTransferBranch) { if (ModelState.IsValid) { RQKosEditModel editModel = new RQKosEditModel(RQKosTransferBranch); if (editModel.Update()) { return(editModel.RQKosEditSet); } else { throw new HttpResponseException(JsonErrorResponse.Create(editModel.RQKosEditStatus)); } } else { throw new HttpResponseException(JsonErrorResponse.InvalidData()); } }
public ActionResult UpdateRQKosBranch(string id, string verb, IEnumerable<RQKosTransfer> RQKosTransferBranch) { if (MvcRQ.Helpers.AccessRightsResolver.HasAddAccess()) { RQKosEditModel editModel = new RQKosEditModel(RQKosTransferBranch); if ((!string.IsNullOrEmpty(verb)) && ((verb.ToLower() == "check"))) return View(editModel.IsValid()); else if ((!string.IsNullOrEmpty(verb)) && ((verb.ToLower() == "new"))) return View("ClientRQKosEditor", editModel.AppendClass()); else if ((!string.IsNullOrEmpty(verb)) && ((verb.ToLower() == "update"))) if (editModel.Update()) return View("ClientRQKosEditor", editModel.RQKosEditSet); else return View("ClientRQKosEditor", editModel.RQKosEditStatus); else if ((!string.IsNullOrEmpty(verb)) && ((verb.ToLower() == "delete"))) if (editModel.Delete()) return View("ClientRQKosEditor", editModel.RQKosEditSet); else return View("ClientRQKosEditor", editModel.RQKosEditStatus); else return View(); } else throw new System.AccessViolationException(RQResources.Views.Shared.SharedStrings.err_not_authorized); }
public RQKosBranch Update(string id, [FromBody]IEnumerable<RQKosTransfer> RQKosTransferBranch) { if (ModelState.IsValid) { RQKosEditModel editModel = new RQKosEditModel(RQKosTransferBranch); if (editModel.Update()) return editModel.RQKosEditSet; else throw new HttpResponseException(JsonErrorResponse.Create(editModel.RQKosEditStatus)); } else throw new HttpResponseException(JsonErrorResponse.InvalidData()); }