protected void grid_VisitorContacts_Delete(object sender, Telerik.Web.UI.GridCommandEventArgs e)
 {
     int id = Convert.ToInt32((e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["VisitorContactID"]);
     BallyliffinDataContext db = new BallyliffinDataContext();
     db.sp_visitorContacts_Delete(id);
     grid_VisitorContacts.Rebind();
 }
Esempio n. 2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     BallyliffinDataContext dbbally = new BallyliffinDataContext();
     if (Page.IsValid)
     {
         dbbally.sp_Roles_Insert(txt_RoleDesc.Text);
         Response.Redirect(btnBack.PostBackUrl);
     }
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         BallyliffinDataContext db = new BallyliffinDataContext();
         //if (db.sp_Email_NewsletterLastSent().Count() > 1)
         //lbl_lastSent.Text = "The last Newsletter was sent on " + db.sp_Email_NewsletterLastSent().SingleOrDefault().SentDate.ToShortDateString();
     }
 }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     BallyliffinDataContext dbbally = new BallyliffinDataContext();
     if (Page.IsValid)
     {
         dbbally.sp_Members_Insert(txt_FirstName.Text, txt_LastName.Text, txt_Email.Text, txt_Phone.Text, Convert.ToInt32(ddl_Team.SelectedValue), Convert.ToInt32(ddl_Roles.SelectedValue), date_DOB.SelectedDate, date_Joined.SelectedDate);
         Response.Redirect(btnBack.PostBackUrl);
     }
 }
 private void LoadData()
 {
     if (!string.IsNullOrEmpty(Request["key"]))
     {
         BallyliffinDataContext db = new BallyliffinDataContext();
         sp_Divisions_SignleRecordResult record = db.sp_Divisions_SignleRecord(new Guid(Request["key"])).SingleOrDefault();
         txt_DivisionDesc.Text = record.DivisionDesc;
         chk_IsDeleted.Checked = record.IsDeleted;
         h_timestamp.Value = ToolsBLL.TimestampToString(record.timestamp).ToString();
     }
 }
 private void LoadData()
 {
     if (!string.IsNullOrEmpty(Request["key"]))
     {
         BallyliffinDataContext dbbally = new BallyliffinDataContext();
         sp_News_SignleRecordResult record = dbbally.sp_News_SignleRecord(new Guid(Request["key"])).SingleOrDefault();
         lbl_Headline.Text = record.NewsHeadLine;
         lbl_Story.InnerText = record.NewsContent;
         lbl_NewsDate.Text = record.NewsDate.ToShortDateString();
     }
 }
Esempio n. 7
0
 private void LoadData()
 {
     if (!string.IsNullOrEmpty(Request["key"]))
     {
         BallyliffinDataContext dbbally = new BallyliffinDataContext();
         sp_Roles_SignleRecordResult record = dbbally.sp_Roles_SignleRecord(new Guid(Request["key"])).SingleOrDefault(); // sp_Venues_SignleRecord(new Guid(Request["key"])).SingleOrDefault();
         txt_RoleDesc.Text = record.RoleDesc;
         chk_IsDeleted.Checked = record.IsDeleted;
         h_timestamp.Value = record.timestamp.TimestampToString();
     }
 }
Esempio n. 8
0
 private void LoadData()
 {
     if (!string.IsNullOrEmpty(Request["key"]))
     {
         BallyliffinDataContext dbbally = new BallyliffinDataContext();
         sp_Teams_SignleRecordResult record = dbbally.sp_Teams_SignleRecord(new Guid(Request["key"])).SingleOrDefault(); // sp_Venues_SignleRecord(new Guid(Request["key"])).SingleOrDefault();
         txt_TeamDesc.Text = record.TeamDesc;
         ddl_Division.SelectedValue = record.DivisionID.ToString();
         chk_IsOurs.Checked = record.IsOurs;
         chk_IsDeleted.Checked = record.IsDeleted;
         h_timestamp.Value = ToolsBLL.TimestampToString(record.timestamp).ToString();
     }
 }
Esempio n. 9
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            delSend ds = Commagent.SendEmailFromCommAgent;
            ds += Commagent.LogOutgoingEmail;

            BallyliffinDataContext db = new BallyliffinDataContext();
            List<sp_email_getAddressesResult> emailAddresses = db.sp_email_getAddresses().ToList();
            foreach (var email in emailAddresses)
            {
                ds("Ballyliffin GAA NeswLetter " + DateTime.Now.ToShortDateString(), txt_Body.Content, email.EmailAddress, "*****@*****.**");
            }
            Response.Redirect("Emails_List.aspx?returnurl=Default.aspx");
        }
 private void LoadData()
 {
     if (!string.IsNullOrEmpty(Request["key"]))
     {
         BallyliffinDataContext db = new BallyliffinDataContext();
         sp_visitorContacts_SignleRecordResult record = db.sp_visitorContacts_SignleRecord(new Guid(Request["key"])).SingleOrDefault();
         lbl_ContactDate.Text = record.ContactDate.ToString();
         lbl_ContactName.Text = record.ContactName;
         lbl_Email.Text = record.EmailAddress;
         lbl_Subject.Text = record.VisitorContactDesc;
         lbl_Message.InnerHtml = record.ContactMessage.Replace("\r\n", "<br/>");
         tr_DeleteF.Visible = record.IsDeleted;
         tr_DeleteH.Visible = record.IsDeleted;
     }
 }
