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 dbHelper, System.Int64 UserID) { try { } catch (Exception objExp) { throw objExp; } }
public void Delete(ref DBHelper dbHelper, System.String EmailID) { try { } catch (Exception objExp) { throw objExp; } }
public void Update(ref DBHelper dbHelper, UserEmail objUserEmail) { try { } catch (Exception objExp) { throw objExp; } }
public void MakeActive(ITopNews topNews, IUsers user) { var objdbhelper = new DBHelper(); try { TopNewsDB.Instance.MakeActive(ref objdbhelper, topNews, user); } catch (Exception objExp) { throw objExp; } }
public void GiveApproval(ITopNews topNews, IUsers user) { var objdbhelper = new DBHelper(); try { TopNewsDB.Instance.GiveApproval(ref objdbhelper, topNews, user); } 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; } }
public void Delete(ref DBHelper dbHelper, System.Int64 TopNewsID) { try { throw new NotImplementedException(); //string strQuery = String.Empty; //strQuery += "Delete from TopNews where TopNewsID = " + TopNewsID; //dbHelper.ExecuteNonQuery(strQuery); } catch (Exception objExp) { throw objExp; } }
public void GiveApproval(ref DBHelper dbHelper, IInterNews objNews, IUsers user) { try { dbHelper.ClearAllParameters(); dbHelper.AddInParameter("@NewsID", objNews.NewsID, DbType.String); dbHelper.AddInParameter("@IsApproved", objNews.IsApproved, DbType.Int32); dbHelper.AddInParameter("@UserID", user.UserID, DbType.Int64); dbHelper.ExecuteNonQuery(ProcedureName.MakeApprovedInterNews, CommandType.StoredProcedure); } catch (Exception objExp) { throw objExp; } }
public void MakeActive(ref DBHelper dbHelper, ITopNews objTopNews, IUsers user) { try { dbHelper.ClearAllParameters(); dbHelper.AddInParameter("@TopNewsID", objTopNews.TopNewsID, DbType.String); dbHelper.AddInParameter("@IsActive", objTopNews.IsActive, DbType.Int32); dbHelper.AddInParameter("@UserID", user.UserID, DbType.Int64); dbHelper.ExecuteNonQuery(ProcedureName.MakeActiveTopNews, CommandType.StoredProcedure); } catch (Exception objExp) { throw objExp; } }
public void GiveApprovalFor(IList<IInterNews> newsList, IUsers user) { var dbhelper = new DBHelper(); dbhelper.BeginTransaction(); try { newsList.ToList().ForEach(item => InterNewsDB.Instance.GiveApproval(ref dbhelper, item, user)); dbhelper.CommitTransaction(); } catch (Exception objExp) { dbhelper.RollbackTransaction(); 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; } }
public void Insert(ref DBHelper objdbhelper, ITopNews objTopNews, IImageDetail objImageDetail, IUsers user) { try { objTopNews.EditorID = "1"; objTopNews.DisplayOrder = 1; objTopNews.IsActive = 0; objTopNews.IsApproved = 0; objTopNews.LanguageID = 1; objImageDetail.IsActive = 0; objImageDetail.IsFirst = 1; TopNewsDB.Instance.Insert(ref objdbhelper, objTopNews, objImageDetail, user); } catch (Exception objExp) { throw objExp; } }
public void MakeActiveFor(IList<ITopNews> topNewsList, IUsers user) { var dbhelper = new DBHelper(); dbhelper.BeginTransaction(); try { topNewsList.ToList().ForEach(item => TopNewsDB.Instance.MakeActive(ref dbhelper, item, user)); dbhelper.CommitTransaction(); } catch (Exception objExp) { dbhelper.RollbackTransaction(); 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; } }
// need to write internal IEnumerable<IStateNews> SelectForPartialNewsList(string StateCode, Int64 NextPageValue) { IDataReader objDataReader = null; List<IStateNews> objNewsList = null; IStateNews objNews = null; DBHelper dbHelper = new DBHelper(); try { dbHelper.AddInParameter("@StateCode", StateCode, DbType.String); dbHelper.AddInParameter("@NextPageValue", NextPageValue, DbType.Int64); objDataReader = dbHelper.ExecuteDataReader(ProcedureName.SelectPartialStateNewsListApi, CommandType.StoredProcedure); if (objDataReader != null) { objNewsList = new List<IStateNews>(); do { while (objDataReader.Read()) { objNews = new StateNews(); if (!objDataReader.IsDBNull(0)) objNews.NewsID = objDataReader.GetString(0); if (!objDataReader.IsDBNull(1)) objNews.EditorID = objDataReader.GetString(1); if (!objDataReader.IsDBNull(2)) objNews.DisplayOrder = objDataReader.GetInt32(2); if (!objDataReader.IsDBNull(3)) objNews.Heading = objDataReader.GetString(3); if (!objDataReader.IsDBNull(4)) objNews.ShortDescription = objDataReader.GetString(4); if (!objDataReader.IsDBNull(5)) objNews.NewsDescription = objDataReader.GetString(5); if (!objDataReader.IsDBNull(6)) objNews.LanguageID = objDataReader.GetInt32(6); if (!objDataReader.IsDBNull(7)) objNews.StateCode = objDataReader.GetString(7); if (!objDataReader.IsDBNull(8)) objNews.IsApproved = objDataReader.GetInt32(8); if (!objDataReader.IsDBNull(9)) objNews.IsActive = objDataReader.GetInt32(9); if (!objDataReader.IsDBNull(10)) objNews.IsTopNews = objDataReader.GetInt32(10); if (!objDataReader.IsDBNull(11)) objNews.DttmCreated = objDataReader.GetDateTime(11); if (!objDataReader.IsDBNull(12)) objNews.DttmModified = objDataReader.GetDateTime(12); if (!objDataReader.IsDBNull(13)) objNews.ImageUrl = objDataReader.GetString(13); if (!objDataReader.IsDBNull(14)) objNews.ImageCaption = objDataReader.GetString(14); if (!objDataReader.IsDBNull(15)) objNews.ImageCaptionLink = objDataReader.GetString(15); objNewsList.Add(objNews); } } while (objDataReader.NextResult()); } if (!objDataReader.IsClosed) objDataReader.Close(); } catch (Exception objExp) { throw objExp; } finally { dbHelper.ClearAllParameters(); dbHelper.CloseConnection(); dbHelper.Dispose(); } return objNewsList; }
public void MakeActive(IStateNews news, IUsers user) { var objdbhelper = new DBHelper(); try { StateNewsDB.Instance.MakeActive(ref objdbhelper, news, user); } catch (Exception objExp) { throw objExp; } finally { objdbhelper.Dispose(); } }
public void Insert(ref DBHelper objdbhelper, IStateNews objNews, IImageDetail objImageDetail, IUsers user) { var objNewsDB = StateNewsDB.Instance; try { objNews.EditorID = "1"; objNews.DisplayOrder = 1; objNews.IsActive = 0; objNews.IsApproved = 0; objNews.LanguageID = 1; //objNews.StateCode = "BR"; objImageDetail.IsActive = 0; objImageDetail.IsFirst = 1; StateNewsDB.Instance.Insert(ref objdbhelper, objNews, objImageDetail, user); } catch (Exception objExp) { throw objExp; } finally { objdbhelper.Dispose(); objNewsDB.Dispose(); } }
public List<ITopNews> SelectTopNewsForActivate() { IDataReader objDataReader = null; List<ITopNews> objTopNewsList = null; ITopNews objTopNews = null; DBHelper dbHelper = new DBHelper(); try { objDataReader = dbHelper.ExecuteDataReader(ProcedureName.SelectAllTopNews, CommandType.StoredProcedure); if (objDataReader != null) { objTopNewsList = new List<ITopNews>(); do { while (objDataReader.Read()) { objTopNews = new TopNews(); if (!objDataReader.IsDBNull(0)) objTopNews.TopNewsID = objDataReader.GetString(0); if (!objDataReader.IsDBNull(1)) objTopNews.EditorID = objDataReader.GetString(1); if (!objDataReader.IsDBNull(2)) objTopNews.DisplayOrder = objDataReader.GetInt32(2); if (!objDataReader.IsDBNull(3)) objTopNews.Heading = objDataReader.GetString(3); if (!objDataReader.IsDBNull(4)) objTopNews.ShortDescription = objDataReader.GetString(4); if (!objDataReader.IsDBNull(5)) objTopNews.NewsDescription = objDataReader.GetString(5); if (!objDataReader.IsDBNull(6)) objTopNews.LanguageID = objDataReader.GetInt32(6); if (!objDataReader.IsDBNull(7)) objTopNews.IsApproved = objDataReader.GetInt32(7); if (!objDataReader.IsDBNull(8)) objTopNews.IsActive = objDataReader.GetInt32(8); if (!objDataReader.IsDBNull(9)) objTopNews.DttmCreated = objDataReader.GetDateTime(9); if (!objDataReader.IsDBNull(10)) objTopNews.DttmModified = objDataReader.GetDateTime(10); if (!objDataReader.IsDBNull(11)) objTopNews.ImageUrl = objDataReader.GetString(11); if (!objDataReader.IsDBNull(12)) objTopNews.ImageCaption = objDataReader.GetString(12); objTopNewsList.Add(objTopNews); } } while (objDataReader.NextResult()); } if (!objDataReader.IsClosed) objDataReader.Close(); } catch (Exception objExp) { throw objExp; } finally { dbHelper.ClearAllParameters(); dbHelper.CloseConnection(); dbHelper.Dispose(); } return objTopNewsList; }
public void UpdateNews(ref DBHelper dbHelper, IStateNews news, IImageDetail image, IUsers user) { try { news.EditorID = news.EditorID == null ? String.Empty : news.EditorID; StateNewsDB.Instance.Update(ref dbHelper, news, image, user); } catch (Exception ex) { throw ex; } }
public void Update( ref DBHelper dbInstance, IAdvertisment Advertisment) { try { AdvertismentDB.Instance.Update(ref dbInstance, Advertisment); } catch (Exception objExp) { throw objExp; } finally { } }