Exemple #1
0
        public static ControlEditList GetByBasicAndGroupID(BooleanType isBasic, IntegerType orgGroupID)
        {
            OrderByClause sort   = new OrderByClause("IsBasic, OrgGroupID");
            WhereClause   filter = new WhereClause();

            filter.And("IsBasic", !isBasic.IsValid ? isBasic.DBValue : isBasic.DBValue.Equals("Y") ? 1 : 0);
            filter.And("OrgGroupID", orgGroupID.DBValue);

            return(GetList(filter, sort));
        }
Exemple #2
0
        public static void Update(GroupData data)
        {
            // Create and execute the command
            GroupData oldData = Load(data.GroupId);
            string    sql     = "Update " + TABLE + " set ";

            if (!oldData.GroupName.Equals(data.GroupName))
            {
                sql = sql + "GroupName=@GroupName,";
            }
            WhereClause w = new WhereClause();

            w.And("GroupId", data.GroupId.DBValue);
            sql = sql.Substring(0, sql.Length - 1) + w.FormatSql();
            SqlCommand cmd = GetSqlCommand(DatabaseEnum.ORDERDB, sql, CommandType.Text, COMMAND_TIMEOUT);

            //Create the parameters and append them to the command object
            if (!oldData.GroupId.Equals(data.GroupId))
            {
                cmd.Parameters.Add(new SqlParameter("@GroupId", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "GroupId", DataRowVersion.Proposed, data.GroupId.DBValue));
            }
            if (!oldData.GroupName.Equals(data.GroupName))
            {
                cmd.Parameters.Add(new SqlParameter("@GroupName", SqlDbType.VarChar, 100, ParameterDirection.Input, false, 0, 0, "GroupName", DataRowVersion.Proposed, data.GroupName.DBValue));
            }

            // Execute the query
            if (cmd.Parameters.Count > 0)
            {
                cmd.ExecuteNonQuery();
            }
        }
Exemple #3
0
        public static NewsArticlesLocationsList FindByNewsArticlesID(IntegerType newsArticlesID)
        {
            OrderByClause sort = new OrderByClause("NewsArticlesID");
	    WhereClause filter = new WhereClause();
	    filter.And("NewsArticlesID", newsArticlesID.DBValue);

	    return GetList(filter, sort);
        }
        /// <summary>
        /// Returns a list of objects which match the values for the fields specified.
        /// </summary>
        /// <param name="zip">A field value to be matched.</param>
        /// <returns>The list of TestUpdateChangedOnlyDAO objects found.</returns>
        public static IList FindByPostalCode(StringType address_PostalCode)
        {
            OrderByClause sort   = new OrderByClause("Int32Column, StringColumn");
            WhereClause   filter = new WhereClause();

            filter.And("zip", address_PostalCode.DBValue);

            return(GetList(filter, sort));
        }
Exemple #5
0
        /// <summary>
        /// Returns a list of objects which match the values for the fields specified.
        /// </summary>
        /// <param name="TournamentId">A field value to be matched.</param>
        /// <returns>The list of TeamDAO objects found.</returns>
        public static IList FindByTournamentId(IdType tournamentId)
        {
            OrderByClause sort   = new OrderByClause("TournamentId");
            WhereClause   filter = new WhereClause();

            filter.And("TournamentId", tournamentId.DBValue);

            return(GetList(filter, sort));
        }
Exemple #6
0
        public static OrderDtlList FindByOrderNo(StringType orderNo)
        {
            OrderByClause sort   = new OrderByClause("Orderno");
            WhereClause   filter = new WhereClause();

            filter.And("Orderno", orderNo.DBValue);

            return(GetList(filter, sort));
        }
Exemple #7
0
        public static GroupRoleList FindByGroupId(IdType groupId)
        {
            OrderByClause sort   = new OrderByClause("GroupId");
            WhereClause   filter = new WhereClause();

            filter.And("GroupId", groupId.DBValue);

            return(GetList(filter, sort));
        }
        public static UserRoleList FindByUserId(IdType userId)
        {
            OrderByClause sort   = new OrderByClause("UserId");
            WhereClause   filter = new WhereClause();

            filter.And("UserId", userId.DBValue);

            return(GetList(filter, sort));
        }
