public IHttpActionResult PutForm_Template_Master(int id, Form_Template_Master Form_Template_Master) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != Form_Template_Master.Form_Template_ID) { return BadRequest(); } db.Entry(Form_Template_Master).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Form_Template_MasterExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostForm_Template_Master(Form_Template_Master Form_Template_Master) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (Form_Template_Master.Form_Template_ID != -1) PutForm_Template_Master(Form_Template_Master.Form_Template_ID, Form_Template_Master); else { db.Form_Template_Master.Add(Form_Template_Master); db.SaveChanges(); CreateDynamicTable(Form_Template_Master.Form_Entity); } return CreatedAtRoute("DefaultApi", true, Form_Template_Master); }