protected void btnDelete_Click(object sender, EventArgs e) { if (Session["CustomerPKID"].ToString() != "" && long.TryParse(Session["CustomerPKID"].ToString(), out _PKID)) { _PKID = long.Parse(Session["CustomerPKID"].ToString()); _customer = new CustomerClass(_PKID); _customer.deleteRecord(_PKID); Session["CustomerPKID"] = ""; } fillGridView(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["CustomerPKID"].ToString() != "" && long.TryParse(Session["CustomerPKID"].ToString(), out _PKID)) { _PKID = long.Parse(Session["CustomerPKID"].ToString()); _customer = new CustomerClass(_PKID); if (!Page.IsPostBack) { displayRecord(); } } else { _customer = new CustomerClass(); } populateEmployeeComboBox(); }