protected void JqgridMatch1_RowDeleting(object sender, JQGridRowDeleteEventArgs e) { using (var dc = ThaitaeDataDataContext.Create()) { var faMatch = dc.FAMatches.Single(item => item.FAMatchId == Convert.ToInt32(e.RowKey)); dc.FAMatches.DeleteOnSubmit(faMatch); dc.SubmitChanges(); } }
protected void JqgridMatch1_RowDeleting(object sender, JQGridRowDeleteEventArgs e) { using (var dc = ThaitaeDataDataContext.Create()) { var matchHome = dc.Matches.Single(item => item.MatchId == Convert.ToInt32(e.RowKey)); var matchAway = dc.Matches.Single( item => item.TeamHomeId == matchHome.TeamAwayId && item.TeamAwayId == matchHome.TeamHomeId && item.SeasonId == Convert.ToInt32(Session["seasonid"])); var faMatch = dc.TeamMatches.Where(item => item.MatchId == Convert.ToInt32(e.RowKey)).ToList(); dc.TeamMatches.DeleteAllOnSubmit(faMatch); dc.SubmitChanges(); dc.Matches.DeleteOnSubmit(matchHome); dc.Matches.DeleteOnSubmit(matchAway); dc.SubmitChanges(); } }
protected void JqgridUser_RowDeleting(object sender, JQGridRowDeleteEventArgs e) { var userId = e.RowKey; if (string.IsNullOrEmpty(userId)) return; UserHelper.DeleteUserProfile(Convert.ToInt32(userId)); }
private void PerformRowDelete() { NameValueCollection nameValueCollection = new NameValueCollection(); foreach (string name in HttpContext.Current.Request.Form.Keys) { nameValueCollection[name] = HttpContext.Current.Request.Form[name]; } JQGridRowDeleteEventArgs jQGridRowDeleteEventArgs = new JQGridRowDeleteEventArgs(); jQGridRowDeleteEventArgs.RowKey = nameValueCollection["id"]; this.OnRowDeleting(jQGridRowDeleteEventArgs); if (!jQGridRowDeleteEventArgs.Cancel) { this.HandleDelete(jQGridRowDeleteEventArgs); } this.OnRowDeleted(new EventArgs()); }
private void HandleDelete(JQGridRowDeleteEventArgs e) { if (base.IsBoundUsingDataSourceID) { OrderedDictionary orderedDictionary = new OrderedDictionary(); OrderedDictionary oldValues = new OrderedDictionary(); new OrderedDictionary(); DataSourceView data = this.GetData(); if (data == null) { throw new HttpException("DataSource is null in edit mode (on update)"); } foreach (JQGridColumn jQGridColumn in this.Columns) { if (jQGridColumn.PrimaryKey) { orderedDictionary.Add(jQGridColumn.DataField, e.RowKey); } } data.Delete(orderedDictionary, oldValues, new DataSourceViewOperationCallback(this.HandleDeleteCallback)); } }
protected internal virtual void OnRowDeleting(JQGridRowDeleteEventArgs e) { JQGrid.JQGridRowDeleteEventHandler jQGridRowDeleteEventHandler = (JQGrid.JQGridRowDeleteEventHandler)base.Events[JQGrid.EventRowDeleting]; if (jQGridRowDeleteEventHandler != null) { jQGridRowDeleteEventHandler(this, e); } }