public void DeleteFinancialRecordDetail(ProjectFinancialRecordDetail model) { using (SqlCommand command = new SqlCommand("[TIP].[DeleteProjectFinancialRecordDetail]") { CommandType = CommandType.StoredProcedure }) { command.Parameters.AddWithValue("@projectFinancialRecordID", model.ProjectFinancialRecordID); command.Parameters.AddWithValue("@fundingLevelID", model.FundingLevelID); command.Parameters.AddWithValue("@fundingPeriodID", model.FundingPeriodID); command.Parameters.AddWithValue("@fundingTypeID", model.FundingTypeID); this.ExecuteNonQuery(command); } }
public JsonResult UpdateFinancialRecordDetail(int projectFinancialRecordID, int fundingTypeID, int fundingLevelID, int fundingPeriodID, decimal incr01, decimal incr02, decimal incr03, decimal incr04, decimal incr05) { ProjectFinancialRecordDetail model = new ProjectFinancialRecordDetail() { ProjectFinancialRecordID = projectFinancialRecordID , FundingLevelID = fundingLevelID , FundingTypeID = fundingTypeID , FundingPeriodID = fundingPeriodID , Incr01 = incr01 , Incr02 = incr02 , Incr03 = incr03 , Incr04 = incr04 , Incr05 = incr05 }; try { _rtpProjectRepository.UpdateFinancialRecordDetail(model); } catch (Exception ex) { //this.Logger.LogMethodError("ProjectController", "UpdateFinancialRecordDetail", Request.Form.ToString(), ex); return Json(new { message = "Changes could not be stored. An error has been logged." , error = "true" , exceptionMessage = ex.Message }); } return Json(new { message = "Project Financial Record Detail successfully updated." , error = "false" }); }
public void UpdateFinancialRecordDetail(ProjectFinancialRecordDetail model) { using (SqlCommand command = new SqlCommand("[TIP].[UpdateProjectFinancialRecordDetail]") { CommandType = CommandType.StoredProcedure }) { command.Parameters.AddWithValue("@projectFinancialRecordID", model.ProjectFinancialRecordID); command.Parameters.AddWithValue("@fundingLevelID", model.FundingLevelID); command.Parameters.AddWithValue("@fundingPeriodID", model.FundingPeriodID); command.Parameters.AddWithValue("@fundingTypeID", model.FundingTypeID); command.Parameters.AddWithValue("@incr01", model.Incr01 != null ? (object)model.Incr01 : (object)DBNull.Value); command.Parameters.AddWithValue("@incr02", model.Incr02 != null ? (object)model.Incr02 : (object)DBNull.Value); command.Parameters.AddWithValue("@incr03", model.Incr03 != null ? (object)model.Incr03 : (object)DBNull.Value); command.Parameters.AddWithValue("@incr04", model.Incr04 != null ? (object)model.Incr04 : (object)DBNull.Value); command.Parameters.AddWithValue("@incr05", model.Incr05 != null ? (object)model.Incr05 : (object)DBNull.Value); this.ExecuteNonQuery(command); } }