public IHttpActionResult PutUserEnquiry(long id, UserEnquiry userEnquiry) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != userEnquiry.PKEnquiryId) { return(BadRequest()); } db.Entry(userEnquiry).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!UserEnquiryExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public static void UpdateUserEnquiry(UserEnquiry objUserEnquiry) { TeachersEntities db = new TeachersEntities(); db.Entry(objUserEnquiry).State = EntityState.Modified; db.SaveChanges(); }
public static void InsertUserEnquiry(UserEnquiry objUserEnquiry) { TeachersEntities db = new TeachersEntities(); db.UserEnquiries.Add(objUserEnquiry); db.SaveChanges(); }
public static void DeleteUserEnquiry(int userEnquiryId) { TeachersEntities db = new TeachersEntities(); UserEnquiry objUserEnquiry = db.UserEnquiries.Find(userEnquiryId); db.UserEnquiries.Remove(objUserEnquiry); db.SaveChanges(); }
public ActionResult EditUserEnquiry(long id = 0) { if (id != 0) { UserEnquiry objUserEnquiry = DbHelper.GetUserEnquiry(id); return(View(objUserEnquiry)); } return(View()); }
public IHttpActionResult GetUserEnquiry(long id) { UserEnquiry userEnquiry = db.UserEnquiries.Find(id); if (userEnquiry == null) { return(NotFound()); } return(Ok(userEnquiry)); }
public IHttpActionResult PostUserEnquiry(UserEnquiry userEnquiry) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.UserEnquiries.Add(userEnquiry); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = userEnquiry.PKEnquiryId }, userEnquiry)); }
public IHttpActionResult DeleteUserEnquiry(long id) { UserEnquiry userEnquiry = db.UserEnquiries.Find(id); if (userEnquiry == null) { return(NotFound()); } db.UserEnquiries.Remove(userEnquiry); db.SaveChanges(); return(Ok(userEnquiry)); }
public ActionResult TeacherBooking(TeacherTimeDetails objTeacherDetails) { Roleslst(); UserEnquiry objUserEnquiry = new UserEnquiry(); objUserEnquiry.FollowUP = true; objUserEnquiry.FKUserId = Helper.UserId; objUserEnquiry.FKClassId = objTeacherDetails.ClassId; objUserEnquiry.FKTeacherId = objTeacherDetails.TeacherId; objUserEnquiry.FKAvailableTimeId = objTeacherDetails.AvailableTeacherTimeId; objUserEnquiry.BookedFromDate = Convert.ToDateTime(objTeacherDetails.FromAvailableDate).Date; objUserEnquiry.BookedFromTime = new TimeSpan(Convert.ToInt32((objTeacherDetails.FromAvailableTime).Split(':')[0]), 0, 0); objUserEnquiry.BookedToTime = new TimeSpan(Convert.ToInt32((objTeacherDetails.ToAvailableTime).Split(':')[0]), 0, 0).Duration(); objUserEnquiry.BookedToDate = Convert.ToDateTime(objTeacherDetails.ToAvailableDate).Date; objUserEnquiry.CreatedDate = DateTime.Now; objUserEnquiry.BookingStatus = "Processing"; DbHelper.InsertUserEnquiry(objUserEnquiry); var enquiryId = objUserEnquiry.PKEnquiryId; //var enquiryId = 23; TeacherProfile obj = DbHelper.GetTeacher(objUserEnquiry.FKTeacherId); UserProfile objUser = DbHelper.GetUserProfile(obj.FKUserId); StringBuilder str = new StringBuilder(); str.Append("Dear " + objUser.UserName + ","); str.Append("<br/><br/>"); str.Append($"Thank you for Booking the {objTeacherDetails.TeacherName}.Your Order or Enquiry Id is {enquiryId}<br/>"); str.Append($"Your Booking Dates and Times are:-<br/><br/>"); str.Append($"<table border=1><tr><th>From Date</th><th> ToDate</th><th> FromTime</th><th> ToTime</th><th>Booking Status</th></tr>"); str.Append($"<tr><th>{ objUserEnquiry.BookedFromDate.ToShortDateString()}</th><th> { objUserEnquiry.BookedToDate.ToShortDateString()}</th><th> {objTeacherDetails.FromAvailableTime}</th><th> {objTeacherDetails.ToAvailableTime}</th><th>{objUserEnquiry.BookingStatus}</th></tr></table>"); str.Append($"<br/><p><strong>The Teacher has to accept your booking,So please wait for confirmation from Teacher</strong></p>"); str.Append($"<p>This is an automatically generated message to confirm receipt of your Booking via the Internet.You do not need to reply to this e - mail, but you may wish to save it for your records.<br/>Thank you.</p>"); str.Append($"<br/>WarmRegards,<br/> SupportTeam"); GmailHelper.Send(objUser.EmailId, "Regarding TeacherBooking", str.ToString()); // GmailHelper.Send("*****@*****.**", "Regarding TeacherBooking", str.ToString()); // str.Replace("Dear " + objUser.UserName + ",", "Dear " + obj.UserProfile.UserName + ","); //GmailHelper.Send(obj.UserProfile.EmailId, "Regarding User Booking ", str.ToString()); return(View("SuccessPage", objUserEnquiry)); }
public ActionResult EditUserEnquiry(UserEnquiry objUserEnquiry) { if (ModelState.IsValid) { if (objUserEnquiry.FollowUP == false) { objUserEnquiry.BookingStatus = "Cancelled By Teacher"; StringBuilder str = new StringBuilder(); str.Append("Dear " + objUserEnquiry.UserName + ","); str.Append("<br/><br/>"); str.Append($"Thank you for Booking the {objUserEnquiry.TeacherName}.Your Order or Enquiry Id is {objUserEnquiry.PKEnquiryId}<br/>"); str.Append($"Your Booking Dates and Times are:-<br/><br/>"); str.Append($"<table border=1><tr><th>From Date</th><th> ToDate</th><th> FromTime</th><th> ToTime</th><th>Booking Status</th></tr>"); str.Append($"<tr><th>{ objUserEnquiry.BookedFromDate.ToShortDateString()}</th><th> { objUserEnquiry.BookedToDate.ToShortDateString()}</th><th> {objUserEnquiry.BookedFromTime}</th><th> {objUserEnquiry.BookedToTime}</th><th>{objUserEnquiry.BookingStatus}</th></tr></table>"); str.Append($"<br/><p><strong>Congra the teacher has to accepted your booking,So please Send your PayPal Id to Teacher. Teacher Email Id is {objUserEnquiry.TeacherProfile.UserProfile.EmailId} </strong></p>"); str.Append($"<p>This is an automatically generated message to confirm receipt of your Booking via the Internet.You do not need to reply to this e - mail, but you may wish to save it for your records.<br/>Thank you.</p>"); str.Append($"<br/>WarmRegards,<br/> SupportTeam"); GmailHelper.Send(objUserEnquiry.EmailId, "Regarding TeacherBooking", str.ToString()); } else { objUserEnquiry.BookingStatus = "Accepted By Teacher"; StringBuilder str = new StringBuilder(); str.Append("Dear " + objUserEnquiry.UserName + ","); str.Append("<br/><br/>"); str.Append($"Thank you for choosing the {objUserEnquiry.TeacherName}.Your Order or Enquiry Id is {objUserEnquiry.PKEnquiryId}<br/>"); str.Append($"Sorry say that teacher has cancelled the booking due to heavy booking on teacher"); str.Append($"<table border=1><tr><th>From Date</th><th> ToDate</th><th> FromTime</th><th> ToTime</th><th>Booking Status</th></tr>"); str.Append($"<tr><th>{ objUserEnquiry.BookedFromDate.ToShortDateString()}</th><th> { objUserEnquiry.BookedToDate.ToShortDateString()}</th><th> {objUserEnquiry.BookedFromTime}</th><th> {objUserEnquiry.BookedToTime}</th><th>{objUserEnquiry.BookingStatus}</th></tr></table>"); str.Append($"<p>This is an automatically generated message to confirm receipt of your Booking via the Internet.You do not need to reply to this e - mail, but you may wish to save it for your records.<br/>Thank you.</p>"); str.Append($"<br/>WarmRegards,<br/> SupportTeam"); GmailHelper.Send(objUserEnquiry.EmailId, "Regarding TeacherBooking", str.ToString()); } DbHelper.UpdateUserEnquiry(objUserEnquiry); return(View("Index")); } return(View(objUserEnquiry)); }
public ActionResult SuccessPage(UserEnquiry userEnquiry) { Roleslst(); return(View(userEnquiry)); }
public ActionResult EmailEnquiry(UserEnquiry enquiryForm) { var response = _userService.SendEnquiry(enquiryForm); return(Ok(APIResponse.CreateResponse(_jwtAuthentication.Value, _httpContextAccessor.HttpContext.Request, response))); }