예제 #1
0
        public static Entities.PublicationEntities.PublicationItem GetPublicationItem(int publicationItemID)
        {
            DAL.Utilities.Helper helper = new DAL.Utilities.Helper(_connectionString);
            Entities.PublicationEntities.PublicationItem publicationItem = new Entities.PublicationEntities.PublicationItem();

            SqlCommand command = new SqlCommand();

            command.CommandTimeout = 10;
            command.CommandType    = CommandType.StoredProcedure;
            command.CommandText    = "GetPublicationItem";

            command.Parameters.Add("@PublicationItemID", System.Data.SqlDbType.Int).Value = publicationItemID;

            DataTable dataTable = helper.GetDataTable(command);

            if (dataTable.Rows.Count == 0)
            {
                publicationItem = null;
            }
            else
            {
                publicationItem = DAL.PublicationDAL.PublicationItemEntityTransformer.ConvertRowToPublicationItem(dataTable.Rows[0]);
            }

            return(publicationItem);
        }
예제 #2
0
        public static List <Entities.PublicationEntities.PublicationTask> GetPublicationTasks()
        {
            DAL.Utilities.Helper helper = new DAL.Utilities.Helper(_connectionString);

            string sql = string.Empty;

            sql += "SELECT * FROM PublicationTask;";

            SqlCommand command = new SqlCommand(sql);

            DataTable dataTable = helper.GetDataTable(command);

            return(helper.ToList(dataTable, PublicationDAL.PublicationTaskEntityTransformer.ConvertRowToPublicationTask));
        }
예제 #3
0
        public static List <Entities.PublicationEntities.PublicationItem> GetPublicationItems(int publicationTaskID)
        {
            DAL.Utilities.Helper helper = new DAL.Utilities.Helper(_connectionString);

            SqlCommand command = new SqlCommand();

            command.CommandTimeout = 10;
            command.CommandText    = "GetPublicationItems";
            command.CommandType    = CommandType.StoredProcedure;

            command.Parameters.Add("@PublicationTaskID", System.Data.SqlDbType.Int).Value = publicationTaskID;

            DataTable dataTable = helper.GetDataTable(command);

            return(helper.ToList(dataTable, DAL.PublicationDAL.PublicationItemEntityTransformer.ConvertRowToPublicationItem));
        }