public static eDataForNegotiationActionMail DataForNegotiationActionMail(int id) { using (OneFineRateEntities db = new OneFineRateEntities()) { eDataForNegotiationActionMail obj = new eDataForNegotiationActionMail(); try { var Negotiations = (from B in db.tblBookingTxes.Where(a => a.iBookingId == id) select new { ID = B.iBookingId, StayFrom = B.dtCheckIn, StayTo = B.dtChekOut, Name = B.sTitleOFR + " " + B.sFirstNameOFR + " " + B.sLastNameOFR, Email = B.sEmailOFR, Phone = B.sMobileOFR } ).Distinct().AsQueryable(); var lstUser = Negotiations.ToList(); obj = (eDataForNegotiationActionMail)OneFineRateAppUtil.clsUtils.ConvertToObject(lstUser[0], new eDataForNegotiationActionMail()); } catch (Exception ex) { return(obj); } return(obj); } }
public string AcceptRejectNegotiation(string id, string act, string CO) { object result = null; string strReturn = string.Empty; try { string Status = act == "R" ? (CO == "-1" ? "HR" : "CO") : "BP"; var bookingId = Convert.ToInt32(id); Status = BL_PendingChanges.UpdateNegotiation(((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId, bookingId, Status, (CO == null || CO == "NaN" || CO == "" || CO == "-1") ? 0 : Convert.ToInt32(CO)); if (Status != "") { eDataForNegotiationActionMail DFM = new eDataForNegotiationActionMail(); DFM = BL_PendingChanges.DataForNegotiationActionMail(Convert.ToInt32(id)); SendInformation(Status, bookingId); } switch (Status) // Notifications for hotel, who is not to be shown conserve commission reductions. Mail content/status to customer managed later. { case "HR": // Hotel has rejected the negotiation. case "RR": case "RA": result = new { st = 1, msg = "Bargain rejected and notified to customer via email." }; break; case "CO": // Hotel has countered the negotiation. case "CR": case "CA": result = new { st = 1, msg = "Counter offer applied and notified to customer via email." }; break; case "BP": // Hotel has accepted the negotiation. result = new { st = 1, msg = "Bargain accepted and notified to customer via email." }; break; default: result = new { st = 0, msg = "Something went wrong" }; break; } } catch (Exception) { result = new { st = 0, msg = "Something went wrong" }; } strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result); return(strReturn); }