//
 // GET: /Availability/
 public async Task<ActionResult> Index()
 {
     var model = new AvailabilityModel();
     if (((string)Session["Status"]).CompareTo("LoggedIn") == 0 && Convert.ToInt32(Session["ApplicantID"]) > 0)
     {
         using (var client = new DataServiceClient())
         {
             client.Open();
             var availability = await client.getAvailabilityAsync(Convert.ToInt32(Session["ApplicantId"]));
             if (availability.applicantId <= 0)
             {
                 model.applicantId = Convert.ToInt32(Session["ApplicantID"]);
             }
             else
             {
                 model.daysYN = availability.daysYN;
                 model.eveningsYN = availability.eveningsYN;
                 model.fridayFrom = availability.fridayFrom == null ? 0 : availability.fridayFrom.Value.Hours + 1;
                 model.fridayTo = availability.fridayTo == null ? 0 : availability.fridayTo.Value.Hours + 1;
                 model.fullTimeYN = availability.fullTimeYN;
                 model.mondayFrom = availability.mondayFrom == null ? 0 : availability.mondayFrom.Value.Hours + 1;
                 model.mondayTo = availability.mondayTo == null ? 0 : availability.mondayTo.Value.Hours + 1;
                 model.salaryExpected = availability.salaryExpected;
                 model.saturdayFrom = availability.saturdayFrom == null ? 0 : availability.saturdayFrom.Value.Hours + 1;
                 model.saturdayTo = availability.saturdayTo == null ? 0 : availability.saturdayTo.Value.Hours + 1;
                 model.sundayFrom = availability.sundayFrom == null ? 0 : availability.sundayFrom.Value.Hours + 1;
                 model.sundayTo = availability.sundayTo == null ? 0 : availability.sundayTo.Value.Hours + 1;
                 model.thursdayFrom = availability.thursdayFrom == null ? 0 : availability.thursdayFrom.Value.Hours + 1;
                 model.thursdayTo = availability.thursdayTo == null ? 0 : availability.thursdayTo.Value.Hours + 1;
                 model.tuesdayFrom = availability.tuesdayFrom == null ? 0 : availability.tuesdayFrom.Value.Hours + 1;
                 model.tuesdayTo = availability.tuesdayTo == null ? 0 : availability.tuesdayTo.Value.Hours + 1;
                 model.wednesdayFrom = availability.wednesdayFrom == null ? 0 : availability.wednesdayFrom.Value.Hours + 1;
                 model.wednesdayTo = availability.wednesdayTo == null ? 0 : availability.wednesdayTo.Value.Hours + 1;
                 model.weekendsYN = availability.weekendsYN;
                 model.applicantId = availability.applicantId;
             }
             client.Close();
         }
     }
     else
     {
         //error need to login or applicantId not properly set
     }
     return View(model);
 }