public static string GetCodeAdv(ModAdvEntity _Adv) { if (!string.IsNullOrEmpty(_Adv.File)) { if (!string.IsNullOrEmpty(_Adv.URL)) { if (_Adv.File.ToLower().EndsWith(".swf")) { return(GetMedia(0, _Adv.File, _Adv.Name, _Adv.Width, _Adv.Height, null, false, _Adv.AddInTag)); } else { return("<a href=\"" + _Adv.URL + "\" target=\"" + _Adv.Target + "\">" + GetMedia(0, _Adv.File, _Adv.Name, _Adv.Width, _Adv.Height, null, false, _Adv.AddInTag) + "</a>"); } } else { return(GetMedia(0, _Adv.File, _Adv.Name, _Adv.Width, _Adv.Height, null, false, _Adv.AddInTag)); } } if (!string.IsNullOrEmpty(_Adv.AdvCode)) { return(_Adv.AdvCode); } return(string.Empty); }
public static string GetCodeAdv(ModAdvEntity _Adv) { if (!string.IsNullOrEmpty(_Adv.File)) { if (!string.IsNullOrEmpty(_Adv.URL)) { if (_Adv.File.ToLower().EndsWith(".swf")) { return GetMedia(0, _Adv.File, _Adv.Name, _Adv.Width, _Adv.Height, null, false, _Adv.AddInTag); } else { return "<a href=\"" + _Adv.URL + "\" target=\"" + _Adv.Target + "\">" + GetMedia(0, _Adv.File, _Adv.Name, _Adv.Width, _Adv.Height, null, false, _Adv.AddInTag) + "</a>"; } } else { return GetMedia(0, _Adv.File, _Adv.Name, _Adv.Width, _Adv.Height, null, false, _Adv.AddInTag); } } if (!string.IsNullOrEmpty(_Adv.AdvCode)) return _Adv.AdvCode; return string.Empty; }
public void ActionAdd(ModAdvModel model) { if (model.RecordID > 0) { entity = ModAdvService.Instance.GetByID(model.RecordID); // khoi tao gia tri mac dinh khi update } else { entity = new ModAdvEntity(); // khoi tao gia tri mac dinh khi insert entity.MenuID = model.MenuID; entity.Activity = CPViewPage.UserPermissions.Approve; entity.Order = GetMaxOrder(model); } ViewBag.Data = entity; ViewBag.Model = model; }