Exemplo n.º 1
0
        /// <summary>
        /// 获得友情链接列表
        /// </summary>
        public static FriendLinkInfo[] GetFriendLinkList()
        {
            DataTable dt = BrnMall.Core.BMAData.RDBS.GetFriendLinkList();
            FriendLinkInfo[] friendLinkList = new FriendLinkInfo[dt.Rows.Count];

            int index = 0;
            foreach (DataRow row in dt.Rows)
            {
                FriendLinkInfo friendLinkInfo = new FriendLinkInfo();
                friendLinkInfo.Id = TypeHelper.ObjectToInt(row["id"]);
                friendLinkInfo.Name = row["name"].ToString();
                friendLinkInfo.Title = row["title"].ToString();
                friendLinkInfo.Logo = row["logo"].ToString();
                friendLinkInfo.Url = row["url"].ToString();
                friendLinkInfo.Target = TypeHelper.ObjectToInt(row["target"]);
                friendLinkInfo.DisplayOrder = TypeHelper.ObjectToInt(row["displayorder"]);
                friendLinkList[index] = friendLinkInfo;
                index++;
            }
            return friendLinkList;
        }
Exemplo n.º 2
0
        public ActionResult Add(FriendLinkModel model)
        {
            if (ModelState.IsValid)
            {
                FriendLinkInfo friendLinkInfo = new FriendLinkInfo()
                {
                    Name = model.FriendLinkName,
                    Title = model.FriendLinkTitle == null ? "" : model.FriendLinkTitle,
                    Logo = model.FriendLinkLogo == null ? "" : model.FriendLinkLogo,
                    Url = model.FriendLinkUrl,
                    Target = model.Target,
                    DisplayOrder = model.DisplayOrder
                };

                AdminFriendLinks.CreateFriendLink(friendLinkInfo);
                AddMallAdminLog("添加友情链接", "添加友情链接,友情链接为:" + model.FriendLinkName);
                return PromptView("友情链接添加成功");
            }
            Load();
            return View(model);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 更新友情链接
 /// </summary>
 public void UpdateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     DbParameter[] param = {
                                  GenerateInParam("@name",SqlDbType.NChar, 50, friendLinkInfo.Name),
                                  GenerateInParam("@title",SqlDbType.NChar, 100, friendLinkInfo.Title),
                                  GenerateInParam("@logo",SqlDbType.NChar, 250, friendLinkInfo.Logo),
                                  GenerateInParam("@url",SqlDbType.NChar, 250, friendLinkInfo.Url),
                                  GenerateInParam("@target",SqlDbType.Int, 4, friendLinkInfo.Target),
                                  GenerateInParam("@displayorder",SqlDbType.Int,4,friendLinkInfo.DisplayOrder),
                                  GenerateInParam("@id",SqlDbType.Int, 4, friendLinkInfo.Id)
                                };
     string commandText = String.Format("UPDATE [{0}friendlinks] SET [name]=@name,[title]=@title,[logo]=@logo,[url]=@url,[target]=@target,[displayorder]=@displayorder WHERE [id]=@id",
                                         RDBSHelper.RDBSTablePre);
     RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, param);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 创建友情链接
 /// </summary>
 public void CreateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     DbParameter[] param = {
                                  GenerateInParam("@name",SqlDbType.NChar, 50, friendLinkInfo.Name),
                                  GenerateInParam("@title",SqlDbType.NChar, 100, friendLinkInfo.Title),
                                  GenerateInParam("@logo",SqlDbType.NChar, 250, friendLinkInfo.Logo),
                                  GenerateInParam("@url",SqlDbType.NChar, 250, friendLinkInfo.Url),
                                  GenerateInParam("@target",SqlDbType.Int, 4, friendLinkInfo.Target),
                                  GenerateInParam("@displayorder",SqlDbType.Int,4,friendLinkInfo.DisplayOrder)
                                };
     string commandText = String.Format("INSERT INTO [{0}friendlinks] ([name],[title],[logo],[url],[target],[displayorder]) VALUES(@name,@title,@logo,@url,@target,@displayorder)",
                                         RDBSHelper.RDBSTablePre);
     RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, param);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 更新友情链接
 /// </summary>
 public static void UpdateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     BrnMall.Core.BMAData.RDBS.UpdateFriendLink(friendLinkInfo);
 }
Exemplo n.º 6
0
 /// <summary>
 /// 更新友情链接
 /// </summary>
 public static void UpdateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     BrnMall.Data.FriendLinks.UpdateFriendLink(friendLinkInfo);
     BrnMall.Core.BMACache.Remove(CacheKeys.MALL_FRIENDLINK_LIST);
 }