示例#1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            var        ID      = Request.QueryString["identifier"];
            int        id      = Convert.ToInt32(ID);
            var        context = new MOMEntities();
            MOMDETAILS USER    = new MOMDETAILS();

            USER = context.MOMDETAILS.Single(x => x.KEY == id);
            var          meeting = USER.MOMDETAILS1;
            MEETINGTABLE Meeting = new MEETINGTABLE();

            Meeting = context.MEETINGTABLE.Single(x => x.MEETINGID == USER.MOMDETAILS1);
            var          CPID = Meeting.CHAIRPERSON;
            DETAILSTABLE cp   = new DETAILSTABLE();

            cp = context.DETAILSTABLE.Single(x => x.UNIQUEID == CPID);
            var email = cp.EMAIL;

            using (MailMessage mm = new MailMessage("*****@*****.**", email))
            {
                mm.Subject = "REMINDER";



                //var link = Request.Url.AbsoluteUri.Replace(Request.Url.PathAndQuery, verifyUrl);
                //mm.Body = USER.ACTIONABLE+" "+ USER.ITEM+" "+ USER.STATUS+" "+ USER.EXPECTEDCLOSURE;
                mm.Body       = USER.ACTIONPOINT + USER.TASKDESCRIPTION + USER.TARGET;
                mm.IsBodyHtml = true;
                SmtpClient smtp = new SmtpClient();
                smtp.Host      = "smtp.gmail.com";
                smtp.EnableSsl = true;
                System.Net.NetworkCredential credentials = new System.Net.NetworkCredential();
                credentials.UserName       = "******";
                credentials.Password       = "******";
                smtp.UseDefaultCredentials = true;
                smtp.Credentials           = credentials;
                smtp.Port = 587;
                smtp.Send(mm);
            }
        }
示例#2
0
        private void BindGrid()
        {
            var token = Session["TOKEN"] as string;
            var user  = TokenManager.Identifytoken(token);

            var context = new MOMEntities();
            // var list = from u in MEETINGTABLE sel List<MEETINGTABLE> list = new List<MEETINGTABLE>();
            var dep     = user.DEPARTMENT;
            var DepMeet = (List <MEETDEP>)context.MEETDEP.Where(x => x.DEPID == dep).ToList();
            List <MEETINGTABLE> list = new List <MEETINGTABLE>();

            foreach (var item in DepMeet)
            {
                MEETINGTABLE x = new MEETINGTABLE();
                x = context.MEETINGTABLE.Single(p => p.MEETINGID == item.MEETID);
                list.Add(x);
            }


            Meetlist.DataSource = list;

            Meetlist.DataBind();
        }
        protected void btn_Click(object sender, EventArgs e)
        {
            try
            {
                var agenda      = txtTinyMCE.Text;
                var title       = TextBox3.Text;
                var chairperson = ChairpersonList.SelectedValue;
                var date        = Convert.ToDateTime(TextBox.Text);
                var time        = TextBox1.Text;

                var NewMeeting = new MEETINGTABLE();
                NewMeeting.CHAIRPERSON = Convert.ToDecimal(chairperson);
                NewMeeting.TIME        = time;
                NewMeeting.TITLE       = title;
                NewMeeting.MEETINGDATE = date;
                //NewMeeting.CHAIRPERSON = chairperson;

                var context = new MOMEntities();
                context.MEETINGTABLE.Add(NewMeeting);
                context.SaveChanges();
                var ID         = NewMeeting.MEETINGID;
                var Meetagenda = new AGENDATABLE();
                Meetagenda.MEETINGID = ID;
                Meetagenda.AGENDA    = agenda;
                context.AGENDATABLE.Add(Meetagenda);
                context.SaveChanges();
                foreach (ListItem listItem in InviteeList.Items)
                {
                    if (listItem.Selected)
                    {
                        var           val    = listItem.Value;
                        var           txt    = listItem.Text;
                        INVITEESTABLE invite = new INVITEESTABLE();
                        invite.MEETINGID = ID;
                        invite.INVITEEID = Convert.ToDecimal(val);
                        context.INVITEESTABLE.Add(invite);
                        context.SaveChanges();
                    }
                }
                foreach (ListItem LISTITEM in ListBox1.Items)
                {
                    if (LISTITEM.Selected)
                    {
                        var     val = LISTITEM.Value;
                        MEETDEP obj = new MEETDEP();
                        obj.MEETID = ID;
                        obj.DEPID  = Convert.ToInt32(val);
                        context.MEETDEP.Add(obj);
                        context.SaveChanges();
                    }
                }
                Response.Redirect("/Home.aspx");

                // var list = InviteeList.SelectedValue;
                // var ID= context.MEETINGTABLE.
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }