protected void Page_Load(object sender, EventArgs e) { int id = Convert.ToInt32(Request["id"]); ContactManager CM = new ContactManager(); EditContact = CM.GetByID(id); }
protected void Page_Load(object sender, EventArgs e) { int id = Convert.ToInt32(Request["id"]); string name = Request["name"]; string phone = Request["phone"]; string email = Request["email"]; string ip = Request["ip"]; string bodycontent = Request["bodycontent"]; ContactManager CM = new ContactManager(); editcontact1 = CM.GetByID(id); if (editcontact1.Id == 0) { Response.Write("Contact doesn't exist. Please try again."); return; } { editcontact1.Name = name; editcontact1.Email = email; editcontact1.Phone = phone; editcontact1.Ip = ip; editcontact1.BodyContent = bodycontent; CM.Save(); Response.Write(1); } }
protected override void ActionAdminPage() { int id = Convert.ToInt32(Page.RouteData.Values["id"]); ContactManager CM = new ContactManager(); contact = CM.GetByID(id); }
protected void Page_Load(object sender, EventArgs e) { var id = Convert.ToInt32(Request["id"]); ContactManager CM = new ContactManager(); ContactTBx deletecontact = CM.GetByID(id); deletecontact.Status = -1; CM.Save(); Response.Write(1); }
protected override void ActionAdminDo() { string content = Request.Unvalidated["content"]; ContactManager CM = new ContactManager(); ContactTBx contact = new ContactTBx(); contact.Content = content; contact.Status = 1; CM.Add(contact); Response.Write(1); }
protected override void ActionAdminDo() { int ID = Convert.ToInt32(Request["ID"]); ContactManager CM = new ContactManager(); ContactTBx contact = CM.GetByID(ID); if (contact.ID == 0) { Response.Write("contact not exist!"); return; } contact.Status = -1; CM.Save(); Response.Write(1); }
protected override void ActionAdminDo() { int ID = Convert.ToInt32(Request["id"]); string content = Request.Unvalidated["content"]; ContactManager CM = new ContactManager(); ContactTBx contact = CM.GetByID(ID); if (contact.ID == 0) { Response.Write("contact not exist!"); return; } contact.Content = content; CM.Save(); Response.Write(1); }
protected void Page_Load(object sender, EventArgs e) { string name = Request["name"]; string email = Request["email"]; string phone = Request["phone"]; string content = Request["content"]; ContactManager cm = new ContactManager(); ContactTBx contact = new ContactTBx(); contact.Name = name; contact.Email = email; contact.Phone = phone; contact.CreateDay = DateTime.Now; contact.BodyContent = content; contact.Status = 1; cm.AddNew(contact); cm.Save(); Response.Write(1); }
protected void Page_Load(object sender, EventArgs e) { string name = Request["name"]; string phone = Request["phone"]; string email = Request["email"]; string content = Request["content"]; string ip = Request["ip"]; ContactManager CM = new ContactManager(); ContactTBx addnewcontact = new ContactTBx(); addnewcontact.Name = name; addnewcontact.Email = email; addnewcontact.Phone = phone; addnewcontact.Ip = ip; addnewcontact.BodyContent = content; addnewcontact.CreateDay = DateTime.Now; addnewcontact.Status = 1; CM.AddNew(addnewcontact); Response.Write(1); }
partial void DeleteContactTBx(ContactTBx instance);
partial void UpdateContactTBx(ContactTBx instance);
partial void InsertContactTBx(ContactTBx instance);
public void AddNew(ContactTBx prd) { db.ContactTBxes.InsertOnSubmit(prd); Save(); }
public void Add(ContactTBx contact) { db.ContactTBxes.InsertOnSubmit(contact); Save(); }