protected void Page_Load(object sender, EventArgs e) { d = new database(); if (d.CurrentUser != null) { acnt = d.GetAccountByAccountID(d.CurrentUser.AccountID); } else { Response.Redirect("http://localhost:11834/Default.aspx"); } if (acnt != null) { long uid = Convert.ToInt64(Request.QueryString["uid"]); if (uid != null) { Child child = d.GetChildByID(uid); if (child != null) { TBAddress.Text = child.ChildAddress; TBAge.Text = child.ChildAge.ToString(); TBCareNumber.Text = child.CareNumber.ToString(); TBCity.Text = child.ChildCity; TBCountry.Text = child.ChildCountry; TBName.Text = child.ChildName; TBStory.Text = child.ChildStory; } else { TBCareNumber.Text = acnt.MobileNo.ToString(); } } } }
//--------------------------------------------------------------------------------------------- public void SaveAccount(Account account) { using (DonationDataContext dc = GetContext()) { if (account.AccountID > 0) { dc.Accounts.Attach(account, true); } else { account.CreateDate = DateTime.Now; dc.Accounts.InsertOnSubmit(account); } dc.SubmitChanges(); } }
partial void UpdateAccount(Account instance);
partial void DeleteAccount(Account instance);
partial void InsertAccount(Account instance);