private void LoadStakeholders() { try { pageSize = Convert.ToInt32(ddlPageSize.SelectedValue); gvApplicationApproved.PageSize = pageSize; int OrganizationId = Convert.ToInt32(Request.QueryString["OrganizationId"]); int OrganizationTypeId = Convert.ToInt32(Request.QueryString["OrganizationTypeId"]); string StakeholderName = txtStakeholderName.Text.Trim(); string DBAName = txtDBAName.Text.Trim(); string ContactName = txtPrimaryCotnact.Text.Trim(); string ZIPCode = txtZipCode.Text.Trim(); DateTime CreatedFromDate = txtCreatedFromDate.Text.Trim() == "" ? DateTime.MinValue : Convert.ToDateTime(txtCreatedFromDate.Text, System.Globalization.CultureInfo.InvariantCulture); DateTime CreatedToDate = txtCreatedToDate.Text.Trim() == "" ? DateTime.MinValue : Convert.ToDateTime(txtCreatedToDate.Text, System.Globalization.CultureInfo.InvariantCulture); DataSet ds; ds = OrganizationInfo.SearchStakeholdersByStewardShip(CurPageNum, pageSize, out totalRows, OrganizationId, OrganizationTypeId, true, StakeholderName, DBAName, ContactName, ZIPCode, CreatedFromDate, CreatedToDate, LanguageId); gvApplicationApproved.DataSource = ds; gvApplicationApproved.DataBind(); GridPaging(); } catch (Exception ex) { new SqlLog().InsertSqlLog(0, "Stakeholder/ViewStakeholder", ex); } }
protected void lnkbtnDelete_Click(object sender, EventArgs e) { DataSet ds; OrganizationInfo oi = new OrganizationInfo(OrganizationID); string standardstewardshipIds = System.Configuration.ConfigurationManager.AppSettings["StewardshipStandardIDs"]; string[] standanrdIds = standardstewardshipIds.Split(','); foreach (string st in standanrdIds) { ds = OrganizationInfo.SearchStakeholdersByStewardShip(1, 100, out totalRows, OrganizationID, Conversion.ParseInt(st), true, "", "", "", "", DateTime.MinValue, DateTime.MinValue, LanguageId); if (ds.Tables[0].Rows.Count > 0) { gvApplicationApproved.DataSource = ds; gvApplicationApproved.DataBind(); dlg.Visible = true; return; } else if (!string.IsNullOrEmpty(txtNotes.Text)) { dlgcnfdel.Visible = true; } else { string script = string.Format("alert('{0}');", "Cannot delete please provide notes for deleting."); if (Page != null && !Page.ClientScript.IsClientScriptBlockRegistered("function")) { Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "function", script, true /* addScriptTags */); } } } }