Exemplo n.º 1
0
        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>";

                }
            }
        }
Exemplo n.º 2
0
 //-----------------------------------------------------------------------------------------------
 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();
     }
 }
Exemplo n.º 3
0
 partial void DeleteHelp(Help instance);
Exemplo n.º 4
0
 partial void UpdateHelp(Help instance);
Exemplo n.º 5
0
 partial void InsertHelp(Help instance);