示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            DoubleDateDetails doubleDateDetails = db.DoubleDateDetails.Find(id);

            db.DoubleDateDetails.Remove(doubleDateDetails);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "doubleDateDetailsID,doubleDateRequestID,placeSequenceNbr,placeID,meetTime,externalPlaceName,externalPlaceAddress,memo,createDate")] DoubleDateDetails doubleDateDetails)
 {
     if (ModelState.IsValid)
     {
         db.Entry(doubleDateDetails).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.doubleDateRequestID = new SelectList(db.DoubleDateRequest, "doubleDateRequestID", "memo", doubleDateDetails.doubleDateRequestID);
     ViewBag.placeID             = new SelectList(db.Place, "PlaceID", "Name", doubleDateDetails.placeID);
     return(View(doubleDateDetails));
 }
示例#3
0
        // GET: DoubleDateDetails/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DoubleDateDetails doubleDateDetails = db.DoubleDateDetails.Find(id);

            if (doubleDateDetails == null)
            {
                return(HttpNotFound());
            }
            return(View(doubleDateDetails));
        }
示例#4
0
        // GET: DoubleDateDetails/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DoubleDateDetails doubleDateDetails = db.DoubleDateDetails.Find(id);

            if (doubleDateDetails == null)
            {
                return(HttpNotFound());
            }
            ViewBag.doubleDateRequestID = new SelectList(db.DoubleDateRequest, "doubleDateRequestID", "memo", doubleDateDetails.doubleDateRequestID);
            ViewBag.placeID             = new SelectList(db.Place, "PlaceID", "Name", doubleDateDetails.placeID);
            return(View(doubleDateDetails));
        }
示例#5
0
        public ActionResult DDRequest([Bind(Include = "doubleDateRequestID,requestDate,accepted,acceptedDate,requestingMemberID,requestToMemberID,memo,requestedDateMeetTime,requestingMemberReview,requestedMemberReview,requestingMemberRating,requestedMemberRating")] DoubleDateRequest doubleDateRequest, FormCollection fc)
        {
            if (ModelState.IsValid)
            {
                Dictionary <string, bool> places = new Dictionary <string, bool>();
                foreach (var key in fc.AllKeys)
                {
                    if (key.Contains("places"))
                    {
                        string _selected = fc.Get(key);
                        string _name     = key.ToString();
                        bool   _checked;

                        if (_selected == "on")
                        {
                            _checked = true;
                        }
                        else
                        {
                            _checked = false;
                        }
                        places.Add(_name, _checked);
                    }
                }

                DateTime rDate = Convert.ToDateTime(fc.GetValues("requestDate")[0]);
                string[] memo  = fc.GetValues("Memo");

                doubleDateRequest.RequestDate        = rDate;
                doubleDateRequest.RequestingMemberID = config.LoggedInMember.ID;
                doubleDateRequest.RequestToMemberID  = (long)RouteID;

                db.DoubleDateRequest.Add(doubleDateRequest);
                db.SaveChanges();

                if (places != null)
                {
                    foreach (var p in places)
                    {
                        string[] _name = p.Key.ToString().Split('-');

                        bool _checked = p.Value;

                        string gPID = _name[1].ToString();

                        DoubleDateDetails newDDDetail = new DoubleDateDetails();
                        newDDDetail.DoubleDateRequestID = doubleDateRequest.ID;
                        newDDDetail.gPlaceID            = gPID;
                        newDDDetail.DateCreated         = DateTime.Now;
                        //newDDDetail.meetTime = rDate;
                        newDDDetail.Memo = memo[0];

                        db.DoubleDateDetails.Add(newDDDetail);
                        db.SaveChanges();
                    }
                }

                //send email to

                //create message
                Messages message = new Messages();
                message.memberID   = config.LoggedInMember.ID;
                message.toMemberID = (long)RouteID;
                message.subject    = "New Date Request is waiting for you!";
                message.body       = "Click <a href='/DoubleDateRequests/Details/"
                                     + doubleDateRequest.ID
                                     + "'>here</a> to see the Date Request and to Accept or Deny it. ";

                message.dateCreated = DateTime.Now;

                db.Messages.Add(message);
                db.SaveChanges();

                //send email
                string _toEmail    = config.GetEmailAddress((long)RouteID);
                string _fromMember = config.LoggedInMember.ScreenName;

                MailModel mm = new MailModel();
                mm.To      = _toEmail;
                mm.Subject = "You have a Date Request from CouplesDatingScene.com member: " + _fromMember;
                mm.Body    = "</br> Click <a href='www.couplesdatingscene.com'>here</a> to go to site and find your new Date Request in your Mailbox. Click or use this url if the previous one doesn't work https://www.CouplesDatingScene.com";

                string _path = "/content/images/members/profilepics/test.jpg";
                _path = config.LoggedInMember.MemberMedia.FirstOrDefault().path.Replace("~", "");

                SendMailerController.SendEmail(mm, _path);

                //redirect to confirmation page?
                return(RedirectToAction("Details", "Members", new { id = (long)RouteID }));
            }

            ViewBag.requestingMemberID = new SelectList(db.Member, "memberId", "FirstName1", doubleDateRequest.RequestingMemberID);
            ViewBag.requestToMemberID  = new SelectList(db.Member, "memberId", "FirstName1", doubleDateRequest.RequestToMemberID);
            return(View(doubleDateRequest));
        }