예제 #1
0
        public HttpResponseMessage DeleteDeliveryModeLookUp(DeliveryModeLookUpModel _DeliveryModeLookUpModel)
        {
            try
            {
                DELIVERY_MODE_LOOKUP dmlu = new DELIVERY_MODE_LOOKUP();

                dmlu.ID        = _DeliveryModeLookUpModel.ID;
                dmlu.MODE_CODE = _DeliveryModeLookUpModel.MODE_CODE;
                dmlu.MODE_NAME = _DeliveryModeLookUpModel.MODE_NAME;

                db.DELIVERY_MODE_LOOKUP.Attach(dmlu);
                db.DELIVERY_MODE_LOOKUP.Remove(dmlu);
                db.SaveChanges();
            }
            catch
            {
                throw;
            }
            return(Request.CreateResponse(HttpStatusCode.OK, "success"));
        }
예제 #2
0
        public HttpResponseMessage UpdateDeliveryModeLookUp(DeliveryModeLookUpModel _DeliveryModeLookUpModel)
        {
            try
            {
                DELIVERY_MODE_LOOKUP dmlu = new DELIVERY_MODE_LOOKUP();

                dmlu.ID        = _DeliveryModeLookUpModel.ID;
                dmlu.MODE_CODE = _DeliveryModeLookUpModel.MODE_CODE;
                dmlu.MODE_NAME = _DeliveryModeLookUpModel.MODE_NAME;

                db.DELIVERY_MODE_LOOKUP.Attach(dmlu);
                db.Entry(dmlu).State = System.Data.EntityState.Modified;
                db.SaveChanges();
            }
            catch
            {
                throw;
            }
            return(Request.CreateResponse(HttpStatusCode.OK, "success"));
        }