Exemple #9
0
        public static UserList FindByLogin(StringType userLogin)
        {
            OrderByClause sort   = new OrderByClause("UserLogin");
            WhereClause   filter = new WhereClause();

            filter.And("UserLogin", userLogin.DBValue);

            return(GetList(filter, sort));
        }
Exemple #10
0
        public static ImageLibraryList GetByGroupID(IntegerType orgGroupID)
        {
            OrderByClause sort   = new OrderByClause("OrgGroupID");
            WhereClause   filter = new WhereClause();

            filter.And("OrgGroupID", orgGroupID.DBValue);

            return(GetList(filter, sort));
        }
Exemple #11
0
        public static OrgEmployeesList FindByUsername(StringType nTUserAccount)
        {
            OrderByClause sort   = new OrderByClause("NTUserAccount");
            WhereClause   filter = new WhereClause();

            filter.And("NTUserAccount", nTUserAccount.DBValue);

            return(GetList(filter, sort));
        }
Exemple #12
0
        /// <summary>
        /// Finds a Testsqlentity entity using it's primary key.
        /// </summary>
        /// <param name="sqlstringcolumn">A key field.</param>
        /// <param name="sqlintcolumn">A key field.</param>
        /// <returns>A TestsqlentityData object.</returns>
        /// <exception cref="Spring2.Core.DAO.FinderException">Thrown when no entity exists witht he specified primary key..</exception>
        public static TestsqlentityData Load(StringType stringColumn, IdType int32Column)
        {
            WhereClause w = new WhereClause();

            w.And("sqlstringcolumn", stringColumn.DBValue);
            w.And("sqlintcolumn", int32Column.DBValue);
            SqlDataReader dataReader = GetListReader(CONNECTION_STRING_KEY, VIEW, w, null);

            if (!dataReader.Read())
            {
                dataReader.Close();
                throw new FinderException("Load found no rows for Testsqlentity.");
            }
            TestsqlentityData data = GetDataObjectFromReader(dataReader);

            dataReader.Close();
            return(data);
        }
        public static void Update(OrgDepartmentsData data)
        {
            // Create and execute the command
            OrgDepartmentsData oldData = Load(data.OrgDepartmentsID);
            string             sql     = "Update " + TABLE + " set ";

            if (!oldData.Description.Equals(data.Description))
            {
                sql = sql + "Description=@Description,";
            }
            if (!oldData.Active.Equals(data.Active))
            {
                sql = sql + "Active=@Active,";
            }
            if (!oldData.OrgDivisionsID.Equals(data.OrgDivisionsID))
            {
                sql = sql + "OrgDivisionsID=@OrgDivisionsID,";
            }
            if (!oldData.GLAccount.Equals(data.GLAccount))
            {
                sql = sql + "GLAccount=@GLAccount,";
            }
            WhereClause w = new WhereClause();

            w.And("OrgDepartmentsID", data.OrgDepartmentsID.DBValue);
            sql = sql.Substring(0, sql.Length - 1) + w.FormatSql();
            SqlCommand cmd = GetSqlCommand(DatabaseEnum.INTRANET, sql, CommandType.Text, COMMAND_TIMEOUT);

            //Create the parameters and append them to the command object
            if (!oldData.OrgDepartmentsID.Equals(data.OrgDepartmentsID))
            {
                cmd.Parameters.Add(new SqlParameter("@OrgDepartmentsID", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "OrgDepartmentsID", DataRowVersion.Proposed, data.OrgDepartmentsID.DBValue));
            }
            if (!oldData.Description.Equals(data.Description))
            {
                cmd.Parameters.Add(new SqlParameter("@Description", SqlDbType.VarChar, 100, ParameterDirection.Input, false, 0, 0, "Description", DataRowVersion.Proposed, data.Description.DBValue));
            }
            if (!oldData.Active.Equals(data.Active))
            {
                cmd.Parameters.Add(new SqlParameter("@Active", SqlDbType.Bit, 0, ParameterDirection.Input, false, 0, 0, "Active", DataRowVersion.Proposed, !data.Active.IsValid ? data.Active.DBValue : data.Active.DBValue.Equals("Y") ? 1 : 0));
            }
            if (!oldData.OrgDivisionsID.Equals(data.OrgDivisionsID))
            {
                cmd.Parameters.Add(new SqlParameter("@OrgDivisionsID", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "OrgDivisionsID", DataRowVersion.Proposed, data.OrgDivisionsID.DBValue));
            }
            if (!oldData.GLAccount.Equals(data.GLAccount))
            {
                cmd.Parameters.Add(new SqlParameter("@GLAccount", SqlDbType.VarChar, 20, ParameterDirection.Input, false, 0, 0, "GLAccount", DataRowVersion.Proposed, data.GLAccount.DBValue));
            }

            // Execute the query
            if (cmd.Parameters.Count > 0)
            {
                cmd.ExecuteNonQuery();
            }
        }
