protected void DDLRecItemEntry_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            TBBarcode.Enabled    = true;
            DDLItemName.Enabled  = true;
            TBSearchCode.Enabled = true;
            LBAddAllItem.Enabled = true;

            string  ss = "SELECT Supplier FROM Receive_Master WHERE ID='" + DDLRecItemEntry.SelectedValue + "'";
            DataSet ds = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.Text, ss);
            if (ds.Tables[0].Rows.Count > 0)
            {
                DDLSupplier.ClearSelection();
                DDLSupplier.Items.FindByValue(ds.Tables[0].Rows[0][0].ToString()).Selected = true;
            }

            string  ss2 = "SELECT ID FROM Godown WHERE NGOID='" + DDLBusinessLocation.SelectedValue + "' AND ComID='" + Session["ComID"] + "'";
            DataSet ds2 = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.Text, ss2);
            if (ds2.Tables[0].Rows.Count > 0)
            {
                DDLGodown.ClearSelection();
                DDLGodown.Items.FindByValue(ds2.Tables[0].Rows[0][0].ToString()).Selected = true;
            }

            string  ss3 = "SELECT dbo.RawMaterial.ID,dbo.RawMaterial.Name FROM dbo.Receive_details INNER JOIN dbo.RawMaterial ON dbo.Receive_details.ItemID = dbo.RawMaterial.ID WHERE (dbo.Receive_details.rec_Id = '" + DDLRecItemEntry.SelectedValue + "')";
            DataSet ds3 = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.Text, ss3);
            if (ds3.Tables[0].Rows.Count > 0)
            {
                DDLItemName.Items.Clear();
                DDLItemName.DataSource     = ds3.Tables[0];
                DDLItemName.DataTextField  = "Name";
                DDLItemName.DataValueField = "ID";
                DDLItemName.DataBind();
                DDLItemName.Items.Insert(0, new System.Web.UI.WebControls.ListItem("-Select-", "0"));
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, MessageType.Error);
        }
    }
 protected void CBAllowRIENumber_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         if (CBAllowRIENumber.Checked)
         {
             DDLRecItemEntry.ClearSelection();
             DDLRecItemEntry.Dispose();
             DDLRecItemEntry.Enabled = false;
             DDLGodown.ClearSelection();
             DDLGodown.Enabled = true;
             DDLSupplier.ClearSelection();
             DDLSupplier.Enabled  = true;
             LBAddAllItem.Enabled = false;
             TBBarcode.Enabled    = false;
             DDLItemName.Items.Clear();
             DDLItemName.Enabled  = false;
             TBSearchCode.Enabled = false;
         }
         else
         {
             DDLRecItemEntry.Enabled = true;
             DDLGodown.ClearSelection();
             DDLGodown.Enabled = false;
             DDLSupplier.ClearSelection();
             DDLSupplier.Enabled  = false;
             LBAddAllItem.Enabled = false;
             TBBarcode.Enabled    = false;
             DDLItemName.Items.Clear();
             DDLItemName.Enabled  = false;
             TBSearchCode.Enabled = false;
         }
     }
     catch (Exception ex)
     {
         ShowMessage(ex.Message, MessageType.Error);
     }
 }