public HttpResponseMessage CreateProductGroupLookUp(ProductGroupLookUpModel _ProductGroupLookUpModel) { try { PRODUCT_GROUP_LOOKUP pglu = new PRODUCT_GROUP_LOOKUP(); pglu.PRODUCT_GROUP_ID = _ProductGroupLookUpModel.PRODUCT_GROUP_ID; pglu.GROUP_CODE = _ProductGroupLookUpModel.GROUP_CODE; pglu.GROUP_DESCRIPTION = _ProductGroupLookUpModel.GROUP_DESCRIPTION; db.PRODUCT_GROUP_LOOKUP.Add(pglu); db.SaveChanges(); } catch { throw; } return(Request.CreateResponse(HttpStatusCode.OK, "success")); }
public HttpResponseMessage UpdateProductGroupLookUp(ProductGroupLookUpModel _ProductGroupLookUpModel) { try { PRODUCT_GROUP_LOOKUP pglu = new PRODUCT_GROUP_LOOKUP(); pglu.PRODUCT_GROUP_ID = _ProductGroupLookUpModel.PRODUCT_GROUP_ID; pglu.GROUP_DESCRIPTION = _ProductGroupLookUpModel.GROUP_DESCRIPTION; pglu.GROUP_CODE = _ProductGroupLookUpModel.GROUP_CODE; db.PRODUCT_GROUP_LOOKUP.Attach(pglu); db.Entry(pglu).State = System.Data.EntityState.Modified; db.SaveChanges(); } catch { throw; } return(Request.CreateResponse(HttpStatusCode.OK, "success")); }