Example #1
0
    private void LoadGrid()
    {
        try
        {
            pageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
            gvStewardship.PageSize   = pageSize;
            gvStewardship.DataSource = LookupsManagement.GetLookupsData(11, 0).Tables[0];
            gvStewardship.DataBind();

            GridPaging();

            //Utils.GetLookUpData<DropDownList>(ref ddlOrganizationType, LookUps.OrganizationType);
            //Utils.GetLookUpData<DropDownList>(ref ddlOrganizationTypeForUser, LookUps.OrganizationType);

            //if (ddlOrganizationType.Items.FindByValue("20") != null)
            //{
            //    ddlOrganizationType.Items.Remove(ddlOrganizationType.Items.FindByValue("20"));
            //}

            //if (ddlOrganizationTypeForUser.Items.FindByValue("20") != null)
            //{
            //    ddlOrganizationTypeForUser.Items.Remove(ddlOrganizationTypeForUser.Items.FindByValue("20"));
            //}
        }
        catch (Exception ex)
        {
            new SqlLog().InsertSqlLog(0, "adminStewardship.LoadGrid", ex);
        }
    }
Example #2
0
    public void loadListBox(string table_name, string pk_col, string desc_col)
    {
        lstvalue.DataValueField = "ID";
        lstvalue.DataTextField  = "Name";
        lstvalue.Items.Clear();

        DataSet ds = null;

        ds = LookupsManagement.GetLookupsData(Convert.ToInt32(ddllookupstable.SelectedValue), -1);

        lstvalue.DataSource = ds.Tables[0];
        lstvalue.DataBind();
        ddl_SectionType.Visible = false;
        lbl_SectionType.Visible = false;
    }
Example #3
0
    protected void ImageButton2_Click(object sender, EventArgs e)
    {
        int lookupsubtypeid = Int32.Parse(lstvalue.SelectedValue);
        int lookupsubtypeid2 = (lstvalue.SelectedIndex) + 2;
        int i = 0, uppervalue = 0;

        foreach (ListItem item in lstvalue.Items)
        {
            i++;
            if (i == lookupsubtypeid2)
            {
                uppervalue = Convert.ToInt32(item.Value);
                break;
            }
        }


        LookupsManagement.GetLookupSwapedData(lookupsubtypeid, uppervalue);

        lstvalue.DataValueField = "ID";
        lstvalue.DataTextField  = "Name";
        lstvalue.Items.Clear();

        DataSet ds = null;

        ds = LookupsManagement.GetLookupsData(Convert.ToInt32(ddllookupstable.SelectedValue), -1);

        lstvalue.DataSource = ds.Tables[0];
        lstvalue.DataBind();

        try
        {
            this.lstvalue.SelectedIndex = -1;
            this.txtdescription.Text    = "";
            txtLegalName.Text           = "";

            divadd.Style.Add("display", "inline");
            divupdate.Style.Add("display", "none");
            // divdelete.Style.Add("display", "none");
            divCancel.Style.Add("display", "none");
            //ImageButton1.Visible = false;
            //ImageButton2.Visible = false;
        }
        catch (Exception ex)
        {
            new SqlLog().InsertSqlLog(0, "", ex);
        }
    }