Example #1
0
        public static void AddSuggestToMeetingTable(Dictionary <string, string> d, bool?gender)//הוספת הצעה לטבלת הצעות
        {
            string mail;

            foreach (var item in d)
            {
                Meeting m = new Meeting();
                m.tzGroom     = item.Key;
                m.tzBride     = item.Value;
                m.StatusBride = 1;
                m.StatusGroom = 1;
                m.KindMeeting = 1;
                context.Meetings.Add(m);
                context.SaveChanges();
                mail = gender == true?context.Users.FirstOrDefault(p => p.Tz == m.tzBride).Mail
                       : context.Users.FirstOrDefault(p => p.Tz == m.tzGroom).Mail;

                SendMail.addSuggesrToCandidateMail(mail);
            }
        }
Example #2
0
        public static void EditMeeting(Meeting m)//מעדכן שינויים בפגישה
        {
            Meeting mSql = context.Meetings.FirstOrDefault(p => p.MeetingId == m.MeetingId);

            if (m.StatusBride != mSql.StatusBride)
            {
                User u = context.Users.FirstOrDefault(p => p.Tz == m.tzBride);
                if (m.StatusBride == 2)//שינה סטטוס למעונין
                {
                    SendMail.interestingSuggestMail(u, m.tzGroom);
                }
                if (m.StatusBride == 5)//סגירת שידוך
                {
                    SendMail.closeMatch(u.Mail);
                    Candidate c = context.Candidates.FirstOrDefault(p => p.UserId == u.UserId);
                    c.EnterIn = 3;
                }
            }
            if (m.StatusGroom != mSql.StatusGroom)
            {
                User u = context.Users.FirstOrDefault(p => p.Tz == m.tzGroom);
                if (m.StatusGroom == 2)//שינה סטטוס למעונין
                {
                    SendMail.interestingSuggestMail(u, m.tzBride);
                }
                if (m.StatusGroom == 5)//סגירת שידוך
                {
                    SendMail.closeMatch(u.Mail);
                    Candidate c = context.Candidates.FirstOrDefault(p => p.UserId == u.UserId);
                    c.EnterIn = 3;
                    context.Entry(c).State = EntityState.Modified;
                }
            }
            context.Entry(m).State = EntityState.Modified;
            context.SaveChanges();
        }
Example #3
0
 public static void maileToMatchmaker(string subject, string text)//שליחת מייל לשדכן
 {
     SendMail.mail3(text, subject, "*****@*****.**");
 }