public void Invoke(object Sender, object Element) { if (Element is CommandParameters) { CommandParameters cp = (CommandParameters)Element; string[] elemsToDelete = MCGrid.GetCheckedCollection(((CommandManager)Sender).Page, cp.CommandArguments["GridId"]); if (elemsToDelete.Length > 1) { using (DbTransaction tran = DbTransaction.Begin()) { for (int i = 0; i < elemsToDelete.Length - 1; i++) { for (int j = i + 1; j < elemsToDelete.Length; j++) { int id1 = Convert.ToInt32(elemsToDelete[i].Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[0], CultureInfo.InvariantCulture); int id2 = Convert.ToInt32(elemsToDelete[j].Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[0], CultureInfo.InvariantCulture); if (id1 > 0 && id2 > 0) { Issue2.AddRelation(id1, id2); } } } tran.Commit(); } CHelper.RequireBindGrid(); } } }
public void Invoke(object Sender, object Element) { if (Element is CommandParameters) { CommandParameters cp = (CommandParameters)Element; int issueId = int.Parse(cp.CommandArguments["ObjectId"]); if (cp.CommandArguments.ContainsKey("SelectedValue")) { string[] elemsToAdd = cp.CommandArguments["SelectedValue"].Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); using (DbTransaction tran = DbTransaction.Begin()) { foreach (string elem in elemsToAdd) { int selectedValue = 0; if (int.TryParse(elem, out selectedValue)) { Issue2.AddRelation(issueId, selectedValue); } } tran.Commit(); } } CHelper.RequireBindGrid(); } }
private void lbAddIssue_Click(object sender, EventArgs e) { int RelIssueId = int.Parse(hdnIssueId.Value); if (IncidentId > 0 && IncidentId != RelIssueId) { Issue2.AddRelation(IncidentId, RelIssueId); } CommandParameters cp = new CommandParameters("MC_HDM_Redirect"); Mediachase.Ibn.Web.UI.WebControls.CommandHandler.RegisterCloseOpenedFrameScript(this.Page, cp.ToString()); }
void btnAddRelatedIss_Click(object sender, EventArgs e) { string param = Request["__EVENTARGUMENT"]; if (!String.IsNullOrEmpty(param)) { string[] mas = param.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); if (mas.Length < 2 || !mas[0].Equals("7")) { return; } int iRelId = int.Parse(mas[1]); Issue2.AddRelation(IncidentId, iRelId); BindDG(); } }
protected void btnAddRelatedIss_Click(object sender, EventArgs e) { string param = Request["__EVENTARGUMENT"]; if (!String.IsNullOrEmpty(param)) { string[] mas = param.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); if (mas.Length < 2 || !mas[0].Equals("7")) { return; } int iRelId = int.Parse(mas[1]); Issue2.AddRelation(IncidentId, iRelId); Response.Redirect("~/Incidents/IncidentView.aspx?IncidentId=" + IncidentId + "&Tab=General", true); } }