public HttpResponseMessage CreateTaxibilityCISModelLookUp(TaxibilityCISLookUpModel _TaxibilityCISLookUpModel) { try { TAXABILITY_CIS_LOOKUP tclu = new TAXABILITY_CIS_LOOKUP(); tclu.TAXABLE_CIS_ID = _TaxibilityCISLookUpModel.TAXABLE_CIS_ID; tclu.TAXABLE_CIS_DESC = _TaxibilityCISLookUpModel.TAXABLE_CIS_DESC; if (!db.TAXABILITY_CIS_LOOKUP.Any(a => a.TAXABLE_CIS_ID == tclu.TAXABLE_CIS_ID)) { db.TAXABILITY_CIS_LOOKUP.Add(tclu); db.SaveChanges(); } else { return(Request.CreateResponse(HttpStatusCode.BadRequest, "duplicate key")); } } catch { throw; } return(Request.CreateResponse(HttpStatusCode.OK, "success")); }
public HttpResponseMessage DeleteTaxibilityCISModelLookUp(TaxibilityCISLookUpModel _TaxibilityCISLookUpModel) { try { TAXABILITY_CIS_LOOKUP tclu = new TAXABILITY_CIS_LOOKUP(); tclu.TAXABLE_CIS_ID = _TaxibilityCISLookUpModel.TAXABLE_CIS_ID; tclu.TAXABLE_CIS_DESC = _TaxibilityCISLookUpModel.TAXABLE_CIS_DESC; db.TAXABILITY_CIS_LOOKUP.Attach(tclu); db.TAXABILITY_CIS_LOOKUP.Remove(tclu); db.SaveChanges(); } catch { throw; } return(Request.CreateResponse(HttpStatusCode.OK, "success")); }
public HttpResponseMessage UpdateTaxibilityCISModelLookUp(TaxibilityCISLookUpModel _TaxibilityCISLookUpModel) { try { TAXABILITY_CIS_LOOKUP tclu = new TAXABILITY_CIS_LOOKUP(); tclu.TAXABLE_CIS_ID = _TaxibilityCISLookUpModel.TAXABLE_CIS_ID; tclu.TAXABLE_CIS_DESC = _TaxibilityCISLookUpModel.TAXABLE_CIS_DESC; db.TAXABILITY_CIS_LOOKUP.Attach(tclu); db.Entry(tclu).State = System.Data.EntityState.Modified; db.SaveChanges(); } catch { throw; } return(Request.CreateResponse(HttpStatusCode.OK, "success")); }