Monday, 4 June 2012

BL(BLL)

STEP 1: Create the class file like NewsAndArticlesBL.cs

STEP 2:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using VCSB.INTRANET.DAL;

namespace VCSB.INTRANET.BLL
{
   public class NewsAndArticlesBL:IVCSBIntranetBL
    {
        #region Properties and Fields
        /// <summary>
        /// Fields
        /// </summary>
        int _newslistId = 0;
        string _newsTitle, _newsdescription;
        DateTime _newsdate;
        FileUpload _newsfilePath;
        /// <summary>
        /// Properties
        /// </summary>

       
        public string NewsTitle
        {
            get { return _newsTitle; }
            set { _newsTitle = value; }
        }

        public string Newsdescription
        {
            get { return _newsdescription; }
            set { _newsdescription = value; }
        }
        public DateTime Newsdate
        {
            get { return _newsdate; }
            set { _newsdate = value; }
        }
        public FileUpload NewsfilePath
        {
            get { return _newsfilePath; }
            set { _newsfilePath = value; }
        }
        public int ID
        {
            get { return _newslistId; }
            set { _newslistId = value; }
        }
        public string Title
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }
        #endregion

        #region Constructors
        public NewsAndArticlesBL()
        {

        }
        public NewsAndArticlesBL(int newsid)
        {
            this.ID = newsid;

        }
        public NewsAndArticlesBL(int newsid,string newstitle, string newsdescription, DateTime newsdate, FileUpload newsfilePath)
        {
            this.ID = newsid;
            this.NewsTitle = newstitle;
            this.Newsdescription = newsdescription;
            this.Newsdate = newsdate;
            this.NewsfilePath = newsfilePath;

        }

        public NewsAndArticlesBL(string newstitle, string newsdescription, DateTime newsdate, FileUpload newsfilePath)
        {
            this.NewsTitle = newstitle;
            this.Newsdescription = newsdescription;
            this.Newsdate = newsdate;
            this.NewsfilePath = newsfilePath;

        }

        #endregion

        #region Methods
        public bool insert()
        {
         return NewsAndArticlesDL.insert(this);

        }

        public bool update()
        {
           
           return NewsAndArticlesDL.update(this);
        }

        public bool delete()
        {
          
           return NewsAndArticlesDL.delete(this);
        }

        public System.Data.DataTable GetAllListItem()
        {
          
          return NewsAndArticlesDL.GetAllListItem(this);
           
          
        }

        public System.Data.DataTable GetSingleRowListItem()
        {
          
         return NewsAndArticlesDL.GetSingleRowListItem(this);
           
        }
        public System.Data.DataTable GetNewsAndArticleData()
        {
          return  NewsAndArticlesDL.GetNewsAndArticleData(this);
           
        }
        #endregion


        public void GetSingleRowListItem(int id)
        {
            throw new NotImplementedException();
        }
    }
}
 





No comments:

Post a Comment

SharePoint online - Get List-item attachments and Display to div

Step 1 : Create a List ex: TestList and attach few images Step 2 : Copy and Pastet the below coding in App.js var  Items =  null ; ...