public BOTreeMaster checkSponsorAndParent(BOTreeMaster objTreeMaster)
    {
        DALTreeMaster objDALTreeMaster = new DALTreeMaster();

        try
        {
            return(objDALTreeMaster.CheckSponsorAndParent(objTreeMaster));
        }
        catch
        {
            throw;
        }
        finally
        {
            objDALTreeMaster = null;
        }
    }
Beispiel #2
0
    public BOTreeMaster CheckSponsorAndParent(BOTreeMaster objTreeMaster)
    {
        SqlDataReader rdTree = null;

        dCmd             = objDatabaseHelper.Command;
        dCmd.CommandText = "SP_CheckSponsorAndParent";
        dCmd.CommandType = CommandType.StoredProcedure;
        try
        {
            objDatabaseHelper.BeginTransaction();

            objDatabaseHelper.AddParameter("@SponsorCode", objTreeMaster.SponsorID, SqlDbType.NVarChar, 50);
            objDatabaseHelper.AddParameter("@ParentCode", objTreeMaster.ParentID, SqlDbType.NVarChar, 50);

            rdTree = objDatabaseHelper.ExecuteReader(dCmd.CommandText, dCmd.CommandType, DatabaseHelper.ConnectionState.KeepOpen);
            if (rdTree.HasRows)
            {
                while (rdTree.Read())
                {
                    objTreeMaster.Message = rdTree["CheckSponsorAndParent"].ToString();
                }
                rdTree.Close();
            }
            objDatabaseHelper.CommitTransaction();
        }
        catch
        {
            objDatabaseHelper.RollbackTransaction();
        }
        finally
        {
            if (objDatabaseHelper.Connection.State == System.Data.ConnectionState.Open)
            {
                objDatabaseHelper.Connection.Close();
            }
        }
        return(objTreeMaster);
    }