Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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());
            }
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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());
        }