protected void btnAssign_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(2000); offServ = new OfficerServicesClient(); OfficerHandlesAccommo offHandlsAcc = new OfficerHandlesAccommo(); offHandlsAcc.OfficerID = assgnOfficer.ID; offHandlsAcc.AccommoID = AccoId; offHandlsAcc.AssignDate = DateTime.Now.ToString(); string outcome = offServ.assignAccommodations(offHandlsAcc); if (outcome.Contains("Success")) { ModalPopupExtenderSuccess.Show(); System.Threading.Thread.Sleep(2000); } else if (outcome.Contains("Failed")) { ModalPopupExtenderFailed.Show(); System.Threading.Thread.Sleep(2000); } }
public string assignAccommodations(OfficerHandlesAccommo assignment) { try { using (HotelManagementServerDataContext db = new HotelManagementServerDataContext()) { MANAGER_HANDLES_HOTEL insert = new MANAGER_HANDLES_HOTEL() { HOTEL_ID = assignment.AccommoID, MANAGER_ID = assignment.OfficerID, DATE_ASSIGNED = Convert.ToDateTime(assignment.AssignDate) }; db.MANAGER_HANDLES_HOTELs.InsertOnSubmit(insert); db.SubmitChanges(); return("Success"); } } catch (Exception e) { return("Failed " + e.Message); } }