Exemple #14
0
        public static void Update(ControlsGroupsData data)
        {
            // Create and execute the command
            ControlsGroupsData oldData = Load(data.ControlsGroupsID);
            string             sql     = "Update " + TABLE + " set ";

            if (!oldData.ControlsID.Equals(data.ControlsID))
            {
                sql = sql + "ControlsID=@ControlsID,";
            }
            if (!oldData.OrgGroupsID.Equals(data.OrgGroupsID))
            {
                sql = sql + "OrgGroupsID=@OrgGroupsID,";
            }
            if (!oldData.SortOrder.Equals(data.SortOrder))
            {
                sql = sql + "SortOrder=@SortOrder,";
            }
            if (!oldData.DisplayOnHomePage.Equals(data.DisplayOnHomePage))
            {
                sql = sql + "DisplayOnHomePage=@DisplayOnHomePage,";
            }
            WhereClause w = new WhereClause();

            w.And("ControlsGroupsID", data.ControlsGroupsID.DBValue);
            sql = sql.Substring(0, sql.Length - 1) + w.FormatSql();
            SqlCommand cmd = GetSqlCommand(DatabaseEnum.INTRANET, sql, CommandType.Text, COMMAND_TIMEOUT);

            //Create the parameters and append them to the command object
            if (!oldData.ControlsGroupsID.Equals(data.ControlsGroupsID))
            {
                cmd.Parameters.Add(new SqlParameter("@ControlsGroupsID", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "ControlsGroupsID", DataRowVersion.Proposed, data.ControlsGroupsID.DBValue));
            }
            if (!oldData.ControlsID.Equals(data.ControlsID))
            {
                cmd.Parameters.Add(new SqlParameter("@ControlsID", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "ControlsID", DataRowVersion.Proposed, data.ControlsID.DBValue));
            }
            if (!oldData.OrgGroupsID.Equals(data.OrgGroupsID))
            {
                cmd.Parameters.Add(new SqlParameter("@OrgGroupsID", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "OrgGroupsID", DataRowVersion.Proposed, data.OrgGroupsID.DBValue));
            }
            if (!oldData.SortOrder.Equals(data.SortOrder))
            {
                cmd.Parameters.Add(new SqlParameter("@SortOrder", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "SortOrder", DataRowVersion.Proposed, data.SortOrder.DBValue));
            }
            if (!oldData.DisplayOnHomePage.Equals(data.DisplayOnHomePage))
            {
                cmd.Parameters.Add(new SqlParameter("@DisplayOnHomePage", SqlDbType.Bit, 0, ParameterDirection.Input, false, 0, 0, "DisplayOnHomePage", DataRowVersion.Proposed, !data.DisplayOnHomePage.IsValid ? data.DisplayOnHomePage.DBValue : data.DisplayOnHomePage.DBValue.Equals("Y") ? 1 : 0));
            }

            // Execute the query
            if (cmd.Parameters.Count > 0)
            {
                cmd.ExecuteNonQuery();
            }
        }
        public static void Update(DirectoriesData data)
        {
            // Create and execute the command
            DirectoriesData oldData = Load(data.Id);
            string          sql     = "Update " + TABLE + " set ";

            if (!oldData.Name.Equals(data.Name))
            {
                sql = sql + "Name=@Name,";
            }
            if (!oldData.Path.Equals(data.Path))
            {
                sql = sql + "Path=@Path,";
            }
            if (!oldData.IsPublic.Equals(data.IsPublic))
            {
                sql = sql + "IsPublic=@IsPublic,";
            }
            if (!oldData.OrgGroupID.Equals(data.OrgGroupID))
            {
                sql = sql + "OrgGroupID=@OrgGroupID,";
            }
            WhereClause w = new WhereClause();

            w.And("Id", data.Id.DBValue);
            sql = sql.Substring(0, sql.Length - 1) + w.FormatSql();
            SqlCommand cmd = GetSqlCommand(DatabaseEnum.INTRANET, sql, CommandType.Text, COMMAND_TIMEOUT);

            //Create the parameters and append them to the command object
            if (!oldData.Id.Equals(data.Id))
            {
                cmd.Parameters.Add(new SqlParameter("@Id", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "Id", DataRowVersion.Proposed, data.Id.DBValue));
            }
            if (!oldData.Name.Equals(data.Name))
            {
                cmd.Parameters.Add(new SqlParameter("@Name", SqlDbType.VarChar, 50, ParameterDirection.Input, false, 0, 0, "Name", DataRowVersion.Proposed, data.Name.DBValue));
            }
            if (!oldData.Path.Equals(data.Path))
            {
                cmd.Parameters.Add(new SqlParameter("@Path", SqlDbType.VarChar, 150, ParameterDirection.Input, false, 0, 0, "Path", DataRowVersion.Proposed, data.Path.DBValue));
            }
            if (!oldData.IsPublic.Equals(data.IsPublic))
            {
                cmd.Parameters.Add(new SqlParameter("@IsPublic", SqlDbType.Bit, 0, ParameterDirection.Input, false, 0, 0, "IsPublic", DataRowVersion.Proposed, !data.IsPublic.IsValid ? data.IsPublic.DBValue : data.IsPublic.DBValue.Equals("Y") ? 1 : 0));
            }
            if (!oldData.OrgGroupID.Equals(data.OrgGroupID))
            {
                cmd.Parameters.Add(new SqlParameter("@OrgGroupID", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "OrgGroupID", DataRowVersion.Proposed, data.OrgGroupID.DBValue));
            }

            // Execute the query
            if (cmd.Parameters.Count > 0)
            {
                cmd.ExecuteNonQuery();
            }
        }
        /// <summary>
        /// Returns an object which matches the values for the fields specified.
        /// </summary>
        /// <param name="sqlstringcolumn">A field value to be matched.</param>
        /// <param name="sqlintcolumn">A field value to be matched.</param>
        /// <returns>The object found.</returns>
        /// <exception cref="Spring2.Core.DAO.FinderException">Thrown when no rows are found.</exception>
        public static TestUpdateChangedOnlyData FindByPK(StringType stringColumn, IdType int32Column)
        {
            OrderByClause sort   = new OrderByClause("sqlstringcolumn, sqlintcolumn");
            WhereClause   filter = new WhereClause();

            filter.And("sqlstringcolumn", stringColumn.DBValue);
            filter.And("sqlintcolumn", int32Column.DBValue);
            SqlDataReader dataReader = GetListReader(CONNECTION_STRING_KEY, VIEW, filter, sort);

            if (!dataReader.Read())
            {
                dataReader.Close();
                throw new FinderException("TestUpdateChangedOnlyData.FindByPK found no rows.");
            }
            TestUpdateChangedOnlyData data = GetDataObjectFromReader(dataReader);

            dataReader.Close();
            return(data);
        }
        public static WebConfigData FindActiveEntry(DateType createDate, BooleanType active)
        {
            OrderByClause sort   = new OrderByClause("CreateDate, Active");
            WhereClause   filter = new WhereClause();

            filter.And("CreateDate", createDate.DBValue);
            filter.And("Active", !active.IsValid ? active.DBValue : active.DBValue.Equals("Y") ? 1 : 0);
            SqlDataReader dataReader = GetListReader(DatabaseEnum.INTERNET, TABLE, filter, sort, true);

            if (!dataReader.Read())
            {
                dataReader.Close();
                throw new FinderException("WebConfigData.FindActiveEntry found no rows.");
            }
            WebConfigData data = GetDataObjectFromReader(dataReader);

            dataReader.Close();
            return(data);
        }
