/// <summary> /// Операции над ролями /// </summary> /// <param name="mainContent">работа с базой</param> public RoleRepository(object dataContent) { if (dataContent is DataContent) { this.dataContent = (DataContent)dataContent; } }
public virtual void LoadData() { //m_tblInfo = s_config.getTable(m_tblName); m_tblInfo.LoadData(); #if manual_crt_dgv_columns m_dataGridView.AutoGenerateColumns = false; lConfigMng.CrtColumns(m_dataGridView, m_tblInfo); #endif m_dataContent = appConfig.s_contentProvider.CreateDataContent(m_tblInfo.m_tblName); #if !use_bg_work m_dataContent.FillTableCompleted += M_dataContent_FillTableCompleted; m_dataContent.UpdateTableCompleted += M_dataContent_FillTableCompleted; #endif #if !init_datatable_cols m_dataContent.Load(); #endif m_dataGridView.DataSource = m_dataContent.m_bindingSource; DataTable tbl = (DataTable)m_dataContent.m_bindingSource.DataSource; if (tbl != null) { update(); } else { Debug.Assert(false, "tbl not created!"); } #if use_bg_work m_wkr = myWorker.getWorker(); m_wkr.BgProcess += M_wkr_BgProcess; m_wkr.FgProcess += M_wkr_FgProcess; #endif }
public static ServiceResponse Import(string fileName, string auditLogin) { var sr = new ServiceResponse(); DataContent dataContent = new DataContent(); DataFile dataFile = new DataFile(); try { // Add a file to the database from disk dataContent.RawData = File.ReadAllBytes(fileName); dataFile.FileName = System.IO.Path.GetFileName(fileName); dataFile.Extension = System.IO.Path.GetExtension(fileName).ToUpper().Replace(".", ""); dataFile.SourceCode = "DSK"; dataFile.DataContent = dataContent; DB.DataFile.Add(dataFile); DB.SaveChanges(auditLogin); sr.ReturnValue = dataFile.DataFileId; sr.ReturnName = dataFile.FileName; } catch (Exception ex) { LogService.Error(EventCode.IMPORT, ex); sr.AddError("File not found."); } return(sr); }
/// <summary> /// Операции над бронированием комнатам /// </summary> /// <param name="mainContent">работа с базой</param> public OrderRoomRepository(object dataContent) { if (dataContent is DataContent) { this.dataContent = (DataContent)dataContent; } }
private void DownBtn_Click(object sender, EventArgs e) { DataContent orderResDC = appConfig.s_contentProvider.CreateDataContent(m_curOrderResTbl); DataTable orderResTbl = orderResDC.m_dataTable; for (int i = 0; i < m_resPanel.resDGV.SelectedRows.Count; i++) { DataGridViewRow row = m_resPanel.resDGV.SelectedRows[i]; var resId = row.Cells[1].Value.ToString(); if (!m_usedResDict.ContainsKey(resId)) { var resRowIdx = row.Index; var newRow = orderResTbl.NewRow(); newRow[1] = m_curOrder; newRow[2] = resId; newRow[3] = m_curTask; orderResTbl.Rows.Add(newRow); //udpate dict & gui m_usedResDict.Add(resId, resRowIdx); m_resPanel.MarkResRow(row.Index); if (m_curOrderStatus == OrderStatus.Approve) { m_resPanel.SetResStatus(resRowIdx, ResStatus.Busy); } } } //orderResDC.Submit(); Save(); }
/// <summary> /// Работа с статьями /// </summary> /// <param name="mainContent">работа с базой</param> public ArticleWorker(object dataContent) { if (dataContent is DataContent) { this.dataContent = (DataContent)dataContent; } }
public override IList Elements() { PropertyList propertyList = dataPrototype.Info().CreatePropertyList(); DataField[] keyFields = dataPrototype.Info().GetKeyFields(); if (keyFields.Length > 1) { throw new UnsupportedOperationException(); } for (int i = 0; i < keyFields.Length; i++) { propertyList.AddProperty(keyFields[i].GetFieldName()); } propertyList.AddProperty(dataPrototype.Info().GetTitleField().GetFieldName()); ICollection collection = GetAllDataCollection(propertyList); ArrayList list = new ArrayList(collection == null ? 0 : collection.Count); if (collection != null) { for (IEnumerator i = collection.GetEnumerator(); i.MoveNext();) { DataContent data = (DataContent)i.Current; list.Add( new Element( data.GetDataKey().KeyPartAt(0), data.GetProperty(dataPrototype.Info().GetTitleField().GetFieldName()).ToString() ) ); } } return(list); }
/// <summary> /// Работа с рубриками /// </summary> /// <param name="dataContent">работа с базой</param> public HeadingWorker(object dataontent) { if (dataontent is DataContent) { this.dataContent = (DataContent)dataontent; } }
private bool chkTaskDGV() { DataContent taskDC = appConfig.s_contentProvider.CreateDataContent("task"); bool bChk = taskDC.m_dataTable.Rows.Count > 0; return(bChk); }
private void Dispose(bool disposing) { if (dataContent != null) { dataContent.Dispose(); dataContent = null; } }
public void Save() { DataContent orderResDC = appConfig.s_contentProvider.CreateDataContent(m_curOrderResTbl); DataContent resDC = appConfig.s_contentProvider.CreateDataContent(m_curResTbl); orderResDC.Submit(); resDC.Submit(); }
public UpdateBuilder(TableInfo tblInfo) { m_tblInfo = tblInfo; m_dict = new Dictionary <string, TableInfo.ColInfo>(); foreach (TableInfo.ColInfo colInfo in m_tblInfo.m_cols) { m_dict.Add(colInfo.m_field, colInfo); } dc = appConfig.s_contentProvider.CreateDataContent(m_tblInfo.m_tblName); }
public Schema() : base() { InstanceType = typeof(__LaDisplaye__); ClassName = "DisplayedDataJson"; Properties.ClearExposed(); DataContent = Add <__TString__>("DataContent$"); DataContent.DefaultValue = ""; DataContent.Editable = true; DataContent.SetCustomAccessors((_p_) => { return(((__LaDisplaye__)_p_).__bf__DataContent__); }, (_p_, _v_) => { ((__LaDisplaye__)_p_).__bf__DataContent__ = (System.String)_v_; }, false); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, DataContent context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMvc(); //程序启动时调用数据库初始化类 api.Data.DbInitializer.Initializer(context); }
private void RemoveOrderResByIdx(List <int> idxLst) { DataContent orderResDC = appConfig.s_contentProvider.CreateDataContent(m_curOrderResTbl); //remove in datatable idxLst.Sort(); for (int i = idxLst.Count - 1; i >= 0; i--) { orderResDC.m_bindingSource.RemoveAt(idxLst[i]); } //orderResDC.Submit(); }
public static VMSchedule offerdetial(String OfferID) { DataContent db = new DataContent(); //回头给安装公司的详细做搜索实例化类 VMSchedule Result = new VMSchedule(); //实例化一个ScheduleDM var info = db.Offer.Where(x => x.OfferID.Equals(OfferID)).FirstOrDefault(); //这儿通过offerid获取投标表的用户id var infos = db.UserInfo.Where(x => x.UserID.Equals(info.UserID)).FirstOrDefault(); //这儿通过USerid到用户表中去读取安装公司信息 Result.CompanyName = infos.CompanyName; //获取安装公司信息并且赋值 Result.UserRealName = infos.UserRealName; //获取安装公司联系人并且赋值 Result.UserPhone = infos.UserPhone; //获取安装公司联系人电话并且赋值 return(Result); }
public void UpdateDTO(DataContent dc, String name, Object value) { Control textBox = (Control)comps[name]; try { dc.SetProperty(name, value); }catch (Exception exc) { SetControlText(textBox, ""); throw exc; } }
/// <summary> /// Write bytes to current DataClient /// </summary> /// <param name="data">data content to be written</param> private void WriteContent(DataContent data) { try { this.dataContainer.AddDataAndFlush(data); } catch (DataException e) { TraceHelper.TraceSource.TraceEvent(TraceEventType.Error, 0, "[DataClient] .WriteContent: receives exception {0}", e); e.DataClientId = this.id; throw; } }
public static DataContent GetDataContent(byte [] buffer) { var content = new DataContent { ResultCode = S7.GetWordAt(buffer, 0), PalletCode = S7.GetWordAt(buffer, 2), OperationCode = S7.GetWordAt(buffer, 4), MoldCode = S7.GetWordAt(buffer, 6), AlarmCode = S7.GetWordAt(buffer, 8), }; return(content); }
// received new message public void OnSockMgrReceive(object sender, SockMgrReceiveEventArgs e) { if (e.Handler != _sockMgr) { throw new Exception("this Responser is not serving the right SockMgr"); } DataContent dataContent = new DataContent(); dataContent.Data = e.Buffer; dataContent.SockMgr = _sockMgr; e.Handler.GetProtocolStack().FromLowLayerToHere(dataContent); }
public override String GetKeyRenderer(Object key) { try { PropertyList propertyList = dataPrototype.Info().CreatePropertyList(); propertyList.AddProperty(dataPrototype.Info().GetTitleField().GetFieldName()); DataContent data = GetData(propertyList, key); return(data == null ? "" : data.GetProperty(dataPrototype.Info().GetTitleField().GetFieldName()).ToString()); } catch (Exception e) { Console.WriteLine(e); } return(null); }
public SearchBuilder(TableInfo tblInfo, lContentProvider contentProvider = null) { m_tblInfo = tblInfo; m_dict = new Dictionary <string, TableInfo.ColInfo>(); foreach (TableInfo.ColInfo colInfo in m_tblInfo.m_cols) { m_dict.Add(colInfo.m_field, colInfo); } if (contentProvider != null) { dc = contentProvider.CreateDataContent(m_tblInfo.m_tblName); } else { dc = appConfig.s_contentProvider.CreateDataContent(m_tblInfo.m_tblName); } }
public void UpdateData(DataContent dc, String name, Object value) { Control textBox = (Control)comps[name]; try { dc.SetProperty(name, value); }catch (Exception exc) { if (textBox is TextBox) { textBox.Text = ""; textBox.Focus(); } throw exc; } }
public ListSelector() { // Cet appel est requis par le Concepteur de formulaires Windows.Forms. InitializeComponent(); LeftData = new DataContent[0]; RightData = new DataContent[0]; WFSUtils.FillDataGrid(leftGrid, LeftPropertyList, leftItems); WFSUtils.FillDataGrid(rightGrid, RightPropertyList, rightItems); moveAllLeftButtonEventHandler = new System.EventHandler(this.moveAllLeftButton_Click); moveAllLeftButton.Click += moveAllLeftButtonEventHandler; moveAllRightButtonEventHandler = new System.EventHandler(this.moveAllRightButton_Click); moveAllRightButton.Click += moveAllRightButtonEventHandler; moveLeftButtonEventHandler = new System.EventHandler(this.moveLeftButton_Click); moveLeftButton.Click += moveLeftButtonEventHandler; moveRightButtonEventHandler = new System.EventHandler(this.moveRightButton_Click); moveRightButton.Click += moveRightButtonEventHandler; // TODO : ajoutez les initialisations après l'appel à InitializeComponent }
public DataContent[] MovedRight() { ArrayList all = new ArrayList(); for (int i = 0; i < initialLeft.Length; i++) { DataContent left = initialLeft[i]; for (int j = 0; j < rightItems.Length; j++) { DataContent right = rightItems[j]; if (right == left) //reference comparaison { all.Add(right); break; } } } return((DataContent[])all.ToArray(itemType)); }
private void LReportDlg_Load(object sender, EventArgs e) { { //load data for building combo box BindingSource bs = new BindingSource(); DataContent dc = appConfig.s_contentProvider.CreateDataContent("building"); bs.DataSource = dc.m_dataTable; buildingCmb.DataSource = bs; buildingCmb.DisplayMember = dc.m_dataTable.Columns[1].ColumnName; } //load data for constr org cmb { BindingSource bs = new BindingSource(); DataContent dc = appConfig.s_contentProvider.CreateDataContent("constr_org"); bs.DataSource = dc.m_dataTable; constrorgCmb.DataSource = bs; constrorgCmb.DisplayMember = dc.m_dataTable.Columns[1].ColumnName; } }
public void UpdateData(DataContent dc, PropertyList includeList, PropertyList excludeList, PropertyList ignoreIfEmptyList) { ArrayList theList = includeList == null?new ArrayList(comps.Keys) : new ArrayList(includeList.KeySet()); foreach (String k in theList) { Control textBox = (Control)comps[k]; bool doExcludeThis = false; if (excludeList != null && excludeList.ContainsProperty(textBox.Name)) { doExcludeThis = true; } if (!doExcludeThis) { try { Object o = GetFieldValue(k); if (!doExcludeThis && o == null) { if (ignoreIfEmptyList != null && ignoreIfEmptyList.ContainsProperty(textBox.Name)) { doExcludeThis = true; } } if (!doExcludeThis) { dc.SetProperty(k, o); } }catch (Exception exc) { if (textBox is TextBox) { textBox.Text = ""; textBox.Focus(); } throw exc; } } } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseSession(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Login}/{action=Index}/{id?}"); }); DataContent.InitDb(app.ApplicationServices); }
/// <summary> /// This method add CMS content to database /// </summary> /// <param name="requestParam">Input Parem containing inputs for cms</param> /// <returns>true if new added successfully , else return false</returns> public bool CreateCmsContent(string requestParam) { bool RetVal = false; bool IsCmsContentAddedToDb = false; DataContent ObjDataCont = new DataContent(); string MenuCategory = string.Empty; try { // create news object, to be inserted in database ObjDataCont = this.CreateCMSDataContent(requestParam); if (ObjDataCont != null) { // call method to add news to database IsCmsContentAddedToDb = this.AddCMSContentToDB(ObjDataCont); // check if content added to database successfully, set return value to true if (IsCmsContentAddedToDb) { RetVal = true; } else { RetVal = false; } } else { RetVal = false; } } catch (Exception Ex) { RetVal = false; Global.CreateExceptionString(Ex, null); } return RetVal; }
private void UpBtn_Click(object sender, EventArgs e) { DataContent orderResDC = appConfig.s_contentProvider.CreateDataContent(m_curOrderResTbl); DataTable orderResTbl = orderResDC.m_dataTable; List <int> idxLst = new List <int>(); for (int i = 0; i < orderResDGV.SelectedRows.Count; i++) { DataGridViewRow row = orderResDGV.SelectedRows[i]; var resId = GetResId(row); //udpate dict & gui int resRowIndex = m_usedResDict[resId]; m_usedResDict.Remove(resId); if (resRowIndex == -1) { //search res Debug.Assert(m_resPanel.m_addedSrchCnd > 0); if (m_curOrderStatus == OrderStatus.Approve) { //update res status by exec sql qry m_resPanel.SetResStatus(resId, ResStatus.Free); } } else { m_resPanel.UnmarkResRow(resRowIndex); if (m_curOrderStatus == OrderStatus.Approve) { m_resPanel.SetResStatus(resRowIndex, ResStatus.Free); } } idxLst.Add(row.Index); } RemoveOrderResByIdx(idxLst); Save(); }
public void UpdateUI(DataContent dc, PropertyList includeList, PropertyList excludeList, PropertyList ignoreIfEmptyList) { ArrayList theList = includeList == null?new ArrayList(comps.Keys) : new ArrayList(includeList.KeySet()); foreach (String k in theList) { Control textBox = (Control)comps[k]; bool doExcludeThis = false; if (excludeList != null && excludeList.ContainsProperty(textBox.ID)) { doExcludeThis = true; } if (!doExcludeThis) { try { if (!doExcludeThis) { if (ignoreIfEmptyList != null && ignoreIfEmptyList.ContainsProperty(textBox.ID)) { doExcludeThis = true; } } if (!doExcludeThis) { SetFieldValue(k, dc.GetProperty(k)); } } catch (Exception exc) { SetControlText(textBox, ""); throw exc; } } } }
private void ShowArticleByUrl(string CallingPageUrl, bool IsHiddenArticlesVisible) { try { ArticlesGenerator GenerateArticle = new ArticlesGenerator(); string RetContentHtml = string.Empty; DataContent ObjDataContent = new DataContent(); // Call method to get data content based on url ObjDataContent = GenerateArticle.GetDataContentFromDatabaseByUrl(CallingPageUrl, IsHiddenArticlesVisible); if (ObjDataContent != null) { RetContentHtml = GenerateArticle.GetHtmlByMenuCategory(ObjDataContent); // Call method to get Html of inner content page try { // set meta tag values if (!string.IsNullOrEmpty(ObjDataContent.Summary)) { Page.MetaDescription = ObjDataContent.Summary; //Summary } if (!string.IsNullOrEmpty(ObjDataContent.Title)) { Page.MetaDescription = CreateKyWordsFromTitle(ObjDataContent.Title); ATitle = ObjDataContent.Title; } SpanMenuCategoryHeading.InnerText = ObjDataContent.Title; SpanMenuCategoryHeading.Style.Add("Font-Size", "18px"); SpanHeaderDescription.InnerHtml = ObjDataContent.Date.ToString(); SpanHeaderDescription.Style.Add("Font-Style", "italic"); if (!string.IsNullOrEmpty(ObjDataContent.PDFUpload)) { ArticlePdf.HRef = ObjDataContent.PDFUpload; } else { ArticlePdf.HRef = "javascript:void(0);"; } // Set selected page name SelectedPageName = GenerateArticle.GetPageNameFromDbByMenuCategory(ObjDataContent.MenuCategory); SharingTitle = ConvertToAscii(ObjDataContent.Title.Replace("'", "\\'").Replace(@"""", @"\""")); SharingSummary = ConvertToAscii(ObjDataContent.Summary.Replace("'", "\\'").Replace(@"""", @"\""")); SharingImageUrl = ObjDataContent.Thumbnail; } catch (Exception Ex) { Global.CreateExceptionString(Ex, null); } MenuCategory = ObjDataContent.MenuCategory.ToLower(); } // Check if Return Html is not empty if (!string.IsNullOrEmpty(RetContentHtml)) { //set Html to content page divContent.InnerHtml = RetContentHtml; SetDeleteLinkUrl(ObjDataContent.ContentId); SetHideAndEditButtonVisiblity(true); } } catch (Exception Ex) { Global.CreateExceptionString(Ex, null); } }
// Create new content page andd add link on main html page private bool AddCMSContentToDB(DataContent CMSDataContent) { bool RetVal = false; string ConnectionMessage = string.Empty; List<System.Data.Common.DbParameter> DbParams = new List<System.Data.Common.DbParameter>(); DIConnection ObjDIConnection = null; int DtAddCmsCont = -1; try { CMSHelper ObjCMSHelper = new CMSHelper(); // call method to get connection object ObjDIConnection = ObjCMSHelper.GetConnectionObject(out ConnectionMessage); // create database parameters System.Data.Common.DbParameter Param1 = ObjDIConnection.CreateDBParameter(); Param1.ParameterName = "@MenuCategory"; Param1.DbType = DbType.String; Param1.Value = CMSDataContent.MenuCategory; DbParams.Add(Param1); System.Data.Common.DbParameter Param2 = ObjDIConnection.CreateDBParameter(); Param2.ParameterName = "@Title"; Param2.DbType = DbType.String; Param2.Value = CMSDataContent.Title; DbParams.Add(Param2); System.Data.Common.DbParameter Param3 = ObjDIConnection.CreateDBParameter(); Param3.ParameterName = "@Date"; Param3.DbType = DbType.DateTime; Param3.Value = CMSDataContent.Date; DbParams.Add(Param3); System.Data.Common.DbParameter Param4 = ObjDIConnection.CreateDBParameter(); Param4.ParameterName = "@Thumbnail"; Param4.DbType = DbType.String; Param4.Value = CMSDataContent.Thumbnail; DbParams.Add(Param4); System.Data.Common.DbParameter Param5 = ObjDIConnection.CreateDBParameter(); Param5.ParameterName = "@Summary"; Param5.DbType = DbType.String; Param5.Value = CMSDataContent.Summary; DbParams.Add(Param5); System.Data.Common.DbParameter Param6 = ObjDIConnection.CreateDBParameter(); Param6.ParameterName = "@Description"; Param6.DbType = DbType.String; Param6.Value = CMSDataContent.Description; DbParams.Add(Param6); System.Data.Common.DbParameter Param7 = ObjDIConnection.CreateDBParameter(); Param7.ParameterName = "@PDFUpload"; Param7.DbType = DbType.String; Param7.Value = CMSDataContent.PDFUpload; DbParams.Add(Param7); System.Data.Common.DbParameter Param8 = ObjDIConnection.CreateDBParameter(); Param8.ParameterName = "@DateAdded"; Param8.DbType = DbType.DateTime; Param8.Value = CMSDataContent.DateAdded; DbParams.Add(Param8); System.Data.Common.DbParameter Param9 = ObjDIConnection.CreateDBParameter(); Param9.ParameterName = "@DateModified"; Param9.DbType = DbType.DateTime; Param9.Value = CMSDataContent.DateModified; DbParams.Add(Param9); System.Data.Common.DbParameter Param10 = ObjDIConnection.CreateDBParameter(); Param10.ParameterName = "@Archived"; Param10.DbType = DbType.Boolean; Param10.Value = CMSDataContent.Archived; DbParams.Add(Param10); System.Data.Common.DbParameter Param11 = ObjDIConnection.CreateDBParameter(); Param11.ParameterName = "@ArticleTagId"; Param11.DbType = DbType.Int32; Param11.Value = CMSDataContent.ArticleTagID; DbParams.Add(Param11); System.Data.Common.DbParameter Param12 = ObjDIConnection.CreateDBParameter(); Param12.ParameterName = "@UserNameEmail"; Param12.DbType = DbType.String; Param12.Value = CMSDataContent.UserNameEmail; DbParams.Add(Param12); System.Data.Common.DbParameter Param14 = ObjDIConnection.CreateDBParameter(); Param14.ParameterName = "@URL"; Param14.DbType = DbType.String; Param14.Value = CMSDataContent.URL; DbParams.Add(Param14); System.Data.Common.DbParameter Param15 = ObjDIConnection.CreateDBParameter(); Param15.ParameterName = "@LngCode"; Param15.DbType = DbType.String; Param15.Value = CMSDataContent.LngCode; DbParams.Add(Param15); System.Data.Common.DbParameter Param16 = ObjDIConnection.CreateDBParameter(); Param16.ParameterName = "@IsDeleted"; Param16.DbType = DbType.Boolean; Param16.Value =CMSDataContent.IsDeleted; DbParams.Add(Param16); System.Data.Common.DbParameter Param17 = ObjDIConnection.CreateDBParameter(); Param17.ParameterName = "@IsHidden"; Param17.DbType = DbType.Boolean; Param17.Value = CMSDataContent.IsHidden; DbParams.Add(Param17); System.Data.Common.DbParameter Param18 = ObjDIConnection.CreateDBParameter(); Param18.ParameterName = "@Fld1"; Param18.DbType = DbType.String; Param18.Value = ""; DbParams.Add(Param18); System.Data.Common.DbParameter Param19 = ObjDIConnection.CreateDBParameter(); Param19.ParameterName = "@Fld2"; Param19.DbType = DbType.String; Param19.Value = ""; DbParams.Add(Param19); System.Data.Common.DbParameter Param20 = ObjDIConnection.CreateDBParameter(); Param20.ParameterName = "@Fld3"; Param20.DbType = DbType.String; Param20.Value = ""; DbParams.Add(Param20); System.Data.Common.DbParameter Param21 = ObjDIConnection.CreateDBParameter(); Param21.ParameterName = "@Fld4"; Param21.DbType = DbType.String; Param21.Value = ""; DbParams.Add(Param21); System.Data.Common.DbParameter Param22 = ObjDIConnection.CreateDBParameter(); Param22.ParameterName = "@Fld5"; Param22.DbType = DbType.String; Param22.Value = ""; DbParams.Add(Param22); System.Data.Common.DbParameter Param23 = ObjDIConnection.CreateDBParameter(); Param23.ParameterName = "@Fld6"; Param23.DbType = DbType.String; Param23.Value = ""; DbParams.Add(Param23); System.Data.Common.DbParameter Param24 = ObjDIConnection.CreateDBParameter(); Param24.ParameterName = "@Fld1Text"; Param24.DbType = DbType.String; Param24.Value = ""; DbParams.Add(Param24); System.Data.Common.DbParameter Param25 = ObjDIConnection.CreateDBParameter(); Param25.ParameterName = "@Fld2Text"; Param25.DbType = DbType.String; Param25.Value = ""; DbParams.Add(Param25); System.Data.Common.DbParameter Param26 = ObjDIConnection.CreateDBParameter(); Param26.ParameterName = "@Fld3Text"; Param26.DbType = DbType.String; Param26.Value = ""; DbParams.Add(Param26); System.Data.Common.DbParameter Param27= ObjDIConnection.CreateDBParameter(); Param27.ParameterName = "@Fld4Text"; Param27.DbType = DbType.String; Param27.Value = ""; DbParams.Add(Param27); System.Data.Common.DbParameter Param28 = ObjDIConnection.CreateDBParameter(); Param28.ParameterName = "@Fld5Text"; Param28.DbType = DbType.String; Param28.Value = ""; DbParams.Add(Param28); System.Data.Common.DbParameter Param29 = ObjDIConnection.CreateDBParameter(); Param29.ParameterName = "@Fld6Text"; Param29.DbType = DbType.String; Param29.Value = ""; DbParams.Add(Param29); // Execute stored procedure to Insert CMS Content In Database DtAddCmsCont = ObjDIConnection.ExecuteNonQuery("sp_AddCMSContent", CommandType.StoredProcedure, DbParams); //To check if records inserted in database,check if count of no of rows effected is greater than 0 if (DtAddCmsCont > 0) { RetVal = true; } // return false else { RetVal = false; } } catch (Exception Ex) { RetVal = false; Global.CreateExceptionString(Ex, null); } return RetVal; }
//Create Datacontent Object from Input Params private DataContent CreateCMSDataContent(string requestParam) { CMSHelper ObjCMSHelper = new CMSHelper(); DataContent RetValContent = null; string PdfFileUrl = string.Empty; string ContentSummary = string.Empty; string ContentTitle = string.Empty; string ContentDate = string.Empty; string ContentImgUrl = string.Empty; string ContentPageUrl = string.Empty; string UserEmailID = string.Empty; string DatabaseLanguage = string.Empty; string UserName = string.Empty; string CurrentDbLangCode = string.Empty; string CountentUrl = string.Empty; string ArticleTags = string.Empty; string MenuCategory = string.Empty; string ContentDescription = string.Empty; string ContentTag = string.Empty; int ContentTagNid = -1; SqlDateTime SqlDtTime = new SqlDateTime(); string[] Params; try { // split Input Params Params = Global.SplitString(requestParam, Constants.Delimiters.ParamDelimiter); // Check if session is having nid for loggedin Admin if (!string.IsNullOrEmpty(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUserNId].ToString())) {// get user email UserEmailID = Global.Get_User_EmailId_ByAdaptationURL(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUserNId].ToString()); } // Check if session is having username for loggedin Admin if (!string.IsNullOrEmpty(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUser].ToString())) { // get user name from session UserName = HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUser].ToString(); } // Initlize RetValContent Object RetValContent = new DataContent(); ContentTitle = Params[0].ToString(); ContentDate = Params[1].ToString(); ContentSummary = Params[2].ToString(); ContentSummary = ContentSummary.Replace("\n", "<br/>"); ContentDescription = Params[3].ToString().Replace("diorg/images", "../libraries/aspx/diorg/images"); PdfFileUrl = Params[4].ToString().Replace("diorg/", "../libraries/aspx/diorg/"); MenuCategory = Params[5].ToString(); ContentImgUrl = Params[6].ToString().Trim().Replace("diorg/","../libraries/aspx/diorg/"); if (Params.Length > 7) { ContentTag = Params[7].ToString().Trim(); } UserEmailID = UserName + " [" + UserEmailID + " ]"; // Create Countent Url From Title CountentUrl = ObjCMSHelper.CreateUrlFromInputString(ContentTitle); // Getb current database language CurrentDbLangCode = Global.GetDefaultLanguageCode(); //Get Tag Nid if (!string.IsNullOrEmpty(ContentTag)) { ContentTagNid = ObjCMSHelper.CreateAndGetTagNid(ContentTag.Trim()); } if(string.IsNullOrEmpty(ContentDate) && MenuCategory.ToLower()!=EnumHelper.PageName.News.ToString().ToLower()) { SqlDtTime=DateTime.Now.AddYears(-100); } else { //Convert Date to sql date time SqlDtTime = ObjCMSHelper.GetSqlDataTimeFromInptDate(ContentDate); } // innitlize of members of class Content RetValContent.MenuCategory = MenuCategory; RetValContent.Date = SqlDtTime; RetValContent.DateAdded = new SqlDateTime(DateTime.Now); RetValContent.DateModified = new SqlDateTime(DateTime.Now); RetValContent.Description = ContentDescription; RetValContent.Title = ContentTitle; RetValContent.PDFUpload = PdfFileUrl; RetValContent.Summary = ContentSummary; RetValContent.Thumbnail = ContentImgUrl; RetValContent.URL = CountentUrl; RetValContent.Archived = false; // Username email filed is combination of username and email RetValContent.UserNameEmail = UserName + " " + UserEmailID; RetValContent.LngCode = CurrentDbLangCode; RetValContent.ArticleTagID = ContentTagNid; RetValContent.IsDeleted = false; RetValContent.IsHidden = false; //Extra fields to be used in future RetValContent.Fld1 = string.Empty; RetValContent.Fld2 = string.Empty; RetValContent.Fld3 = string.Empty; RetValContent.Fld4 = string.Empty; RetValContent.Fld5 = string.Empty; RetValContent.Fld6 = string.Empty; RetValContent.Fld1Text = string.Empty; RetValContent.Fld2Text = string.Empty; RetValContent.Fld3Text = string.Empty; RetValContent.Fld4Text = string.Empty; RetValContent.Fld5Text = string.Empty; RetValContent.Fld6Text = string.Empty; } catch (Exception Ex) { RetValContent = null; Global.CreateExceptionString(Ex, null); } // return news object return RetValContent; }
public string GetArticleByContentIdForSharing(string CallingPageUrl) { string RetVal = string.Empty; try { ArticlesGenerator GenerateArticle = new ArticlesGenerator(); DataContent ObjDataContent = new DataContent(); // Call method to get data content based on url ObjDataContent = GenerateArticle.GetDataContentFromDatabaseByUrl(CallingPageUrl, false); if (ObjDataContent != null) { RetVal = GenerateArticle.GetHtmlByMenuCategory(ObjDataContent).Replace("\"../","\"../../../"); } RetVal = RetVal + Constants.Delimiters.ParamDelimiter + ObjDataContent.Title + Constants.Delimiters.ParamDelimiter + ObjDataContent.Date; } catch (Exception Ex) { RetVal = string.Empty; Global.CreateExceptionString(Ex, null); } return RetVal; }
private void SetEditableHtmlContent(string CallingPageUrl, bool IsHiddenArticlesVisible) { ArticlesGenerator GenerateArticle = null; RetDataContent = new DataContent(); List<string> RetTags = new List<string>(); string Summary = string.Empty; try { GenerateArticle = new ArticlesGenerator(); RetDataContent = GenerateArticle.GetDataContentFromDatabaseByUrl(CallingPageUrl, IsHiddenArticlesVisible); if (RetDataContent != null) { Summary = RetDataContent.Summary.Replace("<br/>", "\n"); SelectedMenuCat = RetDataContent.MenuCategory; HdnContentId.Value = RetDataContent.ContentId.ToString(); txtSummary.Value = Summary.ToString(); txtTitle.Value = RetDataContent.Title.ToString(); DetaildContent = RetDataContent.Description.ToString(); DetaildContent = DetaildContent.Replace("{", "{{").Replace("}", "}}"); DetaildContent = DetaildContent.Replace("\r\n", "").Replace("\n", "").Replace("\r", ""); DetaildContent = DetaildContent.Replace("../libraries/aspx/diorg/", "diorg/"); ////changes in script tag for ckeditor DetaildContent = DetaildContent.Replace("<script", "<scrpt"); DetaildContent = DetaildContent.Replace("</script", "</scrpt"); DetaildContent = DetaildContent.Replace(@"\", "\\"); DetaildContent = ConvertToAscii(DetaildContent); // DetaildContent = Regex.Replace(DetaildContent, @"[^\u0000-\u007F]", string.Empty); if (RetDataContent.Date.Value.Year != 1900) { EditDatetime = RetDataContent.Date.ToString(); } ThumbNailImageSrc = RetDataContent.Thumbnail.ToString(); ThumbNailImageSrc = ThumbNailImageSrc.Replace("../libraries/aspx/diorg/", "diorg/"); PdfSrc = RetDataContent.PDFUpload.ToString(); PdfSrc = PdfSrc.Replace("../libraries/aspx/diorg/", "diorg/"); txtTags.Value = GenerateArticle.GetTagsFromDatabaseByTagId(Convert.ToInt32(RetDataContent.ArticleTagID.ToString())); TagID = RetDataContent.ArticleTagID; // set selected page name SelectedPageName = GenerateArticle.GetPageNameFromDbByMenuCategory(RetDataContent.MenuCategory); } } catch (Exception ex) { Global.CreateExceptionString(ex, null); } }
public bool EditArticleByArticleId(string requestParam,out string OutCurrentPageNo,out string OutCurrentMenuCategory,out string OutCurrentTagNids) { bool RetVal = false; string[] Params; CMSHelper Helper = new CMSHelper(); string ContentSummary = string.Empty; string ContentTitle = string.Empty; string ContentDate = string.Empty; string ContentImgUrl = string.Empty; string UserEmailID = string.Empty; string DatabaseLanguage = string.Empty; string UserName = string.Empty; string CurrentDbLangCode = string.Empty; string ArticleTags = string.Empty; string MenuCategory = string.Empty; string ContentDescription = string.Empty; string ContentTag = string.Empty; DataContent RetValContent = null; int ContentId = 0; int ContentTagNid = 0; int ExistingTagNid = 0; string ContentPdfFileUrl = string.Empty; CMSHelper ObjCMSHelper = null; SqlDateTime SqlDtTime; bool IsContentUpdated = false; try { SqlDtTime = new SqlDateTime(); ObjCMSHelper = new CMSHelper(); // Check if session is having nid for loggedin Admin if (!string.IsNullOrEmpty(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUserNId].ToString())) {// get user email UserEmailID = Global.Get_User_EmailId_ByAdaptationURL(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUserNId].ToString()); } // Check if session is having username for loggedin Admin if (!string.IsNullOrEmpty(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUser].ToString())) { // get user name from session UserName = HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUser].ToString(); } // split Input Params Params = Global.SplitString(requestParam, Constants.Delimiters.ParamDelimiter); // Initlize RetValContent Object RetValContent = new DataContent(); ContentId = Convert.ToInt32(Params[0].ToString()); ContentTitle = Params[1].ToString(); ContentDate = Params[2].ToString(); ContentSummary = Params[3].ToString(); ContentSummary=ContentSummary.Replace("\n","<br/>"); ContentDescription = Params[4].ToString().Trim().Replace("diorg/images", "../libraries/aspx/diorg/images"); //remove changes in script tag for ckeditor ContentDescription = ContentDescription.Replace("<scrpt", "<script"); ContentDescription = ContentDescription.Replace("</scrpt", "</script"); ContentPdfFileUrl = Params[5].ToString().Replace("diorg/", "../libraries/aspx/diorg/"); ; MenuCategory = Params[6].ToString(); ContentImgUrl = Params[7].ToString().Trim().Replace( "diorg/","../libraries/aspx/diorg/"); if (Params.Length > 8) { ContentTag = Params[8].ToString().Trim(); } OutCurrentMenuCategory = MenuCategory; OutCurrentPageNo = Params[10].ToString().Trim(); if (Params.Length > 11) { OutCurrentTagNids = Params[11].ToString().Trim(); } else { OutCurrentTagNids = string.Empty; } ExistingTagNid = Convert.ToInt32(Params[9].ToString().Trim()); // Check if existing tagid exists if (ExistingTagNid > 0) { // Delete existing Tag from mapping table DeleteTagsMappingsByTagId(ExistingTagNid); } UserEmailID = UserName + " [" + UserEmailID + " ]"; //// Create Countent Url From Title //CountentUrl = ObjCMSHelper.CreateUrlFromInputString(ContentTitle); // Getb current database language CurrentDbLangCode = Global.GetDefaultLanguageCode(); //Get Tag Nid-- add new tags to database and get nid if (!string.IsNullOrEmpty(ContentTag)) { ContentTagNid = ObjCMSHelper.CreateAndGetTagNid(ContentTag); } //Convert Date to sql date time SqlDtTime = ObjCMSHelper.ConvertDataTimeToSQLDateTime(ContentDate); // innitlize of members of class Content RetValContent.ContentId = ContentId; RetValContent.MenuCategory = MenuCategory; RetValContent.Date = SqlDtTime; RetValContent.DateAdded = new SqlDateTime(DateTime.Now); RetValContent.DateModified = new SqlDateTime(DateTime.Now); RetValContent.Description = ContentDescription; RetValContent.Title = ContentTitle; RetValContent.PDFUpload = ContentPdfFileUrl; RetValContent.Summary = ContentSummary; RetValContent.Thumbnail = ContentImgUrl; RetValContent.Archived = false; // Username email filed is combination of username and email RetValContent.UserNameEmail = UserName + " " + UserEmailID; RetValContent.LngCode = CurrentDbLangCode; RetValContent.ArticleTagID = ContentTagNid; IsContentUpdated= this.UpdateCMSContent(RetValContent); if (IsContentUpdated) { RetVal = true; // set session varibles to maintain page no } } catch (Exception Ex) { OutCurrentMenuCategory = string.Empty; OutCurrentPageNo = string.Empty; OutCurrentTagNids = string.Empty; RetVal = false; Global.CreateExceptionString(Ex, null); } finally { RetValContent = null; } return RetVal; }
// Read Action page html Content public List<DataContent> ReadActionHtmlContent() { List<DataContent> ListDC = new List<DataContent>(); SqlDateTime SqlDtTime = new SqlDateTime(); CMSHelper ObjCMSHelper = null; try { string PdfFileUrl = string.Empty; string RetPageContent = string.Empty; string ContentFileFullPath = string.Empty; string HtmlPageFullPath = string.Empty; string HtmlPageName = string.Empty; HtmlDocument document = null; string ContentSummary = string.Empty; string ContentTitle = string.Empty; string ContentDate = string.Empty; string ImgUrl = string.Empty; string ContentPageUrl = string.Empty; string UserEmailID = string.Empty; string DatabaseLanguage = string.Empty; string UserName = string.Empty; string CurrentDbLangCode = string.Empty; string CountentUrl = string.Empty; string ArticleTags = string.Empty; //get name of news html page HtmlPageName = this.ActionHtmlFilenamePrefix + ".html"; document = new HtmlDocument(); // create html page full path HtmlPageFullPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.DiorgContent, HtmlPageName); if (!File.Exists(HtmlPageFullPath)) { return ListDC; } // load html page document.Load(HtmlPageFullPath); // Targets a specific node(since all the page contains parent table tag with width 700) HtmlNode content_wrapper = document.DocumentNode.SelectNodes("//table[@width='700']").FirstOrDefault(); // get html news collection HtmlNodeCollection search_results = content_wrapper.SelectNodes("//td[@class='news_space']"); //itterate through loop foreach (HtmlNode result in search_results) { DataContent Content = new DataContent(); // get title of news if (result.SelectNodes(".//p//span[@class='header']") != null && !string.IsNullOrEmpty(result.SelectNodes(".//p//span[@class='header']").FirstOrDefault().InnerText)) { ContentTitle = result.SelectNodes(".//p//span[@class='header']").FirstOrDefault().InnerText.Trim(); } else if (result.SelectNodes(".//span//strong//a") != null && !string.IsNullOrEmpty(result.SelectNodes(".//span//strong//a").FirstOrDefault().InnerText)) { ContentTitle = result.SelectNodes(".//span//strong//a").FirstOrDefault().InnerText.Trim(); } else if (result.SelectNodes(".//p//a//strong") != null && !string.IsNullOrEmpty(result.SelectNodes(".//p//a//strong").FirstOrDefault().InnerText.Trim())) { ContentTitle = result.SelectNodes(".//p//a//strong").FirstOrDefault().InnerText.Trim(); } else if (result.SelectNodes(".//p//strong//a") != null && !string.IsNullOrEmpty(result.SelectNodes(".//p//strong//a").FirstOrDefault().InnerText.Trim())) { ContentTitle = result.SelectNodes(".//p//strong//a").FirstOrDefault().InnerText.Trim(); } else if (result.SelectNodes(".//p//a") != null && !string.IsNullOrEmpty(result.SelectNodes(".//p//a").FirstOrDefault().InnerText)) { ContentTitle = result.SelectNodes(".//p//a").FirstOrDefault().InnerText.Trim(); } else if (result.SelectNodes(".//p//strong") != null && !string.IsNullOrEmpty(result.SelectNodes(".//p//strong").FirstOrDefault().InnerText)) { ContentTitle = result.SelectNodes(".//p//strong").FirstOrDefault().InnerText.Trim(); } // get summary of news if (result.SelectNodes(".//td[@width='71%']//tr/td") != null) { ContentSummary = result.SelectNodes(".//td[@width='71%']//tr/td").ElementAt(1).InnerText.Trim().ToString(); } // get date created of news if (result.SelectSingleNode(".//span[@class='adaptation_italic']") != null) { ContentDate = result.SelectSingleNode(".//span[@class='adaptation_italic']").InnerText.Replace("(", "").Replace(")", "").Trim(); } // get Thumbnail url of news if (result.SelectNodes(".//img[@class='reflect ropacity30']") != null) { ImgUrl = result.SelectNodes(".//img[@class='reflect ropacity30']").FirstOrDefault().GetAttributeValue("src", "").ToString(); } else if (result.SelectNodes(".//td//a//img[@width='140']") != null) { ImgUrl = result.SelectNodes(".//td//a//img[@width='140']").FirstOrDefault().GetAttributeValue("src", "").ToString(); } else if (result.SelectNodes(".//img[@class='reflect ropacity30 ']") != null) { ImgUrl = result.SelectNodes(".//img[@class='reflect ropacity30 ']").FirstOrDefault().GetAttributeValue("src", "").ToString(); } if (ImgUrl.Contains("diorg/")) { ImgUrl = ImgUrl.Replace("diorg/", "../libraries/aspx/diorg/"); } // get content page of url if (result.SelectNodes(".//td[@width='29%']//a") != null) { ContentPageUrl = result.SelectNodes(".//td[@width='29%']//a").FirstOrDefault().GetAttributeValue("href", "").ToString(); } else if (result.SelectNodes(".//td[@width='29%']//tr/td//a") != null) { ContentPageUrl = result.SelectNodes(".//td[@width='29%']//tr/td//a").FirstOrDefault().GetAttributeValue("href", "").ToString(); } else if (result.SelectNodes(".//td[@width='28%']//a") != null) { ContentPageUrl = result.SelectNodes(".//td[@width='28%']//a").FirstOrDefault().GetAttributeValue("href", "").ToString(); } //get content of inner html page if (ContentPageUrl.Contains("diorg/")) { // create full path of inner html page ContentFileFullPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.DiorgContent, Global.SplitString(ContentPageUrl, "diorg/")[1].ToString().Replace(@"/", "\\")); // check if file exist if (File.Exists(ContentFileFullPath)) { // call method to get content of html page //get pdfurl as out parameter RetPageContent = GetInnerContentNPdfUrl(ContentFileFullPath, out PdfFileUrl); } } // Initlize object of class cmshelper ObjCMSHelper = new CMSHelper(); // remove space and ;nbsp from date ContentDate = ObjCMSHelper.RemoveExtraCharsFromDate(ContentDate); // get created date of news SqlDtTime = new SqlDateTime(ObjCMSHelper.GetSqlDataTimeFromInptDate(ContentDate)); // get user email id from session if (!string.IsNullOrEmpty(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUserNId].ToString())) { UserEmailID = Global.Get_User_EmailId_ByAdaptationURL(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUserNId].ToString()); } // get user name from session if (!string.IsNullOrEmpty(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUser].ToString())) { UserName = HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUser].ToString(); } // Create url from title CountentUrl = ObjCMSHelper.CreateUrlFromInputString(ContentTitle); //Get language of current database CurrentDbLangCode = Global.GetDefaultLanguageCode(); // innitlize of members of class Content Content.MenuCategory = "Action"; Content.Date = SqlDtTime; Content.DateAdded = new SqlDateTime(DateTime.Now); Content.DateModified = new SqlDateTime(DateTime.Now); Content.Description = RetPageContent; Content.Title = ContentTitle; Content.PDFUpload = PdfFileUrl; Content.Summary = ContentSummary; Content.Thumbnail = ImgUrl; Content.URL = CountentUrl; Content.Archived = false; Content.UserNameEmail = UserName + " " + UserEmailID; Content.LngCode = CurrentDbLangCode; Content.ArticleTagID = -1; Content.IsDeleted = false; Content.IsDeleted = false; // all class Content to list ListDC.Add(Content); } } catch (Exception Ex) { Global.CreateExceptionString(Ex, null); } // return list containing all html pages return ListDC; }
// Read facts page html content public List<DataContent> ReadFactsHtmlContent() { List<DataContent> ListDC = new List<DataContent>(); string PdfFileUrl = string.Empty; string RetPageContent = string.Empty; string NewsContentFullPath = string.Empty; string HtmlPageFullPath = string.Empty; string HtmlPageName = string.Empty; HtmlDocument document = null; string NewsSummary = string.Empty; string NewsTitle = string.Empty; string NewsContentDate = string.Empty; string ImgUrl = string.Empty; string ContentPageUrl = string.Empty; string UserEmailID = string.Empty; string DatabaseLanguage = string.Empty; string UserName = string.Empty; string CurrentDbLangCode = string.Empty; string NewsUrl = string.Empty; string ArticleTags = string.Empty; SqlDateTime SqlDtTime; // Initlize object of class cmshelper CMSHelper ObjCMSHelper = null; try { //get name of news html page HtmlPageName = this.FactsHtmlFilenamePrefix + ".html"; document = new HtmlDocument(); // create html page full path HtmlPageFullPath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.DiorgContent, HtmlPageName); if (!File.Exists(HtmlPageFullPath)) { return ListDC; } // load html page document.Load(HtmlPageFullPath); // Targets a specific node(since all the page contains parent table tag with width 700) HtmlNode content_wrapper = document.DocumentNode.SelectNodes("//table[@width='700']//tr//td[@height='450']").FirstOrDefault(); // get html news collection if (content_wrapper.SelectNodes("//table[@width='700']//tr//td") != null) { HtmlNodeCollection SplitString = content_wrapper.SelectNodes("//div[@class='goal']"); foreach (HtmlNode HtmlNodResult in SplitString) { //HtmlNodResult.se DataContent Content = new DataContent(); // Initlize object of class cmshelper ObjCMSHelper = new CMSHelper(); // remove space and ;nbsp from date NewsContentDate = ObjCMSHelper.RemoveExtraCharsFromDate(NewsContentDate); // get created date of news SqlDtTime = new SqlDateTime(ObjCMSHelper.GetSqlDataTimeFromInptDate(NewsContentDate)); // get user email id from session if (!string.IsNullOrEmpty(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUserNId].ToString())) { UserEmailID = Global.Get_User_EmailId_ByAdaptationURL(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUserNId].ToString()); } // get user name from session if (!string.IsNullOrEmpty(HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUser].ToString())) { UserName = HttpContext.Current.Session[Constants.SessionNames.LoggedAdminUser].ToString(); } // Create url from title NewsUrl = ObjCMSHelper.CreateUrlFromInputString(NewsTitle); //Get language of current database CurrentDbLangCode = Global.GetDefaultLanguageCode(); // innitlize of members of class Content Content.Date = SqlDtTime; Content.DateAdded = new SqlDateTime(DateTime.Now); Content.DateModified = new SqlDateTime(DateTime.Now); Content.Description = RetPageContent; Content.Title = NewsTitle; Content.PDFUpload = PdfFileUrl; Content.Summary = NewsSummary; Content.Thumbnail = ImgUrl; Content.URL = NewsUrl; Content.Archived = false; Content.UserNameEmail = UserName + " " + UserEmailID; Content.LngCode = CurrentDbLangCode; Content.ArticleTagID = -1; // all class Content to list ListDC.Add(Content); } } } catch (Exception Ex) { Global.CreateExceptionString(Ex, null); } // return list containing all html pages return ListDC; }