protected void btnSave_Click(object sender, EventArgs e) { bool flag = true; Link link = new Link(); for (int i = 0; i < this.lstLink.Items.Count; i++) { link.Info.Sequence = i; link.Info.LinkID = Convert.ToInt32(this.lstLink.Items[i].Value); link.Info.CurrentTask = NTaskLink.UpdateOneSequence; if (!link.Modify()) { flag = false; } } if (flag) { base.BuildPopup("Successfully, adjusted the sequence of the links."); } else { base.BuildPopup(MicNets.Model.Utility.NOTICE_INTERNAL_ERROR); } }
protected void dgLink_RowUpdating(object sender, GridViewUpdateEventArgs e) { Link oLink = new Link(); oLink.Info.LinkID = Convert.ToInt32(dgLink.DataKeys[e.RowIndex].Value); oLink.Info.Text = ((TextBox)dgLink.Rows[e.RowIndex].FindControl("txtText")).Text.Trim(); oLink.Info.URL = ((TextBox)dgLink.Rows[e.RowIndex].FindControl("txtURL")).Text.Trim(); if (oLink.Modify()) { base.BuildPopup("Successfully, updated the link information."); } else { base.BuildPopup(MicNets.Model.Utility.NOTICE_INTERNAL_ERROR); } this.dgLink.EditIndex = -1; this.RefreshGrid(); }