public async Task <IHttpActionResult> PutBO_ROLE(long id, BO_ROLE bO_ROLE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bO_ROLE.BO_ROLE_ID) { return(BadRequest()); } db.Entry(bO_ROLE).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BO_ROLEExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> PutVERSIONS(long id, VERSIONS vERSIONS) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != vERSIONS.VERSIONS_ID) { return(BadRequest()); } db.Entry(vERSIONS).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VERSIONSExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async System.Threading.Tasks.Task <DataTable> SaveBoRolesAsync(string roleId, string userName, List <BoRoleLine> boRoleLines, FAISEntities db) { foreach (var line in boRoleLines) { var boRole = new BO_ROLE() { ROLE_ID = line.ROLE_ID, CAN_READ = line.CAN_READ, CAN_WRITE = line.CAN_WRITE, STATUS = "ACTIVE", }; if (line.OBJECT_TYPE == "BO") { boRole.META_BO_ID = line.META_BO_ID; } else { boRole.PAGE_ID = line.META_BO_ID; } if (line.lineStatus == "new") { boRole.CREATED_BY = userName; boRole.CREATED_DATE = DateTime.Now; boRole.ROLE_ID = roleId; db.Entry(boRole).State = System.Data.Entity.EntityState.Added; } else { boRole = await db.BO_ROLE.FindAsync(line.BO_ROLE_ID); boRole.CAN_READ = line.CAN_READ; boRole.CAN_WRITE = line.CAN_WRITE; boRole.UPDATED_BY = userName; boRole.UPDATED_DATE = DateTime.Now; db.Entry(boRole).State = System.Data.Entity.EntityState.Modified; } } await db.SaveChangesAsync(); return(GetBoRoles(roleId)); }
public async Task <IHttpActionResult> PutMETA_BO(long id, META_BO mETA_BO) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } META_BO meta = await db.META_BO.FindAsync(id); if (meta == null) { return(BadRequest("META_BO NOT FOUND !")); } meta.BO_NAME = mETA_BO.BO_NAME; meta.TYPE = mETA_BO.TYPE; meta.JSON_DATA = mETA_BO.JSON_DATA; meta.UPDATED_BY = User.Identity.Name; meta.UPDATED_DATE = DateTime.Now; db.Entry(meta).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!META_BOExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> PutPAGE(long id, PAGE pAGE) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != pAGE.BO_ID) { return(BadRequest()); } pAGE.UPDATED_DATE = DateTime.Now; pAGE.UPDATED_BY = User.Identity.Name; db.Entry(pAGE).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PAGEExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> PutMETA_FIELD(long id, META_FIELD model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } META_FIELD metafeldDB = await db.META_FIELD.FindAsync(id); if (metafeldDB == null) { return(NotFound()); } if (metafeldDB.STATUS.Trim() == "NEW") { metafeldDB.DB_NAME = model.DB_NAME; metafeldDB.DB_NULL = 1;//model.DB_NULL; } if (metafeldDB.STATUS.Trim() == "NEW" || (metafeldDB.FORM_TYPE != "v-datepicker" & metafeldDB.FORM_TYPE != "v-checkbox")) { metafeldDB.FORM_TYPE = model.FORM_TYPE; } metafeldDB.GRID_NAME = model.GRID_NAME; metafeldDB.GRID_SHOW = model.GRID_SHOW; metafeldDB.GRID_FORMAT = model.GRID_FORMAT; metafeldDB.FORM_NAME = model.FORM_NAME; metafeldDB.FORM_SOURCE = model.FORM_SOURCE; metafeldDB.FORM_OPTIONAL = model.FORM_OPTIONAL; metafeldDB.IS_FILTER = model.IS_FILTER; metafeldDB.UPDATED_BY = User.Identity.Name; metafeldDB.UPDATED_DATE = DateTime.Now; if (!string.IsNullOrEmpty(model.JSON_DATA)) { metafeldDB.JSON_DATA = model.JSON_DATA; } db.Entry(metafeldDB).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException ex) { if (!META_FIELDExists(id)) { return(NotFound()); } else { throw; } } catch (DbEntityValidationException ex) { } return(StatusCode(HttpStatusCode.NoContent)); }