Exemple #18
0
        public static void Delete(IdType newsArticlesLocationsID)
        {
            // Create and execute the command
	    string sql = "Delete From " + TABLE;
	    WhereClause w = new WhereClause();
	    w.And("NewsArticlesLocationsID", newsArticlesLocationsID.DBValue);
	    sql += w.FormatSql();
	    SqlCommand cmd = GetSqlCommand(DatabaseEnum.INTRANET, sql, CommandType.Text, COMMAND_TIMEOUT);

	    // Execute the query and return the result
	    cmd.ExecuteNonQuery();
        }
        public static void Update(SessionInformationData data)
        {
            // Create and execute the command
            SessionInformationData oldData = Load(data.SessionId);
            string sql = "Update " + TABLE + " set ";

            if (!oldData.SessionId.Equals(data.SessionId))
            {
                sql = sql + "SessionId=@SessionId,";
            }
            if (!oldData.DemoId.Equals(data.DemoId))
            {
                sql = sql + "DemoId=@DemoId,";
            }
            if (!oldData.UserId.Equals(data.UserId))
            {
                sql = sql + "UserId=@UserId,";
            }
            if (!oldData.DateCreated.Equals(data.DateCreated))
            {
                sql = sql + "DateCreated=@DateCreated,";
            }
            WhereClause w = new WhereClause();

            w.And("SessionId", data.SessionId.DBValue);
            sql = sql.Substring(0, sql.Length - 1) + w.FormatSql();
            SqlCommand cmd = GetSqlCommand(DatabaseEnum.ORDERDB, sql, CommandType.Text, COMMAND_TIMEOUT);

            //Create the parameters and append them to the command object
            if (!oldData.SessionId.Equals(data.SessionId))
            {
                cmd.Parameters.Add(new SqlParameter("@SessionId", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "SessionId", DataRowVersion.Proposed, data.SessionId.DBValue));
            }
            if (!oldData.DemoId.Equals(data.DemoId))
            {
                cmd.Parameters.Add(new SqlParameter("@DemoId", SqlDbType.Char, 7, ParameterDirection.Input, false, 0, 0, "DemoId", DataRowVersion.Proposed, data.DemoId.DBValue));
            }
            if (!oldData.UserId.Equals(data.UserId))
            {
                cmd.Parameters.Add(new SqlParameter("@UserId", SqlDbType.Char, 15, ParameterDirection.Input, false, 0, 0, "UserId", DataRowVersion.Proposed, data.UserId.DBValue));
            }
            if (!oldData.DateCreated.Equals(data.DateCreated))
            {
                cmd.Parameters.Add(new SqlParameter("@DateCreated", SqlDbType.DateTime, 0, ParameterDirection.Input, false, 0, 0, "DateCreated", DataRowVersion.Proposed, data.DateCreated.DBValue));
            }

            // Execute the query
            if (cmd.Parameters.Count > 0)
            {
                cmd.ExecuteNonQuery();
            }
        }
