Exemplo n.º 1
0
    private void GetAgencyName()
    {
        try
        {
            sqlObj = new SqlString(ComObj);
            string  qry = "select * from PurchaseAgencyMaster  where PurchaseAgencyId in('232','234')   order by PurchaseAgencyName";
            DataSet ds  = sqlObj.selectAny(qry);

            if (ds == null)
            {
            }
            else
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DDL_Agency.DataSource     = ds.Tables[0];
                    DDL_Agency.DataTextField  = "PurchaseAgencyName";
                    DDL_Agency.DataValueField = "PCType_ID";
                    DDL_Agency.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
            Page.RegisterClientScriptBlock("mymsg2", "<script language=javascript> alert('" + ex.Message + "'); </script> ");
        }
    }
Exemplo n.º 2
0
    private void GetAgencyName()
    {
        try
        {
            string agid = Session["StateLog_AgId"].ToString();
            SqlObj = new SqlString(ComObj);
            string  qry = "select * from PurchaseAgencyMaster   where PCType_ID='" + agid + "'";
            DataSet ds  = SqlObj.selectAny(qry);

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DDL_Agency.DataSource     = ds.Tables[0];
                    DDL_Agency.DataTextField  = "PurchaseAgencyName";
                    DDL_Agency.DataValueField = "PCType_ID";
                    DDL_Agency.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
            Page.RegisterClientScriptBlock("mymsg2", "<script language=javascript> alert('" + ex.Message + "'); </script> ");
        }
    }
    private void GetAgencyName()
    {
        SqlObj = new SqlString(ComObj);
        string  qry = "select * from PurchaseAgencyMaster  order by PurchaseAgencyName";
        DataSet ds  = SqlObj.selectAny(qry);

        if (ds != null)
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                DDL_Agency.DataSource     = ds.Tables[0];
                DDL_Agency.DataTextField  = "PurchaseAgencyName";
                DDL_Agency.DataValueField = "PurchaseAgencyId";
                DDL_Agency.DataBind();
            }
        }
    }