public IHttpActionResult DeleteItem(int transfer_activity_key) { try { TransferActivityRepository ta = new TransferActivityRepository(db); ta.Delete(transfer_activity_key); return(Ok()); } catch (Exception exError) { return(BadRequest((new Error(0, exError.Message, "Delete Item").ToString()))); } }
public IHttpActionResult BatchSave(TransferActivityBatchDTO[] transferactivities) { TransferActivityRepository ta = new TransferActivityRepository(db); foreach (TransferActivityBatchDTO taItem in transferactivities) { switch (taItem.action.ToUpper()) { case "CREATE": ta.Create(taItem.transfer_activity); break; case "UPDATE": ta.Update(taItem.transfer_activity); break; case "DELETE": ta.Delete(taItem.transfer_activity.transfer_activity_key); break; } } return(Ok()); }