protected void GridViewResult_RowCommand(object sender, GridViewCommandEventArgs e) { try { switch (e.CommandName.ToLower()) { case "removeinsightsuppliercontactlink": { string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' }); int insightSupplierContactLinkId = Convert.ToInt32(commandArgs[0]); int insightSupplierContactLicenseId = Convert.ToInt32(commandArgs[1]); int insightSupplierContactIdSelectedUser = InsightSupplierContact.GetInsightSupplierContactByInsightSupplierContactLinkId(insightSupplierContactLinkId).InsightSupplierContactId; InsightSupplierContactDistributionLink.DeleteInsightSupplierContactDistributionLinkByInsightSupplierContactId(this.insightSupplierId, insightSupplierContactIdSelectedUser); InsightSupplierContactDistributionOption.DeleteInsightSupplierContactDistributionOptionByInsightSupplierContactId(this.insightSupplierId, insightSupplierContactIdSelectedUser); InsightSupplierContactDistributionModel.DeleteInsightSupplierContactDistributionModelByInsightSupplierContactId(this.insightSupplierId, insightSupplierContactIdSelectedUser); InsightSupplierContactLicense.DeleteInsightSupplierContactLicenseByInsightSupplierContactIdInsightSupplierId(this.insightSupplierId, insightSupplierContactIdSelectedUser); InsightSupplierContactLink.DeleteInsightSupplierContactLinkByInsightSupplierContactLinkId(insightSupplierContactLinkId); //InsightSupplierContactLink.DeleteInsightSupplierContactLinkByInsightSupplierContactLinkId(Convert.ToInt32(e.CommandArgument)); BindInsightSupplierContactGridView(); TextBoxFirstName.Text = ""; TextBoxLastName.Text = ""; TextBoxPosition.Text = ""; TextBoxLandline.Text = ""; TextBoxMobile.Text = ""; TextBoxEmail.Text = ""; TextBoxAddress.Text = ""; TextBoxUsername.Text = ""; TextBoxPassword.Text = ""; BindRegion(); BindGift(); BindModel(); BindOption(); BindLink(); BindAccessMethod(); BindLicense(); BindQlikviewVersion(); PanelInstall.Visible = false; PanelOnline.Visible = false; break; } } } catch (System.Data.SqlClient.SqlException sqlEx) { LabelError.Text = ""; for (int i = 0; i < sqlEx.Errors.Count; i++) { LabelError.Text += (sqlEx.Errors[i].Message + "<br />"); } PanelError.Visible = true; } }
private void SaveInsightSupplierContactDistributionLink(int insightSupplierContactId) { InsightSupplierContactDistributionLink.DeleteInsightSupplierContactDistributionLinkByInsightSupplierContactId(this.insightSupplierId, insightSupplierContactId); foreach (ListItem listItem in CheckBoxListLink.Items) { if (listItem.Selected) { InsightSupplierContactDistributionLink iscdl = new InsightSupplierContactDistributionLink(); iscdl.InsightSupplierId = this.insightSupplierId; iscdl.InsightSupplierContactId = insightSupplierContactId; iscdl.LinkId = Convert.ToInt32(listItem.Value); iscdl.ModifiedUser = Context.User.Identity.GetUserName(); iscdl.Save(); } } }
protected void GridViewUser_RowCommand(object sender, GridViewCommandEventArgs e) { try { switch (e.CommandName.ToLower()) { case "removeinsightsuppliercontactlink": { string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' }); int insightSupplierContactLinkId = Convert.ToInt32(commandArgs[0]); int insightSupplierContactLicenseId = Convert.ToInt32(commandArgs[1]); int insightSupplierContactId = InsightSupplierContact.GetInsightSupplierContactByInsightSupplierContactLinkId(insightSupplierContactLinkId).InsightSupplierContactId; InsightSupplierContactDistributionLink.DeleteInsightSupplierContactDistributionLinkByInsightSupplierContactId(this.insightSupplierId, insightSupplierContactId); InsightSupplierContactDistributionOption.DeleteInsightSupplierContactDistributionOptionByInsightSupplierContactId(this.insightSupplierId, insightSupplierContactId); InsightSupplierContactDistributionModel.DeleteInsightSupplierContactDistributionModelByInsightSupplierContactId(this.insightSupplierId, insightSupplierContactId); //InsightSupplierContactLicense.DeleteInsightSupplierContactLicenseByInsightSupplierContactLicenseId(insightSupplierContactLicenseId); InsightSupplierContactLicense.DeleteInsightSupplierContactLicenseByInsightSupplierContactIdInsightSupplierId(this.insightSupplierId, insightSupplierContactId); InsightSupplierContactLink.DeleteInsightSupplierContactLinkByInsightSupplierContactLinkId(insightSupplierContactLinkId); //InsightSupplierContactLink.DeleteInsightSupplierContactLinkByInsightSupplierContactLinkId(Convert.ToInt32(e.CommandArgument)); BindInsightSupplierContactList(); BindInsightSupplierContactGridView(); break; } } } catch (System.Data.SqlClient.SqlException sqlEx) { LabelError.Text = ""; for (int i = 0; i < sqlEx.Errors.Count; i++) { LabelError.Text += (sqlEx.Errors[i].Message + "<br />"); } PanelError.Visible = true; } }