コード例 #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>";

                }
            }
        }
コード例 #2
0
ファイル: database.cs プロジェクト: naveenyadav/sharedream
 //-----------------------------------------------------------------------------------------------
 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();
     }
 }
コード例 #3
0
 partial void DeleteHelp(Help instance);
コード例 #4
0
 partial void UpdateHelp(Help instance);
コード例 #5
0
 partial void InsertHelp(Help instance);