Exemple #20
0
        public static void Delete(IdType eventId)
        {
            // Create and execute the command
            string      sql = "Delete From " + TABLE;
            WhereClause w   = new WhereClause();

            w.And("Event_Id", eventId.DBValue);
            sql += w.FormatSql();
            SqlCommand cmd = GetSqlCommand(DatabaseEnum.ORDERDB, sql, CommandType.Text, COMMAND_TIMEOUT);

            // Execute the query and return the result
            cmd.ExecuteNonQuery();
        }
Exemple #21
0
        public static NewsArticlesLocationsData Load(IdType newsArticlesLocationsID)
        {
            WhereClause w = new WhereClause();
	    w.And("NewsArticlesLocationsID", newsArticlesLocationsID.DBValue);
	    SqlDataReader dataReader = GetListReader(DatabaseEnum.INTRANET, TABLE, w, null, true);
	    if (!dataReader.Read())
	    {
		dataReader.Close();
		throw new FinderException("Load found no rows for NewsArticlesLocations.");
	    }
	    NewsArticlesLocationsData data = GetDataObjectFromReader(dataReader);
	    dataReader.Close();
	    return data;
        }
Exemple #22
0
        public static void Update(NewEmployeeRequestData data)
        {
            // Create and execute the command
            NewEmployeeRequestData oldData = Load(data.Id);
            string sql = "Update " + TABLE + " set ";

            if (!oldData.HireDate.Equals(data.HireDate))
            {
                sql = sql + "HireDate=@HireDate,";
            }
            if (!oldData.Text.Equals(data.Text))
            {
                sql = sql + "Text=@Text,";
            }
            if (!oldData.EmployeeID.Equals(data.EmployeeID))
            {
                sql = sql + "EmployeeID=@EmployeeID,";
            }
            WhereClause w = new WhereClause();

            w.And("Id", data.Id.DBValue);
            sql = sql.Substring(0, sql.Length - 1) + w.FormatSql();
            SqlCommand cmd = GetSqlCommand(DatabaseEnum.INTRANET, sql, CommandType.Text, COMMAND_TIMEOUT);

            //Create the parameters and append them to the command object
            if (!oldData.Id.Equals(data.Id))
            {
                cmd.Parameters.Add(new SqlParameter("@Id", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "Id", DataRowVersion.Proposed, data.Id.DBValue));
            }
            if (!oldData.HireDate.Equals(data.HireDate))
            {
                cmd.Parameters.Add(new SqlParameter("@HireDate", SqlDbType.DateTime, 0, ParameterDirection.Input, false, 0, 0, "HireDate", DataRowVersion.Proposed, data.HireDate.DBValue));
            }
            if (!oldData.Text.Equals(data.Text))
            {
                cmd.Parameters.Add(new SqlParameter("@Text", SqlDbType.Text, 0, ParameterDirection.Input, false, 0, 0, "Text", DataRowVersion.Proposed, data.Text.DBValue));
            }
            if (!oldData.EmployeeID.Equals(data.EmployeeID))
            {
                cmd.Parameters.Add(new SqlParameter("@EmployeeID", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "EmployeeID", DataRowVersion.Proposed, data.EmployeeID.DBValue));
            }

            // Execute the query
            if (cmd.Parameters.Count > 0)
            {
                cmd.ExecuteNonQuery();
            }
        }
        public static void Update(UserRoleData data)
        {
            // Create and execute the command
            UserRoleData oldData = Load(data.UserRoleId);
            string       sql     = "Update " + TABLE + " set ";

            if (!oldData.UserId.Equals(data.UserId))
            {
                sql = sql + "UserId=@UserId,";
            }
            if (!oldData.RoleId.Equals(data.RoleId))
            {
                sql = sql + "RoleId=@RoleId,";
            }
            if (!oldData.PermitDeny.Equals(data.PermitDeny))
            {
                sql = sql + "PermitDeny=@PermitDeny,";
            }
            WhereClause w = new WhereClause();

            w.And("UserRoleId", data.UserRoleId.DBValue);
            sql = sql.Substring(0, sql.Length - 1) + w.FormatSql();
            SqlCommand cmd = GetSqlCommand(DatabaseEnum.ORDERDB, sql, CommandType.Text, COMMAND_TIMEOUT);

            //Create the parameters and append them to the command object
            if (!oldData.UserRoleId.Equals(data.UserRoleId))
            {
                cmd.Parameters.Add(new SqlParameter("@UserRoleId", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "UserRoleId", DataRowVersion.Proposed, data.UserRoleId.DBValue));
            }
            if (!oldData.UserId.Equals(data.UserId))
            {
                cmd.Parameters.Add(new SqlParameter("@UserId", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "UserId", DataRowVersion.Proposed, data.UserId.DBValue));
            }
            if (!oldData.RoleId.Equals(data.RoleId))
            {
                cmd.Parameters.Add(new SqlParameter("@RoleId", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "RoleId", DataRowVersion.Proposed, data.RoleId.DBValue));
            }
            if (!oldData.PermitDeny.Equals(data.PermitDeny))
            {
                cmd.Parameters.Add(new SqlParameter("@PermitDeny", SqlDbType.Int, 0, ParameterDirection.Input, false, 10, 0, "PermitDeny", DataRowVersion.Proposed, data.PermitDeny.DBValue));
            }

            // Execute the query
            if (cmd.Parameters.Count > 0)
            {
                cmd.ExecuteNonQuery();
            }
        }
        public static KnowledgebasesSectionsArticlesSeeAlsoData Load(IdType id)
        {
            WhereClause w = new WhereClause();

            w.And("Id", id.DBValue);
            SqlDataReader dataReader = GetListReader(DatabaseEnum.INTRANET, TABLE, w, null, true);

            if (!dataReader.Read())
            {
                dataReader.Close();
                throw new FinderException("Load found no rows for KnowledgebasesSectionsArticlesSeeAlso.");
            }
            KnowledgebasesSectionsArticlesSeeAlsoData data = GetDataObjectFromReader(dataReader);

            dataReader.Close();
            return(data);
        }
        public static WebConfigData Load(IdType webConfigID)
        {
            WhereClause w = new WhereClause();

            w.And("WebConfigID", webConfigID.DBValue);
            SqlDataReader dataReader = GetListReader(DatabaseEnum.INTERNET, TABLE, w, null, true);

            if (!dataReader.Read())
            {
                dataReader.Close();
                throw new FinderException("Load found no rows for WebConfig.");
            }
            WebConfigData data = GetDataObjectFromReader(dataReader);

            dataReader.Close();
            return(data);
        }