Esempio n. 11
0
        protected void btn_Add_Click(object sender, EventArgs e)
        {
            delSend ds = Commagent.SendEmailFromCommAgent;
            ds += Commagent.LogOutgoingEmail;

            BallyliffinDataContext db = new BallyliffinDataContext();
            GridItemCollection emails = grid_Emails.SelectedItems;
            foreach (GridItem item in emails)
            {
                sp_Emails_ViewAllResult email = db.sp_Emails_ViewAll().SingleOrDefault(m => m.EmailID == Convert.ToInt32(item.OwnerTableView.DataKeyValues[item.ItemIndex]["EmailID"]));
                ds(email.EmailSubject, email.EmailMessage, email.EmailTo, "*****@*****.**");
            }

            grid_Emails.Rebind();
        }
Esempio n. 12
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            BallyliffinDataContext dbbally = new BallyliffinDataContext();
            if (Page.IsValid)
            {
                try
                {
                    dbbally.sp_Venues_Insert(txt_VenueDesc.Text);
                    Response.Redirect(btnBack.PostBackUrl);
                }
                catch (Exception ex)
                {

                }
            }
        }
        private static void SendFReminders()
        {
            delSend ds = Commagent.SendEmailFromCommAgent;
            ds += Commagent.LogOutgoingEmail;

            BallyliffinDataContext db = new BallyliffinDataContext();
            List<sp_Email_MatchRemindersResult> reminders = db.sp_Email_MatchReminders().ToList();

            string body;

            foreach (sp_Email_MatchRemindersResult r in reminders)
            {
                body = string.Format("Dear {5} {6} \r\n\r\n You have a match on {0:d} at {1:t} \r\n {2} v {3} \r\n at {4}"
                                        , r.MatchDate, r.MatchDate, r.TeamA, r.TeamB, r.VenueDesc, r.FirstName, r.LastName);
                ds("Match Reminder", body, r.EmailAddress, "*****@*****.**");
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                BallyliffinDataContext db = new BallyliffinDataContext();

                bool? result = false;
                db.sp_Divisions_Update(new Guid(Request["key"]), txt_DivisionDesc.Text, chk_IsDeleted.Checked, ToolsBLL.StringToTimestamp(h_timestamp.Value), ref  result);

                if (result.Value)
                {
                    Response.Redirect(btnBack.PostBackUrl);
                }
                else
                {
                    lbl_Msg.Visible = true;
                    lbl_Msg.Text = "The record has been modified by another user. <a class='reloadRecordLink' href='" + Request.Url.Query + "'>Reload this Record</a>";
                }
            }
        }
Esempio n. 15
0
        protected void ddl_Roles_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
        {
            BallyliffinDataContext db = new BallyliffinDataContext();

            List<sp_MembersByRole_ShortViewResult> roles = db.sp_MembersByRole_ShortView().ToList();

            foreach (sp_MembersByRole_ShortViewResult role in roles)
            {
                RadComboBoxItem item = new RadComboBoxItem();

                item.Text = (string)role.RoleDesc;
                item.Value = role.RoleID.ToString();

                item.Attributes.Add("RoleDesc", role.RoleDesc);
                item.Attributes.Add("Total", role.Total.Value.ToString());

                ddl_Roles.Items.Add(item);

                item.DataBind();
            }
        }
Esempio n. 16
0
        private void GenerateNewsLetter()
        {
            BallyliffinDataContext db = new BallyliffinDataContext();
            List<sp_NewsLetter_ContentsResult> stories = db.sp_NewsLetter_Contents().ToList();

            foreach (var i in stories)
            {
                string newsletter = string.Format("{0}{1}{2}{3:d}{4}{5}{6}{7}",
                                                    "<div style='padding:30px;font-family:Arial;'><p style='color: #1b5d04;font-size:16px;font-weight:bold;'>", //0
                                                    i.NewsHeadLine, //1
                                                    "</p><hr/>", //2
                                                    i.NewsDate, //3
                                                    "<br/><br/>",//4
                                                    "<div>",//5
                                                    i.NewsContent,//6
                                                    "</div></div>" //7

                                                    );
                txt_Body.Content += newsletter;
            }
        }
 private void ShowMessage()
 {
     BallyliffinDataContext db = new BallyliffinDataContext();
     divInfo.InnerText = db.sp_Email_MatchReminders().Count().ToString() + " Email Reminders have been sent to members!";
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     BallyliffinDataContext db = new BallyliffinDataContext();
     if (db.sp_Email_ReminderLastSent().Count() > 1)
     lbl_lastSent.Text = "The last set of reminders was sent on " + db.sp_Email_ReminderLastSent().SingleOrDefault().SentDate.ToShortDateString();
 }