Example #1
0
        public HttpResponseMessage GetManufacturingUnit()
        {
            var ManUnit = new ManufacturingUnit_CRUD().ManufacturingUnit_GetAll();

            if (ManUnit != null)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, ManUnit));
            }
            return(Request.CreateResponse(HttpStatusCode.NoContent, ManUnit));
        }
Example #2
0
 public HttpResponseMessage PutManufacturingUnit(ManUnit ManufactUnit)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var result = new ManufacturingUnit_CRUD().ManufacturingUnit_Update(ManufactUnit);
             if (result != null || result != "")
             {
                 return(Request.CreateResponse(HttpStatusCode.OK, result));
             }
         }
         return(Request.CreateResponse(HttpStatusCode.NoContent));
     }
     catch
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest));
     }
 }
Example #3
0
        public HttpResponseMessage DeleteManufacturingUnit(int Pid)
        {
            var result = new ManufacturingUnit_CRUD().ManufacturingUnit_GetById(Pid);

            if (result.PID == 0)
            {
                return(Request.CreateResponse(HttpStatusCode.NoContent, result));
            }
            try
            {
                result.PID = Convert.ToInt16(new ManufacturingUnit_CRUD().ManufacturingUnit_Delete(Pid));
                if (result.PID != 0)
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, result));
                }
                return(Request.CreateResponse(HttpStatusCode.NoContent, result));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, result));
            }
        }
Example #4
0
        public ManUnit GetManufacturingUnit(int?Pid)
        {
            var ManUnit = new ManufacturingUnit_CRUD().ManufacturingUnit_GetById(Pid);

            return(ManUnit);
        }