public bool SaveGrants(ref GrantsDto dto) { SQLParamCollection p = new SQLParamCollection(); p.AddWithValue("@ID", dto.ID); p.AddWithValue("@GrantID", dto.GrantID); p.AddWithValue("@ProgramName", dto.ProgramName); p.AddWithValue("@AgencyName", dto.AgencyName); p.AddWithValue("@ContactInformation", dto.ContactInformation); p.AddWithValue("@GrantSubject", dto.GrantSubject); p.AddWithValue("@EligibleActivities", dto.EligibleActivities); p.AddWithValue("@LastUpdated", dto.LastUpdated); p.AddWithValue("@CostShareType", dto.CostShareType); p.AddWithValue("@CostShareDescription", dto.CostShareDescription); p.AddWithValue("@OtherProgramCharacteristics", dto.OtherProgramCharacteristics); p.AddWithValue("@ApplicationDueDate", dto.ApplicationDueDate); p.AddWithValue("@DueDate", dto.DueDate); p.AddWithValue("@ApplicationSubType", dto.ApplicationSubType); p.AddWithValue("@FundingType", dto.FundingType); p.AddWithValue("@Active", dto.Active); p.AddWithValue("@CreatedByUserID", dto.CreatedByUserID); p.AddWithValue("@LastUpdatedByUserID", dto.LastUpdatedByUserID); p.AddWithValue("@IdentityVal", 0, System.Data.SqlDbType.Int, ParameterDirection.Output); return(SaveCommand("SaveGrants", p)); }
public bool UpdateActive(GIDB db = null /* TODO Change to default(_) if this is not a reference type */) { bool bDBIsNothing = db == null; if (bDBIsNothing) { db = new GIDB(); } bool retval = false; try { GrantsDto obj = this; retval = db.UpdateGrantActive(ref obj); this.ID = db.Identity; } catch (Exception ex) { throw new Exception("GrantsDto.Delete: " + ex.Message + Constants.vbCrLf); } finally { if (bDBIsNothing) { db = null /* TODO Change to default(_) if this is not a reference type */; } } return(retval); }
public bool UpdateGrantActive(ref GrantsDto dto) { SQLParamCollection p = new SQLParamCollection(); p.AddWithValue("@ID", dto.ID); p.AddWithValue("@Active", dto.Active); return(UpdateCommand("UpdateGrantActive", p)); }