public HttpResponseMessage UpdateLiveStockImagePath(LiveStock_Steps liveStock_Steps)
        {
            if (!ModelState.IsValid)
            {
                return((HttpResponseMessage)Request.CreateResponse(HttpStatusCode.BadRequest, new { data = new { string.Empty }, success = false, error = string.Empty }));
            }

            try
            {
                LiveStock_Steps LiveStock_StepskData = db.LiveStock_Steps.Where(a => a.Id == liveStock_Steps.Id).FirstOrDefault();
                LiveStock_StepskData.ImageURL = liveStock_Steps.ImageURL;

                if (liveStock_Steps.UpdatedBy != null)
                {
                    LiveStock_StepskData.UpdatedBy = liveStock_Steps.UpdatedBy;
                    LiveStock_StepskData.UpdatedOn = liveStock_Steps.UpdatedOn;
                }

                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LiveStock_StepsExists(liveStock_Steps.Id))
                {
                    return((HttpResponseMessage)Request.CreateResponse(HttpStatusCode.NotFound, new { data = new { string.Empty }, success = false, error = string.Empty }));
                }
                else
                {
                    throw;
                }
            }

            return((HttpResponseMessage)Request.CreateResponse(HttpStatusCode.OK, new { data = new { liveStock_Steps }, success = true, error = string.Empty }));
        }
        public IHttpActionResult GetLiveStock_Steps(int id)
        {
            LiveStock_Steps liveStock_Steps = db.LiveStock_Steps.Find(id);

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

            return(Ok(liveStock_Steps));
        }
        public HttpResponseMessage PostLiveStock_Steps(LiveStock_Steps liveStock_Steps)
        {
            if (!ModelState.IsValid)
            {
                return((HttpResponseMessage)Request.CreateResponse(HttpStatusCode.BadRequest, new { data = new { string.Empty }, success = false, error = string.Empty }));
            }

            db.LiveStock_Steps.Add(liveStock_Steps);
            db.SaveChanges();

            return((HttpResponseMessage)Request.CreateResponse(HttpStatusCode.OK, new { data = new { id = liveStock_Steps.Id }, success = true, error = string.Empty }));
        }
        public IHttpActionResult DeleteLiveStock_Steps(int id)
        {
            LiveStock_Steps liveStock_Steps = db.LiveStock_Steps.Find(id);

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

            db.LiveStock_Steps.Remove(liveStock_Steps);
            db.SaveChanges();

            return(Ok(liveStock_Steps));
        }
        public HttpResponseMessage PutLiveStock_Steps(int id, LiveStock_Steps liveStock_Steps)
        {
            if (!ModelState.IsValid)
            {
                return((HttpResponseMessage)Request.CreateResponse(HttpStatusCode.BadRequest, new { data = new { string.Empty }, success = false, error = string.Empty }));
            }

            if (id != liveStock_Steps.Id)
            {
                return((HttpResponseMessage)Request.CreateResponse(HttpStatusCode.BadRequest, new { data = new { string.Empty }, success = false, error = string.Empty }));
            }

            try
            {
                LiveStock_Steps LiveStock_StepsData = db.LiveStock_Steps.Where(a => a.Id == liveStock_Steps.Id).FirstOrDefault();
                LiveStock_StepsData.StepName        = liveStock_Steps.StepName;
                LiveStock_StepsData.StepDescription = liveStock_Steps.StepDescription;
                LiveStock_StepsData.LiveStockId     = liveStock_Steps.LiveStockId;
                LiveStock_StepsData.Active          = liveStock_Steps.Active;

                if (liveStock_Steps.Active == true)
                {
                    LiveStock_StepsData.UpdatedBy = liveStock_Steps.UpdatedBy;
                    LiveStock_StepsData.UpdatedOn = liveStock_Steps.UpdatedOn;
                }
                else if (liveStock_Steps.Active == false)
                {
                    LiveStock_StepsData.ActiveBy = liveStock_Steps.ActiveBy;
                    LiveStock_StepsData.ActiveOn = liveStock_Steps.ActiveOn;
                }
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LiveStock_StepsExists(id))
                {
                    return((HttpResponseMessage)Request.CreateResponse(HttpStatusCode.NotFound, new { data = new { string.Empty }, success = false, error = string.Empty }));
                }
                else
                {
                    throw;
                }
            }

            return((HttpResponseMessage)Request.CreateResponse(HttpStatusCode.OK, new { data = new { liveStock_Steps }, success = true, error = string.Empty }));
        }