예제 #1
0
        public void Invoke()
        {
            OrderUpdateData orderupdate = new OrderUpdateData();

            orderupdate.Orders = this.Orders;
            orderupdate.Update();
        }
        public IHttpActionResult PutUserRepairOrder(int id, OrderUpdateData repairOrder)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var order      = db.RepairOrders.Find(id);
            var cookieUser = getCooikedUser();

            if (order.Customer_ID != cookieUser.ID && cookieUser.Role_ID != 3 && (order.Engineer_ID != cookieUser.ID))
            {
                return(Unauthorized());
            }


            order.Customer_note = repairOrder.Customer_note;
            order.Service_time  = repairOrder.Service_time;
            order.Staff_note    = repairOrder.Staff_note;
            order.Price         = repairOrder.Price;
            order.State         = repairOrder.State;
            order.Loc_detail    = repairOrder.Loc_detail;
            order.Loc_name      = repairOrder.Loc_name;



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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
예제 #3
0
        public bool Invoke()
        {
            bool complete = false;

            try
            {
                OrderUpdateData orderupdate = new OrderUpdateData();
                orderupdate.Orders = this.Orders;
                orderupdate.Update();

                complete = true;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(complete);
        }
예제 #4
0
 public void Invoke()
 {
     OrderUpdateData orderUpdate = new OrderUpdateData();
     orderUpdate.Orders = this.Orders;
     orderUpdate.Update();
 }