public string Post(LU_CommentsType _LU_CommentsType, string transactionType) { string ret = string.Empty; try { Parameters[] colparameters = new Parameters[8] { new Parameters("@paramId", _LU_CommentsType.Id, DbType.Int32, ParameterDirection.Input), new Parameters("@paramCommentsType", _LU_CommentsType.CommentsType, DbType.String, ParameterDirection.Input), new Parameters("@paramCreatorId", _LU_CommentsType.CreatorId, DbType.Int32, ParameterDirection.Input), new Parameters("@paramCreationDate", _LU_CommentsType.CreationDate, DbType.DateTime, ParameterDirection.Input), new Parameters("@paramModifierId", _LU_CommentsType.ModifierId, DbType.Int32, ParameterDirection.Input), new Parameters("@paramModificationDate", _LU_CommentsType.ModificationDate, DbType.DateTime, ParameterDirection.Input), new Parameters("@paramIsActive", _LU_CommentsType.IsActive, DbType.Boolean, ParameterDirection.Input), new Parameters("@paramTransactionType", transactionType, DbType.String, ParameterDirection.Input) }; dbExecutor.ManageTransaction(TransactionType.Open); ret = dbExecutor.ExecuteScalarString(true, CommandType.StoredProcedure, "wsp_LU_CommentsType_Post", colparameters, true); dbExecutor.ManageTransaction(TransactionType.Commit); } catch (DBConcurrencyException except) { dbExecutor.ManageTransaction(TransactionType.Rollback); throw except; } catch (Exception ex) { dbExecutor.ManageTransaction(TransactionType.Rollback); throw ex; } return(ret); }
public IHttpActionResult PutLU_CommentsType(int id, LU_CommentsType lU_CommentsType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != lU_CommentsType.Id) { return(BadRequest()); } db.Entry(lU_CommentsType).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!LU_CommentsTypeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetLU_CommentsType(int id) { LU_CommentsType lU_CommentsType = db.LU_CommentsType.Find(id); if (lU_CommentsType == null) { return(NotFound()); } return(Ok(lU_CommentsType)); }
public IHttpActionResult PostLU_CommentsType(LU_CommentsType lU_CommentsType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.LU_CommentsType.Add(lU_CommentsType); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = lU_CommentsType.Id }, lU_CommentsType)); }
public IHttpActionResult DeleteLU_CommentsType(int id) { LU_CommentsType lU_CommentsType = db.LU_CommentsType.Find(id); if (lU_CommentsType == null) { return(NotFound()); } db.LU_CommentsType.Remove(lU_CommentsType); db.SaveChanges(); return(Ok(lU_CommentsType)); }
public string Post(LU_CommentsType obj, string transactionType) { string ret = string.Empty; try { obj.CreatorId = 1; obj.ModifierId = 1; obj.CreationDate = DateTime.Now; obj.ModificationDate = DateTime.Now; ret = Facade.LU_CommentsTypeDAO.Post(obj, transactionType); return(ret); } catch (Exception ex) { return(ex.Message); } }