Exemple #26
0
        public static EventData Load(IdType eventId)
        {
            WhereClause w = new WhereClause();

            w.And("Event_Id", eventId.DBValue);
            SqlDataReader dataReader = GetListReader(DatabaseEnum.ORDERDB, TABLE, w, null, true);

            if (!dataReader.Read())
            {
                dataReader.Close();
                throw new FinderException("Load found no rows for Event.");
            }
            EventData data = GetDataObjectFromReader(dataReader);

            dataReader.Close();
            return(data);
        }
        public static OrgGroupsEmployeesData Load(IdType orgGroupsEmployeesID)
        {
            WhereClause w = new WhereClause();

            w.And("OrgGroupsEmployeesID", orgGroupsEmployeesID.DBValue);
            SqlDataReader dataReader = GetListReader(DatabaseEnum.INTRANET, TABLE, w, null, true);

            if (!dataReader.Read())
            {
                dataReader.Close();
                throw new FinderException("Load found no rows for OrgGroupsEmployees.");
            }
            OrgGroupsEmployeesData data = GetDataObjectFromReader(dataReader);

            dataReader.Close();
            return(data);
        }
        /// <summary>
        /// Finds a Payment entity using it's primary key.
        /// </summary>
        /// <param name="PaymentId">A key field.</param>
        /// <returns>A PaymentData object.</returns>
        /// <exception cref="Spring2.Core.DAO.FinderException">Thrown when no entity exists witht he specified primary key..</exception>
        public static PaymentData Load(IdType paymentId)
        {
            WhereClause w = new WhereClause();

            w.And("PaymentId", paymentId.DBValue);
            SqlDataReader dataReader = GetListReader(CONNECTION_STRING_KEY, VIEW, w, null);

            if (!dataReader.Read())
            {
                dataReader.Close();
                throw new FinderException("Load found no rows for Payment.");
            }
            PaymentData data = GetDataObjectFromReader(dataReader);

            dataReader.Close();
            return(data);
        }
Exemple #29
0
        public static ControlSubscriptionsData Load(IdType controlSubscriptionsID)
        {
            WhereClause w = new WhereClause();

            w.And("ControlSubscriptionsID", controlSubscriptionsID.DBValue);
            SqlDataReader dataReader = GetListReader(DatabaseEnum.INTRANET, TABLE, w, null, true);

            if (!dataReader.Read())
            {
                dataReader.Close();
                throw new FinderException("Load found no rows for ControlSubscriptions.");
            }
            ControlSubscriptionsData data = GetDataObjectFromReader(dataReader);

            dataReader.Close();
            return(data);
        }
Exemple #30
0
        public static OrderDtlData Load(StringType orderDetailId)
        {
            WhereClause w = new WhereClause();

            w.And("Order_Detail_Id", orderDetailId.DBValue);
            SqlDataReader dataReader = GetListReader(DatabaseEnum.ORDERDB, TABLE, w, null, true);

            if (!dataReader.Read())
            {
                dataReader.Close();
                throw new FinderException("Load found no rows for OrderDtl.");
            }
            OrderDtlData data = GetDataObjectFromReader(dataReader);

            dataReader.Close();
            return(data);
        }