public string getImage(object obj_id, object obj_image1) { if (!string.IsNullOrEmpty(Utils.CStrDef(obj_id)) && Utils.CIntDef(obj_id) > 0) { return("<img src='" + PathFiles.GetPathNews(m_news_id) + Utils.CStrDef(obj_image1) + "' width='40px' border='0' />"); } return(""); }
public string getLinkImage(object obj_id, object obj_image1) { if (!string.IsNullOrEmpty(Utils.CStrDef(obj_id)) && Utils.CIntDef(obj_id) > 0) { return(PathFiles.GetPathNews(m_news_id) + Utils.CStrDef(obj_id)); } return(""); }
public string getLinkImage(object obj_id, object obj_file) { if (!string.IsNullOrEmpty(Utils.CStrDef(obj_file)) && Utils.CIntDef(obj_id) > 0) { return("<a href='" + PathFiles.GetPathAdItems(Utils.CIntDef(obj_id)) + Utils.CStrDef(obj_file) + "' target='_blank'>" + Utils.CStrDef(obj_file) + "</a>"); } return(""); }
public static string setbackgroup() { var _configs = new Config().Config_meta(); if (_configs != null && _configs.ToList().Count > 0 && !string.IsNullOrEmpty(_configs.ToList()[0].CONFIG_FIELD1)) { return("background: url(" + PathFiles.GetPathConfigs() + _configs.ToList()[0].CONFIG_FIELD1 + ") center center;"); } return("background: url(/Resources/images/bg-default.jpg) center center;"); }
private void CreateDirectory() { m_pathFile = PathFiles.GetPathCategory(_idcat); if (!Directory.Exists(Server.MapPath(m_pathFile))) { Directory.CreateDirectory(Server.MapPath(m_pathFile)); } Session["FileManager"] = m_pathFile; }
protected void lbtDelete_Click(object sender, EventArgs e) { int i = 0; int j = 0; HtmlInputCheckBox check = new HtmlInputCheckBox(); int[] items = new int[rptList.Items.Count]; try { foreach (RepeaterItem item in rptList.Items) { check = new HtmlInputCheckBox(); check = (HtmlInputCheckBox)item.FindControl("chkSelect"); Label lblID = (Label)item.FindControl("lblID"); if (check.Checked) { int catId = Utils.CIntDef(lblID.Text, 0); items[j] = catId; try { //delete folder string fullpath = Server.MapPath(PathFiles.GetPathNews(items[j])); if (Directory.Exists(fullpath)) { DeleteAllFilesInFolder(fullpath); Directory.Delete(fullpath); } } catch (Exception) { } j++; } i++; } //delete var g_delete = DB.GetTable <ESHOP_AD_ITEM>().Where(g => items.Contains(g.AD_ITEM_ID)); DB.ESHOP_AD_ITEMs.DeleteAllOnSubmit(g_delete); DB.SubmitChanges(); } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } finally { items = null; SearchResult(); } }
public string Getimages_Cat(object cat_id, object cat_img) { if (Utils.CIntDef(cat_id) > 0 && !string.IsNullOrEmpty(Utils.CStrDef(cat_img))) { return(PathFiles.GetPathCategory(Utils.CIntDef(cat_id)) + Utils.CStrDef(cat_img)); } else { return(""); } }
public string getImage(object obj_id, object obj_image1) { if (!string.IsNullOrEmpty(Utils.CStrDef(obj_id)) && Utils.CIntDef(obj_id) > 0) { return("<img src='" + PathFiles.GetPathAdItems(Utils.CIntDef(obj_id)) + Utils.CStrDef(obj_image1) + "' width='150px' border='0' />"); } else { return(""); } }
//private void SaveInfo(string strLink = "") //{ // try // { // //get image // string Img_Image1, Img_Image2; // if (trUpload1.Visible == true) // { // if (fileImage1.PostedFile != null) // { // Img_Image1 = Path.GetFileName(fileImage1.PostedFile.FileName); // } // else // { // Img_Image1 = ""; // } // } // else // { // Img_Image1 = hplImage1.Text; // } // //if (trUpload2.Visible == true) // //{ // // if (fileImage2.PostedFile != null) // // { // // Img_Image2 = Path.GetFileName(fileImage2.PostedFile.FileName); // // } // // else // // { // // Img_Image2 = ""; // // } // //} // //else // //{ // // Img_Image2= hplImage2.Text; // //} // if (m_img_id == 0) // { // //insert // ESHOP_NEWS_IMAGE g_insert = new ESHOP_NEWS_IMAGE(); // g_insert.NEWS_IMG_DESC = txtTitle.Value; // g_insert.NEWS_IMG_ORDER = Utils.CIntDef(txtOrder.Value); // g_insert.NEWS_ID = m_news_id; // g_insert.NEWS_IMG_IMAGE1 = Img_Image1; // //g_insert.NEWS_IMG_IMAGE2 = Img_Image2; // DB.ESHOP_NEWS_IMAGEs.InsertOnSubmit(g_insert); // DB.SubmitChanges(); // //get new id // var _new = DB.GetTable<ESHOP_NEWS_IMAGE>().OrderByDescending(g => g.NEWS_IMG_ID).Take(1); // m_img_id = _new.Single().NEWS_IMG_ID; // strLink = string.IsNullOrEmpty(strLink) ? "news_images.aspx?news_id=" + m_news_id : strLink; // } // else // { // //update // var g_update = DB.GetTable<ESHOP_NEWS_IMAGE>().Where(g => g.NEWS_IMG_ID == m_img_id); // if (g_update.ToList().Count > 0) // { // g_update.Single().NEWS_IMG_DESC = txtTitle.Value; // g_update.Single().NEWS_IMG_ORDER = Utils.CIntDef(txtOrder.Value); // g_update.Single().NEWS_ID = m_news_id; // g_update.Single().NEWS_IMG_IMAGE1 = Img_Image1; // //g_update.Single().NEWS_IMG_IMAGE2 = Img_Image2; // DB.SubmitChanges(); // strLink = string.IsNullOrEmpty(strLink) ? "news_images.aspx?news_id=" + m_news_id : strLink; // } // } // //update images // if (trUpload1.Visible) // { // if (!string.IsNullOrEmpty(fileImage1.PostedFile.FileName)) // { // string pathfile = Server.MapPath("/data/news/" + m_news_id); // string fullpathfile = pathfile + "/" + Img_Image1; // if (!Directory.Exists(pathfile)) // { // Directory.CreateDirectory(pathfile); // } // fileImage1.PostedFile.SaveAs(fullpathfile); // } // } // //if (trUpload2.Visible) // //{ // // if (!string.IsNullOrEmpty(fileImage2.PostedFile.FileName)) // // { // // string pathfile = Server.MapPath("../data/news/" + m_news_id); // // string fullpathfile = pathfile + "/" + Img_Image2; // // if (!Directory.Exists(pathfile)) // // { // // Directory.CreateDirectory(pathfile); // // } // // fileImage2.PostedFile.SaveAs(fullpathfile); // // } // //} // } // catch (Exception ex) // { // clsVproErrorHandler.HandlerError(ex); // } // finally // { // if (!string.IsNullOrEmpty(strLink)) // { Response.Redirect(strLink); } // } //} private void DeleteInfo(int img_id) { string strLink = ""; try { string Img_Image1 = ""; string Img_Image2 = ""; var G_info = DB.GetTable <ESHOP_NEWS_IMAGE>().Where(g => g.NEWS_IMG_ID == img_id); if (G_info.ToList().Count > 0) { Img_Image1 = Utils.CStrDef(G_info.ToList()[0].NEWS_IMG_IMAGE1); Img_Image2 = Utils.CStrDef(G_info.ToList()[0].NEWS_IMG_IMAGE2); } DB.ESHOP_NEWS_IMAGEs.DeleteAllOnSubmit(G_info); DB.SubmitChanges(); //delete file if (!string.IsNullOrEmpty(Img_Image1)) { string fullpath = Server.MapPath(PathFiles.GetPathNews(m_news_id) + Img_Image1); if (File.Exists(fullpath)) { File.Delete(fullpath); } } if (!string.IsNullOrEmpty(Img_Image2)) { string fullpath = Server.MapPath(PathFiles.GetPathNews(m_news_id) + Img_Image2); if (File.Exists(fullpath)) { File.Delete(fullpath); } } strLink = "news_images.aspx?news_id=" + m_news_id; } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } finally { if (!string.IsNullOrEmpty(strLink)) { Response.Redirect(strLink); } } }
private void Bind_icon() { var _configs = cf.Config_meta(); if (_configs.ToList().Count > 0) { if (!string.IsNullOrEmpty(_configs.ToList()[0].CONFIG_FAVICON)) { ltrFavicon.Text = "<link rel='shortcut icon' href='" + PathFiles.GetPathConfigs() + _configs.ToList()[0].CONFIG_FAVICON + "' />"; } } }
protected void Page_Load(object sender, EventArgs e) { var _configs = db.GetTable <ESHOP_CONFIG>().OrderBy(c => c.CONFIG_ID).Take(1); if (_configs.ToList().Count > 0) { if (!string.IsNullOrEmpty(_configs.ToList()[0].CONFIG_FAVICON)) { ltrFavicon.Text = "<link rel='shortcut icon' href='" + PathFiles.GetPathConfigs() + _configs.ToList()[0].CONFIG_FAVICON + "' />"; } } }
protected void lbtDelete_Click(object sender, EventArgs e) { int i = 0; int j = 0; HtmlInputCheckBox check = new HtmlInputCheckBox(); int[] items = new int[GridItemList.Items.Count]; try { foreach (DataGridItem item in GridItemList.Items) { check = new HtmlInputCheckBox(); check = (HtmlInputCheckBox)item.Cells[1].FindControl("chkSelect"); if (check.Checked) { items[j] = Utils.CIntDef(GridItemList.DataKeys[i]); try { //delete folder string fullpath = Server.MapPath(PathFiles.GetPathNews(items[j])); if (Directory.Exists(fullpath)) { DeleteAllFilesInFolder(fullpath); Directory.Delete(fullpath); } } catch (Exception) { } j++; } i++; } //delete var g_delete = DB.GetTable <ESHOP_POINT>().Where(g => items.Contains(g.POINT_ID)); DB.ESHOP_POINTs.DeleteAllOnSubmit(g_delete); DB.SubmitChanges(); } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } finally { items = null; SearchResult(); } }
private void CreateDirectory() { m_pathFile = PathFiles.GetPathNews(m_news_id); if (!Directory.Exists(Server.MapPath(m_pathFile))) { Directory.CreateDirectory(Server.MapPath(m_pathFile)); } //Session["FileManager"] = m_pathFile; Session["FileManager"] = "/data/"; Session["FileUpload"] = "/data/"; }
private void getInfo() { try { var G_info = (from g in DB.ESHOP_NEWS_IMAGEs where g.NEWS_IMG_ID == m_img_id select g ); if (G_info.ToList().Count > 0) { txtTitle.Value = G_info.ToList()[0].NEWS_IMG_DESC; txtOrder.Value = Utils.CStrDef(G_info.ToList()[0].NEWS_IMG_ORDER); ddlType.SelectedValue = Utils.CStrDef(G_info.ToList()[0].NEWS_IMG_SHOWTYPE); //image 1 if (!string.IsNullOrEmpty(G_info.ToList()[0].NEWS_IMG_IMAGE1)) { trUpload1.Visible = false; trImage1.Visible = true; hplImage1.NavigateUrl = PathFiles.GetPathNews(m_news_id) + G_info.ToList()[0].NEWS_IMG_IMAGE1; hplImage1.Text = G_info.ToList()[0].NEWS_IMG_IMAGE1; Image1.Src = PathFiles.GetPathNews(m_news_id) + G_info.ToList()[0].NEWS_IMG_IMAGE1; Image1.Width = 300; } else { trUpload1.Visible = true; trImage1.Visible = false; } //image 2 //if (!string.IsNullOrEmpty(G_info.ToList()[0].NEWS_IMG_IMAGE2)) //{ // trUpload2.Visible = false; // trImage2.Visible = true; // hplImage2.NavigateUrl = PathFiles.GetPathNews(m_news_id) + G_info.ToList()[0].NEWS_IMG_IMAGE2; // hplImage2.Text = G_info.ToList()[0].NEWS_IMG_IMAGE2; // Image2.Src = PathFiles.GetPathNews(m_news_id) + G_info.ToList()[0].NEWS_IMG_IMAGE2; //} //else //{ // trUpload2.Visible = true; // trImage2.Visible = false; //} } } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } }
protected void Page_Load(object sender, EventArgs e) { HttpCookie cookie = setckdv.GetCookie(); string devicechar = Request.UserAgent.ToLower(); if (Request.Cookies["deviceck"] != null) { if (cookie.HasKeys) { device = 1; } else if (Request.Browser.IsMobileDevice) { device = 1; } } else if (Request.Browser.IsMobileDevice || devicechar.Contains("mobile") || devicechar.Contains("ipad")) { device = 1; } if (device == 1) { Response.Redirect("/m-dang-ky.html"); } var _configs = cf.Config_meta(); if (_configs.ToList().Count > 0) { if (!string.IsNullOrEmpty(_configs.ToList()[0].CONFIG_FAVICON)) { ltrFavicon.Text = "<link rel='shortcut icon' href='" + PathFiles.GetPathConfigs() + _configs.ToList()[0].CONFIG_FAVICON + "' />"; } } HtmlHead header = base.Header; HtmlMeta headerDes = new HtmlMeta(); HtmlMeta headerKey = new HtmlMeta(); headerDes.Name = "Description"; headerKey.Name = "Keywords"; header.Title = "Đăng ký thành viên"; if (!IsPostBack) { Load_city(); Load_distric(-1); loadYear(); loadMonth(); loadDay(); } }
private static string getImgLogo() { var list = per.Load_logo_or_sologan("1", 1); if (list.Count > 0) { if (!String.IsNullOrEmpty(list[0].BANNER_FILE)) { return(PathFiles.GetPathBanner(list[0].BANNER_ID) + "/" + list[0].BANNER_FILE); } } return(string.Empty); }
protected void lbtDelete_Click(object sender, EventArgs e) { int j = 0; int[] items = new int[Rplistaditem.Items.Count]; try { for (int i = 0; i < Rplistaditem.Items.Count; i++) { HtmlInputCheckBox check = (HtmlInputCheckBox)Rplistaditem.Items[i].FindControl("chkSelect"); HiddenField Hdid = Rplistaditem.Items[i].FindControl("Hdid") as HiddenField; int _catid = Utils.CIntDef(Hdid.Value); if (check.Checked) { items[j] = _catid; try { //delete folder string fullpath = Server.MapPath(PathFiles.GetPathNews(items[j])); if (Directory.Exists(fullpath)) { DeleteAllFilesInFolder(fullpath); Directory.Delete(fullpath); } } catch (Exception) { } j++; } } //delete //delete var g_delete = DB.GetTable <ESHOP_AD_ITEM>().Where(g => items.Contains(g.AD_ITEM_ID)); DB.ESHOP_AD_ITEMs.DeleteAllOnSubmit(g_delete); DB.SubmitChanges(); } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } finally { items = null; SearchResult(); } }
protected void Page_Load(object sender, EventArgs e) { HttpCookie cookie = setckdv.GetCookie(); string devicechar = Request.UserAgent.ToLower(); if (Request.Cookies["deviceck"] != null) { if (cookie.HasKeys) { device = 1; } else if (Request.Browser.IsMobileDevice) { device = 1; } } else if (Request.Browser.IsMobileDevice || devicechar.Contains("mobile") || devicechar.Contains("ipad") && Session["devicefirts"] == null) { device = 1; } if (device == 1) { Response.Redirect("/m-lien-he.html"); } if (!IsPostBack) { Show_File_HTML("contact-vi.htm", 0); Show_File_HTML("contact-e.htm", 1); } var _configs = cf.Config_meta(); if (_configs.ToList().Count > 0) { if (!string.IsNullOrEmpty(_configs.ToList()[0].CONFIG_FAVICON)) { ltrFavicon.Text = "<link rel='shortcut icon' href='" + PathFiles.GetPathConfigs() + _configs.ToList()[0].CONFIG_FAVICON + "' />"; } } HtmlHead header = base.Header; HtmlMeta headerDes = new HtmlMeta(); HtmlMeta headerKey = new HtmlMeta(); headerDes.Name = "Description"; headerKey.Name = "Keywords"; header.Title = "Liên hệ"; }
protected void Page_Load(object sender, EventArgs e) { Session["home"] = 0; //if (Request.Browser.IsMobileDevice) // Response.Redirect("http://m.shopbacsi.com/"); HtmlHead header = base.Header; HtmlMeta headerDes = new HtmlMeta(); HtmlMeta headerKey = new HtmlMeta(); headerDes.Name = "Description"; headerKey.Name = "Keywords"; var _configs = cf.Config_meta(); if (_configs.ToList().Count > 0) { if (!string.IsNullOrEmpty(_configs.ToList()[0].CONFIG_FAVICON)) { ltrFavicon.Text = "<link rel='shortcut icon' href='" + PathFiles.GetPathConfigs() + _configs.ToList()[0].CONFIG_FAVICON + "' />"; } header.Title = _configs.ToList()[0].CONFIG_TITLE; headerDes.Content = _configs.ToList()[0].CONFIG_DESCRIPTION; header.Controls.Add(headerDes); headerKey.Content = _configs.ToList()[0].CONFIG_KEYWORD; header.Controls.Add(headerKey); } else { header.Title = "Enews Standard V1.0"; headerDes.Content = "Enews Standard V1.0"; header.Controls.Add(headerDes); headerKey.Content = "Enews Standard V1.0"; header.Controls.Add(headerKey); } UserControl main = null; if (device == 0) { main = Page.LoadControl("/Uis/main.ascx") as UserControl; } else { main = Page.LoadControl("/MOBILE/Uis/main.ascx") as UserControl; } Plmain.Controls.Add(main); }
public string GetImageHome(object Ad_Id, object Ad_Image1, object Ad_Target, object Ad_Url, object AD_ITEM_DESC) { try { if (Utils.CIntDef(Ad_Id) > 0 && !string.IsNullOrEmpty(Utils.CStrDef(Ad_Image1))) { return("<img src='" + PathFiles.GetPathAdItems(Utils.CIntDef(Ad_Id)) + Utils.CStrDef(Ad_Image1) + "' alt='' /><p class='caption'>" + AD_ITEM_DESC + "</p>"); } return(""); } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); return(null); } }
public string GetImageSliderIndex(object Ad_Id, object Ad_Image1, object Ad_Target, object Ad_Url) { try { if (Utils.CIntDef(Ad_Id) > 0 && !string.IsNullOrEmpty(Utils.CStrDef(Ad_Image1))) { return("<a href='" + Utils.CStrDef(Ad_Url) + "'> <img src='" + PathFiles.GetPathAdItems(Utils.CIntDef(Ad_Id)) + Utils.CStrDef(Ad_Image1) + "' alt='' /></a>"); } return(""); } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); return(null); } }
public string GetImageSlideHome(object Ad_Id, object Ad_Image1, object Ad_Target, object Ad_Url, object Ad_Item_Desc) { try { string s = ""; s += "<a href='" + Utils.CStrDef(Ad_Url) + "' target='" + Utils.CStrDef(Ad_Target) + "'> "; s += "<img src='" + PathFiles.GetPathAdItems(Utils.CIntDef(Ad_Id)) + Utils.CStrDef(Ad_Image1) + "' title='" + Utils.CStrDef(Ad_Item_Desc) + "' /> "; s += "</a> "; return(s); } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); return(null); } }
private string Chuoiheader_footer(int type) { string pathFile; string strHTMLContent = string.Empty; pathFile = type == 1 ? Server.MapPath(PathFiles.GetPathConfigs() + "/header_baogia.htm") : Server.MapPath(PathFiles.GetPathConfigs() + "/footer_baogia.htm"); if ((File.Exists(pathFile))) { StreamReader objNewsReader; //objNewsReader = New StreamReader(pathFile, System.Text.Encoding.Default) objNewsReader = new StreamReader(pathFile); strHTMLContent = objNewsReader.ReadToEnd(); objNewsReader.Close(); } return(strHTMLContent); }
protected void Page_Load(object sender, EventArgs e) { var _configs = cf.Config_meta(); if (_configs.ToList().Count > 0) { if (!string.IsNullOrEmpty(_configs.ToList()[0].CONFIG_FAVICON)) { ltrFavicon.Text = "<link rel='shortcut icon' href='" + PathFiles.GetPathConfigs() + _configs.ToList()[0].CONFIG_FAVICON + "' />"; } } HtmlHead header = base.Header; HtmlMeta headerDes = new HtmlMeta(); HtmlMeta headerKey = new HtmlMeta(); headerDes.Name = "Description"; headerKey.Name = "Keywords"; header.Title = "Thanh toán"; Guid _guid = (Guid)Session["news_guid"]; if (!pay.Check_Cart(_guid)) { Response.Redirect("/", false); } if (!IsPostBack) { Load_Cart(_guid); decimal totalmn = carts.Total_Amount(_guid); lbtotalmoney.Text = fm.FormatMoney(totalmn); if (Session["price"] != null) { _ship = Utils.CIntDef(Session["price"]); totalmn += _ship != -1 ? _ship : 0; Lbtotal.Text = fm.FormatMoney(totalmn); Lbship.Text = _ship > 0 ? fm.FormatMoney(_ship) : (_ship == 0 ? "Miễn phí" : "Liên hệ"); } else { Lbtotal.Text = fm.FormatMoney(totalmn); } loadInfo(); } }
public string getimgCate(object id) { try { int idcat = Utils.CIntDef(id); var list = db.ESHOP_CATEGORies.Where(n => n.CAT_ID == idcat).ToList(); if (list.Count > 0) { return(PathFiles.GetPathCategory(list[0].CAT_ID) + "/" + list[0].CAT_IMAGE1); } return(""); } catch (Exception) { throw; } }
private string getFooter() { string pathFile; string strHTMLContent = string.Empty; pathFile = Server.MapPath(PathFiles.GetPathConfigs() + "/footersendmail.htm"); if ((File.Exists(pathFile))) { StreamReader objNewsReader; //objNewsReader = New StreamReader(pathFile, System.Text.Encoding.Default) objNewsReader = new StreamReader(pathFile); strHTMLContent = objNewsReader.ReadToEnd(); objNewsReader.Close(); } return(strHTMLContent); }
//Showfile html public string Showfilehtm(string _sCat_Seo_Url, string _sNews_seo_url) { try { string _result = string.Empty; int _newsID = 0; if (!string.IsNullOrEmpty(_sCat_Seo_Url)) { var _vNewsID = db.GetTable <ESHOP_NEWS_CAT>().Where(a => a.ESHOP_CATEGORy.CAT_SEO_URL == _sCat_Seo_Url); _newsID = _vNewsID.ToList().Count > 0 ? Utils.CIntDef(_vNewsID.ToList()[0].NEWS_ID) : 0; } else { var getid = db.ESHOP_NEWs.Where(n => n.NEWS_SEO_URL == _sNews_seo_url).ToList(); _newsID = getid.Count > 0 ? Utils.CIntDef(getid[0].NEWS_ID) : 0; } string pathFile; string strHTMLContent; if (_newsID > 0) { var newsInfo = db.GetTable <ESHOP_NEW>().Where(n => n.NEWS_ID == _newsID); if (newsInfo.ToList().Count > 0) { pathFile = HttpContext.Current.Server.MapPath(PathFiles.GetPathNews(_newsID) + "/" + newsInfo.ToList()[0].NEWS_FILEHTML); if ((File.Exists(pathFile))) { StreamReader objNewsReader; objNewsReader = new StreamReader(pathFile); strHTMLContent = objNewsReader.ReadToEnd(); objNewsReader.Close(); _result = strHTMLContent; } } } return(_result); } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); return(""); } }
private void loadInfoaddress() { string pathFile; string strHTMLContent = string.Empty; pathFile = Server.MapPath(PathFiles.GetPathContact() + "/contact-printorder.htm"); if ((File.Exists(pathFile))) { StreamReader objNewsReader; //objNewsReader = New StreamReader(pathFile, System.Text.Encoding.Default) objNewsReader = new StreamReader(pathFile); strHTMLContent = objNewsReader.ReadToEnd(); objNewsReader.Close(); } Litinfo.Text = strHTMLContent; }
private void showFileHTML1() { string pathFile; string strHTMLContent; pathFile = Server.MapPath(PathFiles.GetPathContact() + "/contact-e.htm"); if ((File.Exists(pathFile))) { StreamReader objNewsReader; //objNewsReader = New StreamReader(pathFile, System.Text.Encoding.Default) objNewsReader = new StreamReader(pathFile); strHTMLContent = objNewsReader.ReadToEnd(); objNewsReader.Close(); mrk1.Value = strHTMLContent; } }
// Show html public string Show_File_HTML(int _newsID, int type) { try { string pathFile; string strHTMLContent; string _result = string.Empty; if (_newsID > 0) { var newsInfo = db.GetTable <ESHOP_NEW>().Where(n => n.NEWS_ID == _newsID); if (newsInfo.ToList().Count > 0) { if (type == 1) { pathFile = HttpContext.Current.Server.MapPath(PathFiles.GetPathNews(_newsID) + "/" + newsInfo.ToList()[0].NEWS_FILEHTML); } else if (type == 2) { pathFile = HttpContext.Current.Server.MapPath(PathFiles.GetPathNews(_newsID) + "/" + newsInfo.ToList()[0].NEWS_FIELD1); } else { pathFile = HttpContext.Current.Server.MapPath(PathFiles.GetPathNews(_newsID) + "/" + newsInfo.ToList()[0].NEWS_FIELD5); } if ((File.Exists(pathFile))) { StreamReader objNewsReader; objNewsReader = new StreamReader(pathFile); strHTMLContent = objNewsReader.ReadToEnd(); objNewsReader.Close(); _result = strHTMLContent; } } } return(_result); } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); return(""); } }