private void GetCommodity()
 {
     try
     {
         if (Session["pcId"] != null)
         {
             CdObj = new comodity(ComObj);
             string  strcom = Session["Markseas_id"].ToString();
             string  strsql = "SELECT * FROM CommodityMaster where MarkSeasId='" + strcom + "'";
             DataSet ds     = CdObj.selectAny(strsql);
             if (ds != null)
             {
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     DDL_Commodity.DataSource     = ds.Tables[0];
                     DDL_Commodity.DataTextField  = "CommodityName";
                     DDL_Commodity.DataValueField = "CommodityId";
                     DDL_Commodity.DataBind();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Page.RegisterClientScriptBlock("mymsg2", "<script language=javascript> alert('" + ex.Message + "'); </script> ");
     }
 }
    private void getCommodity(string strcom)
    {
        CdObj = new comodity(ComObj);
        //string strcom = Session["Markseas_id"].ToString();
        string  strsql = "SELECT * FROM CommodityMaster where MarkSeasId='" + strcom + "'";
        DataSet ds     = CdObj.selectAny(strsql);

        if (ds != null)
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                DDL_Commodity.DataSource     = ds.Tables[0];
                DDL_Commodity.DataTextField  = "CommodityName";
                DDL_Commodity.DataValueField = "CommodityId";
                DDL_Commodity.DataBind();
            }
        }
    }
    private void GetCommodity()
    {
        SqlObj = new SqlString(ComObj);
        string  strcom = Session["Markseas_id"].ToString();
        string  strsql = "SELECT * FROM CommodityMaster where MarkSeasId='" + strcom + "'";
        DataSet ds     = SqlObj.selectAny(strsql);

        if (ds.Tables[0].Rows.Count > 0)
        {
            DDL_Commodity.DataSource     = ds.Tables[0];
            DDL_Commodity.DataTextField  = "CommodityName";
            DDL_Commodity.DataValueField = "CommodityId";
            DDL_Commodity.DataBind();
        }
        else
        {
            // nothing
        }
    }
Exemplo n.º 4
0
 private void GetCommodity()
 {
     try
     {
         SqlObj = new SqlString(ComObj);
         string  strcom = Session["StateLog_MarkID"].ToString();
         string  strsql = "SELECT * FROM CommodityMaster where MarkSeasId='" + strcom + "'";
         DataSet ds     = SqlObj.selectAny(strsql);
         if (ds.Tables[0].Rows.Count > 0)
         {
             DDL_Commodity.DataSource     = ds.Tables[0];
             DDL_Commodity.DataTextField  = "CommodityName";
             DDL_Commodity.DataValueField = "CommodityId";
             DDL_Commodity.DataBind();
             DDL_Commodity.Items.Insert(0, "--Select--");
         }
     }
     catch (Exception ex)
     {
         Page.RegisterClientScriptBlock("mymsg2", "<script language=javascript> alert('" + ex.Message + "'); </script> ");
     }
 }
Exemplo n.º 5
0
    private void GetCommodity(string comdity)
    {
        SqlObj = new SqlString(ComObj);
        ds     = new DataSet();
        try
        {
            if (DDL_MarSeas.SelectedItem.Text != "--Select--")
            {
                string strSql = "select * from CommodityMaster where MarkSeasId='" + comdity + "'";
                ds = SqlObj.selectAny(strSql);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DDL_Commodity.DataSource     = ds.Tables[0];
                    DDL_Commodity.DataTextField  = "CommodityName";
                    DDL_Commodity.DataValueField = "CommodityId";
                    DDL_Commodity.DataBind();
                    DDL_Commodity.Items.Insert(0, "--Select--");
                }
            }

            else
            {
                DDL_Commodity.Items.Clear();
            }
        }
        catch (Exception ex)
        {
            DivMsg.InnerText = ex.Message;
        }

        finally
        {
            SqlObj = null;
            ds     = null;
        }
    }