protected void BSubmit_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(TBName.Text) && !String.IsNullOrEmpty(TBEmail.Text) && !String.IsNullOrEmpty(TBHelp.Text) && !String.IsNullOrEmpty(TBMobileNo.Text) ) { Help help = new Help(); help.HelperName = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(TBName.Text); help.HelperEmail = TBEmail.Text; help.HelperMobileNo = Convert.ToInt64(TBMobileNo.Text); help.HelperHelp = TBHelp.Text; help.CreateDate = DateTime.Now; help.HelpChildID = uid; d.SaveHelp(help); TBEmail.Text = ""; TBName.Text = ""; TBEmail.Text = ""; TBMobileNo.Text = ""; TBHelp.Text = ""; RepHelp.DataSource = d.GetAllhelpByChildID(uid); RepHelp.DataBind(); if (RepHelp.Items.Count > 0) { LKind.Text = "<h1>Kind of Help (" + RepHelp.Items.Count + ")</h1>"; } } }
//----------------------------------------------------------------------------------------------- public void SaveHelp(Help help) { using (DonationDataContext dc = GetContext()) { if (help.HelpID > 0) { dc.Helps.Attach(help, true); } else { help.CreateDate = DateTime.Now; dc.Helps.InsertOnSubmit(help); } dc.SubmitChanges(); } }
partial void DeleteHelp(Help instance);
partial void UpdateHelp(Help instance);
partial void InsertHelp(Help instance);