Example #1
0
        public RQKosBranch Add(string id, [FromBody] IEnumerable <RQKosTransfer> RQKosTransferBranch)
        {
            if (ModelState.IsValid)
            {
                RQKosEditModel editModel = new RQKosEditModel(RQKosTransferBranch);

                return(editModel.AppendClass());
            }
            else
            {
                throw new HttpResponseException(JsonErrorResponse.InvalidData());
            }
        }
Example #2
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);
            }
        }
Example #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);
        }
Example #4
0
        public RQKosBranch Add(string id, [FromBody]IEnumerable<RQKosTransfer> RQKosTransferBranch)
        {
            if (ModelState.IsValid)
            {
                RQKosEditModel editModel = new RQKosEditModel(RQKosTransferBranch);

                return editModel.AppendClass();
            }
            else
                throw new HttpResponseException(JsonErrorResponse.InvalidData());
        }