private void getInfo() { try { Components.CpanelUtils.createItemLanguage(ref rblLanguage); var G_info = (from g in DB.ESHOP_BANNERs where g.BANNER_ID == m_banner_id select g ); if (G_info.ToList().Count > 0) { txtTitle.Value = G_info.ToList()[0].BANNER_DESC; rblLanguage.SelectedValue = Utils.CStrDef(G_info.ToList()[0].BANNER_LANGUAGE); txtOrder.Value = Utils.CStrDef(G_info.ToList()[0].BANNER_ORDER); rblBannerType.SelectedValue = Utils.CStrDef(G_info.ToList()[0].BANNER_TYPE); rblLogoBanner.SelectedValue = Utils.CStrDef(G_info.ToList()[0].BANNER_FIELD1); //image if (!string.IsNullOrEmpty(G_info.ToList()[0].BANNER_FILE)) { trUpload.Visible = false; trFile.Visible = true; hplFile.NavigateUrl = PathFiles.GetPathBanner(m_banner_id) + G_info.ToList()[0].BANNER_FILE; hplFile.Text = G_info.ToList()[0].BANNER_FILE; if (G_info.ToList()[0].BANNER_TYPE == 0) { ltrImage.Text = "<img src='" + PathFiles.GetPathBanner(m_banner_id) + G_info.ToList()[0].BANNER_FILE + "' border='0'>"; } else { ltrImage.Text += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='1000px' height='150' id='ShockwaveFlash1' >"; ltrImage.Text += "<param name='movie' value='" + PathFiles.GetPathBanner(m_banner_id) + G_info.ToList()[0].BANNER_FILE + "'>"; ltrImage.Text += "<param name='Menu' value='0'>"; ltrImage.Text += "<param name='quality' value='high'>"; ltrImage.Text += "<param name='wmode' value='transparent'>"; ltrImage.Text += "<embed width='1000' height='150' src='" + PathFiles.GetPathBanner(m_banner_id) + G_info.ToList()[0].BANNER_FILE + "' wmode='transparent' ></object>"; } } else { trUpload.Visible = true; trFile.Visible = false; } } else { trUpload.Visible = true; trFile.Visible = false; } } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } }
private void loadLogo() { var list = DB.ESHOP_BANNERs.Where(n => n.BANNER_FIELD1 == "1").OrderByDescending(n => n.BANNER_ID).Take(1).ToList(); if (list.Count > 0) { Image_Logo.ImageUrl = PathFiles.GetPathBanner(list[0].BANNER_ID) + "/" + list[0].BANNER_FILE; } }
protected void load_logo() { var _logoSlogan = per.Load_logo_or_sologan("1", 1); if (_logoSlogan.Count > 0) { Imag_logo.ImageUrl = PathFiles.GetPathBanner(_logoSlogan[0].BANNER_ID) + "/" + _logoSlogan[0].BANNER_FILE; } }
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.GetPathBanner(Utils.CIntDef(obj_id)) + Utils.CStrDef(obj_file) + "' target='_blank'>" + Utils.CStrDef(obj_file) + "</a>"); } return(""); }
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); }
private void DeleteInfo(int banner_id) { string strLink = ""; try { string Banner_File = ""; var G_info = DB.GetTable <ESHOP_BANNER>().Where(g => g.BANNER_ID == banner_id); if (G_info.ToList().Count > 0) { Banner_File = Utils.CStrDef(G_info.ToList()[0].BANNER_FILE); } DB.ESHOP_BANNERs.DeleteAllOnSubmit(G_info); DB.SubmitChanges(); //delete file if (!string.IsNullOrEmpty(Banner_File)) { string fullpath = Server.MapPath(PathFiles.GetPathBanner(banner_id) + Banner_File); if (File.Exists(fullpath)) { File.Delete(fullpath); } } strLink = "config_banner.aspx"; } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } finally { if (!string.IsNullOrEmpty(strLink)) { Response.Redirect(strLink); } } }
protected void btnDelete1_Click(object sender, ImageClickEventArgs e) { string strLink = ""; try { var n_info = DB.GetTable <ESHOP_BANNER>().Where(n => n.BANNER_ID == m_banner_id); if (n_info.ToList().Count > 0) { if (!string.IsNullOrEmpty(n_info.ToList()[0].BANNER_FILE)) { string imagePath = Server.MapPath(PathFiles.GetPathBanner(m_banner_id) + n_info.ToList()[0].BANNER_FILE); n_info.ToList()[0].BANNER_FILE = ""; DB.SubmitChanges(); if (File.Exists(imagePath)) { File.Delete(imagePath); } strLink = "config_banner.aspx?banner_id=" + m_banner_id; } } } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } finally { if (!string.IsNullOrEmpty(strLink)) { Response.Redirect(strLink); } } }
public string GetImage(object Banner_type, object Banner_ID, object Banner_Image, object BANNER_DESC) { try { string _sResult = string.Empty; if (Utils.CIntDef(Banner_type) == 0) { if (Utils.CIntDef(Banner_ID) > 0 && !string.IsNullOrEmpty(Utils.CStrDef(Banner_Image))) { return("<img src='" + PathFiles.GetPathBanner(Utils.CIntDef(Banner_ID)) + Utils.CStrDef(Banner_Image) + "' alt='" + BANNER_DESC + "' title='" + BANNER_DESC + "' />"); } else { return("<img src='../vi-vn/Images/Logo.png' width='172' height='80' />"); }; } else { if (Utils.CIntDef(Banner_ID) > 0 && !string.IsNullOrEmpty(Utils.CStrDef(Banner_Image))) { _sResult += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' height='117' id='ShockwaveFlash1' >"; _sResult += "<param name='movie' value='" + PathFiles.GetPathAdItems(Utils.CIntDef(Banner_ID)) + Utils.CStrDef(Banner_Image) + "'>"; _sResult += "<param name='Menu' value='0'>"; _sResult += "<param name='quality' value='high'>"; _sResult += "<param name='wmode' value='transparent'>"; _sResult += "<embed height='117' width='885' src='" + PathFiles.GetPathBanner(Utils.CIntDef(Banner_ID)) + Utils.CStrDef(Banner_Image) + "' wmode='transparent' ></object>"; } } return(_sResult); } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); return(null); } }