/// <summary> /// Update start and end date /// </summary> /// <param name="str"></param> /// <returns></returns> public static Phase Reschedule(this RPeriodSchedule evt, DateTime startDate, DateTime endDate) { var conn = new SqlConnection("Data Source=localhost\\SQLENTERPRISE;Initial Catalog=Planner;Integrated Security=SSPI;MultipleActiveResultSets=true"); try { using (conn) { conn.Open(); var cmd = new SqlCommand("sp_update_phase_dates", conn); cmd.Parameters.Add("@Id", System.Data.SqlDbType.Int).Value = evt.Id; cmd.Parameters.Add("@StartDate", System.Data.SqlDbType.DateTime).Value = startDate; cmd.Parameters.Add("@EndDate", System.Data.SqlDbType.DateTime).Value = endDate; cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.ExecuteNonQuery(); var rep = new ReleaseRepository(); var phase = rep.GetRelease(evt.Id); return phase; } } catch (Exception ex) { throw; } }
public JsonResult GetReleaseById(int id) { var rep = new ReleaseRepository(); var release = rep.GetRelease(id); var result = this.Json(release, JsonRequestBehavior.AllowGet); return result; }