public void Insert(ref DBHelper dbInstance, IStateNews objNews, IImageDetail objImageDetail, IUsers user)
        {
            try
            {
                dbInstance.ClearAllParameters();
                dbInstance.AddInParameter("@EditorID", objNews.EditorID, DbType.String);
                dbInstance.AddInParameter("@DisplayOrder", objNews.DisplayOrder, DbType.Int32);
                dbInstance.AddInParameter("@Heading", objNews.Heading, DbType.String);
                dbInstance.AddInParameter("@ShortDescription", objNews.ShortDescription, DbType.String);
                dbInstance.AddInParameter("@NewsDescription", objNews.NewsDescription, DbType.String);
                dbInstance.AddInParameter("@LanguageID", objNews.LanguageID, DbType.Int32);
                dbInstance.AddInParameter("@StateCode", objNews.StateCode, DbType.String);
                dbInstance.AddInParameter("@IsTopNews", objNews.IsTopNews, DbType.Int32);
                dbInstance.AddInParameter("@ImageUrl", objImageDetail.ImageUrl, DbType.String);
                dbInstance.AddInParameter("@Caption", objImageDetail.Caption, DbType.String);
                dbInstance.AddInParameter("@CaptionLink", objImageDetail.CaptionLink, DbType.String);
                dbInstance.AddInParameter("@ImageType", objImageDetail.ImageType, DbType.Int32);
                dbInstance.AddInParameter("@IsFirst", objImageDetail.IsFirst, DbType.Int32);
                dbInstance.AddInParameter("@UserID", user.UserID, DbType.Int64);

                dbInstance.ExecuteNonQuery(ProcedureName.InsertStateNews, CommandType.StoredProcedure);
            }
            catch (Exception objExp)
            {
                throw objExp;
            }
        }
        public void Delete(ref DBHelper dbInstance, System.String AdvertismentID)
        {
            try
            {
                dbInstance.AddInParameter("@AdvertismentID", AdvertismentID, DbType.String);
                dbInstance.ExecuteNonQuery(ProcedureName.DeleteAdvertisment, CommandType.StoredProcedure);

            }
            catch (Exception objExp)
            {
                throw objExp;
            }
        }
Beispiel #3
0
 public void GiveApproval(ref DBHelper dbHelper, ITopNews objTopNews, IUsers user)
 {
     try
     {
         dbHelper.ClearAllParameters();
         dbHelper.AddInParameter("@TopNewsID", objTopNews.TopNewsID, DbType.String);
         dbHelper.AddInParameter("@IsApproved", objTopNews.IsApproved, DbType.Int32);
         dbHelper.AddInParameter("@UserID", user.UserID, DbType.Int64);
         dbHelper.ExecuteNonQuery(ProcedureName.MakeApprovedTopNews, CommandType.StoredProcedure);
     }
     catch (Exception objExp)
     {
         throw objExp;
     }
 }
        internal void Update(ref DBHelper dbHelper, IStateNews news, IImageDetail image, IUsers user)
        {
            try
            {
                dbHelper.ClearAllParameters();
                dbHelper.AddInParameter("@NewsID", news.NewsID, DbType.String);
                dbHelper.AddInParameter("@EditorID", news.EditorID, DbType.String);
                dbHelper.AddInParameter("@DisplayOrder", news.DisplayOrder, DbType.Int32);
                dbHelper.AddInParameter("@Heading", news.Heading, DbType.String);
                dbHelper.AddInParameter("@ShortDescription", news.ShortDescription, DbType.String);
                dbHelper.AddInParameter("@NewsDescription", news.NewsDescription, DbType.String);
                dbHelper.AddInParameter("@LanguageID", news.LanguageID, DbType.Int32);
                dbHelper.AddInParameter("@StateCode", news.StateCode, DbType.String);
                dbHelper.AddInParameter("@IsActive", news.IsActive, DbType.Int32);
                dbHelper.AddInParameter("@IsApproved", news.IsApproved, DbType.Int32);
                dbHelper.AddInParameter("@IsTopNews", news.IsTopNews, DbType.Int32);
                dbHelper.AddInParameter("@ImageUrl", image.ImageUrl, DbType.String);
                dbHelper.AddInParameter("@Caption", image.Caption, DbType.String);
                dbHelper.AddInParameter("@CaptionLink", image.CaptionLink, DbType.String);
                dbHelper.AddInParameter("@ImageType", image.ImageType, DbType.Int32);
                dbHelper.AddInParameter("@IsFirst", image.IsFirst, DbType.Int32);
                dbHelper.AddInParameter("@IsActieImage", image.IsActive, DbType.Int32);
                dbHelper.AddInParameter("@UserID", user.UserID, DbType.Int64);

                dbHelper.ExecuteNonQuery(ProcedureName.UpdateStateNews, CommandType.StoredProcedure);
            }
            catch (Exception objExp)
            {
                throw objExp;
            }
        }
 internal void MakeActive(ref DBHelper dbHelper, IStateNews objNews, IUsers user)
 {
     try
     {
         dbHelper.ClearAllParameters();
         dbHelper.AddInParameter("@NewsID", objNews.NewsID, DbType.String);
         //dbHelper.AddInParameter("@StateCode", objNews.StateCode, DbType.String);
         dbHelper.AddInParameter("@IsActive", objNews.IsActive, DbType.Int32);
         dbHelper.AddInParameter("@UserID", user.UserID, DbType.Int64);
         dbHelper.ExecuteNonQuery(ProcedureName.MakeActiveStateNews, CommandType.StoredProcedure);
     }
     catch (Exception objExp)
     {
         throw objExp;
     }
 }
Beispiel #6
0
 public void Delete(ref DBHelper dbHelper, System.Int64 TopNewsID)
 {
     try
     {
         string strQuery = String.Empty;
         strQuery += "Delete from TopNews where TopNewsID = " + TopNewsID;
         dbHelper.ExecuteNonQuery(strQuery);
     }
     catch (Exception objExp)
     {
         throw objExp;
     }
 }
        public void Insert(ref DBHelper dbInstance, IAdvertisment objAdvertisment)
        {
            try
            {
                dbInstance.AddInParameter("@DisplayOrder", objAdvertisment.DisplayOrder, DbType.Int32);
                dbInstance.AddInParameter("@Heading", objAdvertisment.Heading, DbType.String);
                dbInstance.AddInParameter("@WebUrl", objAdvertisment.WebUrl, DbType.String);
                dbInstance.AddInParameter("@WebLink", objAdvertisment.WebLink, DbType.String);
                dbInstance.AddInParameter("@ShortDesc", objAdvertisment.ShortDesc, DbType.String);
                dbInstance.AddInParameter("@ImgUrl", objAdvertisment.ImgUrl, DbType.String);
                dbInstance.AddInParameter("@AdvertismentType", objAdvertisment.AdvertismentType, DbType.Int32);
                dbInstance.AddInParameter("@Position", objAdvertisment.Position, DbType.Int32);

                dbInstance.ExecuteNonQuery(ProcedureName.InsertAdvertisment, CommandType.StoredProcedure);
            }
            catch (Exception objExp)
            {
                throw objExp;
            }
        }