private int maxID() { var l = ContactBLL.GetAll(); int max = 0; for (int i = 0; i < l.Count; i++) { if (l[i].contactId > max) { max = l[i].contactId; } } return(max + 1); }
protected void grdContactsRowEdit(object sender, GridViewEditEventArgs e) { msg.Text = ""; pnlGrdViewDetail.Enabled = true; pnlGrdViewDetail.Visible = true; imgbtnNew.Visible = false; imgbtnSave.Visible = true; grdContacts.EditIndex = e.NewEditIndex; grdContacts.SelectedIndex = e.NewEditIndex; gridFill(); var contacts = ContactBLL.GetAll(); ViewDetails(grdContacts.DataKeys[e.NewEditIndex].Value); }
private string getAll() { var l = ContactBLL.GetAll(); //Console.WriteLine(l); StringBuilder str = new StringBuilder(""); Contact contact; for (int i = 0; i < l.Count; i++) { contact = l[i]; Console.WriteLine(contact.address); str.Append("<li>"); str.Append(contact.contactId.ToString() + ". "); str.Append(contact.ownerId + " " + contact.name + " " + contact.address + " " + contact.city + " " + contact.state + " " + contact.zip + " " + contact.email + " " + contact.status); str.Append("</li>"); } return(str.ToString()); }
protected void gridFill() { grdContacts.DataSource = ContactBLL.GetAll(); grdContacts.DataKeyNames = keys; grdContacts.DataBind(); }