Beispiel #1
0
        public IHttpActionResult PostApprovalFlow_FlowSet(ApprovalFlow_FlowSet approvalFlow_FlowSet)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ApprovalFlow_FlowSet.Add(approvalFlow_FlowSet);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (ApprovalFlow_FlowSetExists(approvalFlow_FlowSet.StepID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = approvalFlow_FlowSet.StepID }, approvalFlow_FlowSet));
        }
Beispiel #2
0
        public IHttpActionResult PutApprovalFlow_FlowSet(Guid id, ApprovalFlow_FlowSet approvalFlow_FlowSet)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != approvalFlow_FlowSet.StepID)
            {
                return(BadRequest());
            }

            db.Entry(approvalFlow_FlowSet).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ApprovalFlow_FlowSetExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #3
0
        public IHttpActionResult GetApprovalFlow_FlowSet(Guid id)
        {
            ApprovalFlow_FlowSet approvalFlow_FlowSet = db.ApprovalFlow_FlowSet.Find(id);

            if (approvalFlow_FlowSet == null)
            {
                return(NotFound());
            }

            return(Ok(approvalFlow_FlowSet));
        }
Beispiel #4
0
        public IHttpActionResult DeleteApprovalFlow_FlowSet(Guid id)
        {
            ApprovalFlow_FlowSet approvalFlow_FlowSet = db.ApprovalFlow_FlowSet.Find(id);

            if (approvalFlow_FlowSet == null)
            {
                return(NotFound());
            }

            db.ApprovalFlow_FlowSet.Remove(approvalFlow_FlowSet);
            db.SaveChanges();

            return(Ok(approvalFlow_FlowSet));
        }