Exemplo n.º 1
0
 protected void Bind()
 {
     if (Request.QueryString["id"] != null)
     {
         if (Tools.TryParseMethod(id.ToString()) > 0)
         {
             NewsInfo       info  = nBLL.getAllById(id);
             FriendLinkInfo finfo = fBLL.getDataByLid(lid);
             lbCategory.Text  = finfo.f_title;
             lbTitle.Text     = info.n_title;
             litContent.Text  = info.n_detail;
             img1.ImageUrl    = Tools.GetAppSettings("NewsImageTruePath") + info.n_image;
             lbHits.Text      = info.n_hits.ToString();
             lbBuilddate.Text = info.n_ts.ToString("yyyy/MM/dd HH:mm");
             lbEditDate.Text  = info.n_editDate.ToString("yyyy/MM/dd HH:mm");
             lbStartdate.Text = info.n_startDate.ToString("yyyy/MM/dd");
             lbEnddate.Text   = info.n_endDate.ToString("yyyy/MM/dd");
             if (info.n_show)
             {
                 lbShow.Text = "顯示";
             }
             else
             {
                 lbShow.Text = "不顯示";
             }
             rpImage.DataSource = niBLL.GetAllImgWithNews(id);
             rpImage.DataBind();
         }
     }
 }
Exemplo n.º 2
0
 protected void Bind()
 {
     if (id != 0)
     {
         if (Tools.TryParseMethod(id.ToString()) > 0)
         {
             FriendLinkInfo info = fBLL.GetDataById(id);
             ddrCategory.SelectedValue = info.fc_id.ToString();
             txtTitle.Text             = info.f_title;
             txtName.Text = info.f_name;
             ckbooks.Text = info.f_books;
             //txtDegree.Text = info.f_degree;
             ckdegree.Text = info.f_degree;
             txtPhone.Text = info.f_field;
             //txtHistory.Text = info.f_history;
             ckhistory.Text   = info.f_history;
             txtEmail.Text    = info.f_license;
             ckspecialty.Text = info.f_specialty;
             txtEditDate.Text = DateTime.Now.ToShortDateString();
             //txtUrl.Text = info.f_url;
             Image1.ImageUrl      = Tools.GetAppSettings("FriendLinkTruePath") + info.f_img;
             Image1.AlternateText = info.f_img;
             hfImg.Value          = info.f_img;
         }
     }
 }
Exemplo n.º 3
0
        public ActionResult Edit(FriendLinkModel model, int id = -1)
        {
            FriendLinkInfo friendLinkInfo = AdminFriendLinks.GetFriendLinkById(id);

            if (friendLinkInfo == null)
            {
                return(PromptView("友情链接不存在"));
            }

            if (ModelState.IsValid)
            {
                friendLinkInfo.Name         = model.FriendLinkName;
                friendLinkInfo.Title        = model.FriendLinkTitle == null ? "" : model.FriendLinkTitle;
                friendLinkInfo.Logo         = model.FriendLinkLogo == null ? "" : model.FriendLinkLogo;
                friendLinkInfo.Url          = model.FriendLinkUrl;
                friendLinkInfo.Target       = model.Target;
                friendLinkInfo.DisplayOrder = model.DisplayOrder;

                AdminFriendLinks.UpdateFriendLink(friendLinkInfo);
                AddAdminOperateLog("修改友情链接", "修改友情链接,友情链接ID为:" + id);
                return(PromptView("友情链接修改成功"));
            }

            Load();
            return(View(model));
        }
Exemplo n.º 4
0
    //protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    //{
    //    if (e.Row.RowType == DataControlRowType.DataRow)
    //    {
    //        Button btUp = (Button)e.Row.FindControl("btnUp");
    //        btUp.CommandArgument = e.Row.RowIndex.ToString();
    //        Button btDown = (Button)e.Row.FindControl("btnDown");
    //        btDown.CommandArgument = e.Row.RowIndex.ToString();
    //    }
    //}
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int    ClickNowSort  = 0;
        int    RdyChangeSort = 0;
        int    i             = 0;
        Button btnClick;
        Button btnRdyChange;

        if (e.CommandName == "btnSortUp")
        {
            if (int.Parse(e.CommandArgument.ToString()) > 0)
            {
                btnClick     = (Button)GridView1.Rows[int.Parse(e.CommandArgument.ToString())].FindControl("Button2");
                btnRdyChange = (Button)GridView1.Rows[int.Parse(e.CommandArgument.ToString()) - 1].FindControl("Button2");
                FriendLinkInfo pdClick  = fBLL.GetDataById(int.Parse(btnClick.CommandArgument.ToString()));
                FriendLinkInfo pdChange = fBLL.GetDataById(int.Parse(btnRdyChange.CommandArgument.ToString()));
                ClickNowSort       = pdClick.f_sorting;
                RdyChangeSort      = pdChange.f_sorting;
                pdClick.f_sorting  = RdyChangeSort;
                pdChange.f_sorting = ClickNowSort;
                if ((i = fBLL.Update(pdClick) + fBLL.Update(pdChange)) > 1)
                {
                    ShowMessage("排序成功");
                    ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("f_title", txtKeyWord.Text, int.Parse(ddrCategory.SelectedValue), "fc_id", ""));
                }
            }
            else
            {
                ShowMessage("此項目排序已是第一位");
            }
        }
        if (e.CommandName == "btnSortDown")
        {
            if (int.Parse(e.CommandArgument.ToString()) < GridView1.Rows.Count - 1)
            {
                btnClick     = (Button)GridView1.Rows[int.Parse(e.CommandArgument.ToString())].FindControl("Button2");
                btnRdyChange = (Button)GridView1.Rows[int.Parse(e.CommandArgument.ToString()) + 1].FindControl("Button2");
                FriendLinkInfo pdClick  = fBLL.GetDataById(int.Parse(btnClick.CommandArgument.ToString()));
                FriendLinkInfo pdChange = fBLL.GetDataById(int.Parse(btnRdyChange.CommandArgument.ToString()));
                ClickNowSort       = pdClick.f_sorting;
                RdyChangeSort      = pdChange.f_sorting;
                pdClick.f_sorting  = RdyChangeSort;
                pdChange.f_sorting = ClickNowSort;
                if ((i = fBLL.Update(pdClick) + fBLL.Update(pdChange)) > 1)
                {
                    ShowMessage("排序成功");
                    ObjectDataSource1.FilterExpression = AddMethodSystem.DecodeHtml2(AddMethodSystem.SearchWHEREStringObject("f_title", txtKeyWord.Text, int.Parse(ddrCategory.SelectedValue), "fc_id", ""));
                }
            }
            else
            {
                ShowMessage("此項目排序已是最後一位");
            }
        }
    }
Exemplo n.º 5
0
        public FriendLinkInfo GetDataById(int f_id)
        {
            FriendLinkInfo info   = new FriendLinkInfo();
            IDataReader    reader = db.GetDataById(f_id).CreateDataReader();

            if (reader.Read())
            {
                info = FriendLinkInfo.Populate(reader);
            }
            return(info);
        }
Exemplo n.º 6
0
        public List <FriendLinkInfo> GetSortingWithDelete(int fc_id, int f_sorting)
        {
            List <FriendLinkInfo> infos  = new List <FriendLinkInfo>();
            IDataReader           reader = db.GetkSortingWithDelete(fc_id, f_sorting).CreateDataReader();

            while (reader.Read())
            {
                infos.Add(FriendLinkInfo.Populate(reader));
            }
            return(infos);
        }
Exemplo n.º 7
0
        public List <FriendLinkInfo> GetDataByCategoryId(int fc_id)
        {
            List <FriendLinkInfo> infos  = new List <FriendLinkInfo>();
            IDataReader           reader = db.GetDataByID(fc_id).CreateDataReader();

            while (reader.Read())
            {
                infos.Add(FriendLinkInfo.Populate(reader));
            }
            return(infos);
        }
Exemplo n.º 8
0
        public int InsertSortingWithCategory(int fc_id)
        {
            FriendLinkInfo info   = new FriendLinkInfo();
            IDataReader    reader = db.InsertSorting(fc_id).CreateDataReader();

            if (reader.Read())
            {
                info = FriendLinkInfo.Populate(reader);
                return(info.f_sorting + 1);
            }
            return(1);
        }
Exemplo n.º 9
0
        public int Delete(int key)
        {
            FriendLinkInfo info = GetDataById(key);

            if (System.IO.File.Exists(HttpContext.Current.Server.MapPath(Tools.GetAppSettings("FriendLinkTruePath") + info.f_img)))
            {
                System.IO.File.Delete(HttpContext.Current.Server.MapPath(Tools.GetAppSettings("FriendLinkTruePath") + info.f_img));
            }
            //由此開始刪除排序
            List <FriendLinkInfo> SortingInfos = GetSortingWithDelete(info.fc_id, info.f_sorting);

            foreach (FriendLinkInfo infoDel in SortingInfos)
            {
                db.Update(infoDel.fc_id, infoDel.f_title, infoDel.f_sorting - 1, infoDel.f_url, infoDel.f_img, infoDel.f_show, infoDel.f_degree, infoDel.f_history, infoDel.f_books, infoDel.f_specialty, infoDel.f_license, infoDel.f_field, infoDel.f_ts, infoDel.f_editDate, infoDel.l_id, info.f_name, infoDel.f_id);
            }
            return(db.Delete(key));
        }
Exemplo n.º 10
0
        public int Update(FriendLinkInfo info)
        {
            FriendLinkInfo BeforceInfo = GetDataById(info.f_id);

            if (BeforceInfo.fc_id == info.fc_id)
            {
                return(db.Update(info.fc_id, info.f_title, info.f_sorting, info.f_url, info.f_img, info.f_show, info.f_degree, info.f_history, info.f_books, info.f_specialty, info.f_license, info.f_field, info.f_ts, info.f_editDate, info.l_id, info.f_name, info.f_id));
            }
            else
            {
                List <FriendLinkInfo> infosBeforce = GetSortingWithDelete(BeforceInfo.fc_id, BeforceInfo.f_sorting);
                foreach (FriendLinkInfo infos in infosBeforce)
                {
                    db.Update(infos.fc_id, infos.f_title, infos.f_sorting - 1, infos.f_url, infos.f_img, infos.f_show, info.f_degree, info.f_history, info.f_books, info.f_specialty, info.f_license, info.f_field, info.f_ts, info.f_editDate, info.l_id, info.f_name, infos.f_id);
                }
                return(db.Update(info.fc_id, info.f_title, InsertSortingWithCategory(info.fc_id), info.f_url, info.f_img, info.f_show, info.f_degree, info.f_history, info.f_books, info.f_specialty, info.f_license, info.f_field, info.f_ts, info.f_editDate, info.l_id, info.f_name, info.f_id));
            }
        }
Exemplo n.º 11
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (ddrCategory.SelectedValue != "0")
     {
         if (!Directory.Exists(Server.MapPath("FriendLinkTruePath")))
         {
             System.IO.Directory.CreateDirectory(Server.MapPath("~/ImageCollection/friendLink/"));
         }
         FriendLinkInfo info = fBLL.GetDataById(id);
         if (hfImg.Value != Image1.AlternateText)
         {
             System.IO.FileInfo file = new System.IO.FileInfo(Server.MapPath(Image1.ImageUrl));
             file.CopyTo(Server.MapPath(Tools.GetAppSettings("FriendLinkTruePath") + Image1.AlternateText));
             if (System.IO.File.Exists(Server.MapPath(Tools.GetAppSettings("FriendLinkTruePath") + hfImg.Value)))
             {
                 System.IO.File.Delete(Server.MapPath(Tools.GetAppSettings("FriendLinkTruePath") + hfImg.Value));
             }
         }
         info.fc_id   = int.Parse(ddrCategory.SelectedValue);
         info.f_title = txtTitle.Text;
         info.f_name  = txtName.Text;
         //info.f_degree = txtDegree.Text;
         info.f_degree    = ckdegree.Text;
         info.f_history   = ckhistory.Text;
         info.f_books     = ckbooks.Text;
         info.f_specialty = ckspecialty.Text;
         info.f_license   = txtEmail.Text;
         info.f_field     = txtPhone.Text;
         info.f_editDate  = DateTime.Now;
         //info.f_url = txtUrl.Text;
         info.f_img = Image1.AlternateText;
         //info.f_show = bool.Parse(rbShow.SelectedValue);
         if (fBLL.Update(info) > 0)
         {
             Response.Redirect("List.aspx?header=修改訊息完成!", true);
         }
     }
     else
     {
         ShowMessage("請選擇職稱");
     }
 }
Exemplo n.º 12
0
    protected void Bind()
    {
        FriendLinkInfo info = fBLL.GetDataById(id);

        lbcategory.Text  = fcBLL.GetDataById(info.fc_id).fc_title;
        lbTitle.Text     = info.f_title;
        lbName.Text      = info.f_name;
        lbBooks.Text     = info.f_books;
        lbDegree.Text    = info.f_degree;
        lbPhone.Text     = info.f_field;
        lbHistory.Text   = info.f_history;
        lbEmail.Text     = info.f_license;
        lbSpecialty.Text = info.f_specialty;
        lbStartdate.Text = info.f_ts.ToShortDateString();
        lbEditDate.Text  = info.f_editDate.ToShortDateString();
        //hyUrl.NavigateUrl = info.f_url;
        //hyUrl.Text = info.f_url;
        //hyUrl.Target = "_blank";
        Image1.ImageUrl = Tools.GetAppSettings("FriendLinkTruePath") + info.f_img;
        //rbShow.SelectedValue = info.f_show.ToString();
    }
Exemplo n.º 13
0
        public ActionResult Edit(int id = -1)
        {
            FriendLinkInfo friendLinkInfo = AdminFriendLinks.GetFriendLinkById(id);

            if (friendLinkInfo == null)
            {
                return(PromptView("友情链接不存在"));
            }

            FriendLinkModel model = new FriendLinkModel();

            model.FriendLinkName  = friendLinkInfo.Name;
            model.FriendLinkTitle = friendLinkInfo.Title;
            model.FriendLinkLogo  = friendLinkInfo.Logo;
            model.FriendLinkUrl   = friendLinkInfo.Url;
            model.Target          = friendLinkInfo.Target;
            model.DisplayOrder    = friendLinkInfo.DisplayOrder;
            Load();

            return(View(model));
        }
Exemplo n.º 14
0
        /// <summary>
        /// 获得友情链接列表
        /// </summary>
        public static FriendLinkInfo[] GetFriendLinkList()
        {
            DataTable dt = BrnShop.Core.BSPData.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.º 15
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);
                AddAdminOperateLog("添加友情链接", "添加友情链接,友情链接为:" + model.FriendLinkName);
                return(PromptView("友情链接添加成功"));
            }
            Load();
            return(View(model));
        }
Exemplo n.º 16
0
 public void Bind()
 {
     if (Request.QueryString["id"] != null)
     {
         if (Tools.TryParseMethod(id.ToString()) != 0)
         {
             NewsInfo       info  = nBLL.getAllById(id);
             FriendLinkInfo finfo = fBLL.getDataByLid(lid);
             ddrCategory.SelectedValue = finfo.f_id.ToString();
             txtName.Text       = info.n_title;
             Ckeditorl1.Text    = info.n_detail;
             ChkVisible.Checked = info.n_show;
             txtAddDate.Text    = info.n_ts.ToString("yyyy/MM/dd HH:mm");
             txtEditDate.Text   = DateTime.Now.ToString("yyyy/MM/dd HH:mm");
             txtStartDate.Text  = info.n_startDate.ToString("yyyy/MM/dd");
             txtEndDate.Text    = info.n_endDate.ToString("yyyy/MM/dd");
             hfImageIndex.Value = info.n_image;
             rpImage.DataSource = niBLL.GetAllImgWithNews(id);
             rpImage.DataBind();
         }
     }
 }
Exemplo n.º 17
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (ddlCategory.SelectedValue != "0")
     {
         if (!Directory.Exists(Server.MapPath("FriendLinkTruePath")))
         {
             System.IO.Directory.CreateDirectory(Server.MapPath("~/ImageCollection/friendLink/"));
         }
         if (System.IO.File.Exists(Server.MapPath(Image1.ImageUrl)))
         {
             System.IO.FileInfo file = new System.IO.FileInfo(Server.MapPath(Image1.ImageUrl));
             file.CopyTo(Server.MapPath(Tools.GetAppSettings("FriendLinkTruePath") + Image1.AlternateText));
         }
         FriendLinkInfo info = new FriendLinkInfo();
         info.fc_id       = int.Parse(ddlCategory.SelectedValue);
         info.f_title     = txtTitle.Text;
         info.f_name      = txtName.Text;
         info.f_books     = uc3.Text;
         info.f_degree    = uc1.Text;
         info.f_field     = txtPhone.Text;
         info.f_history   = uc2.Text;
         info.f_license   = txtEmail.Text;
         info.f_specialty = uc4.Text;
         info.f_ts        = DateTime.Parse(txtDate.Text);
         info.l_id        = lid;
         //info.f_url = txtUrl.Text;
         info.f_img = Image1.AlternateText;
         //info.f_show = bool.Parse(rbShow.SelectedValue);
         if (fBLL.Insert(info) > 0)
         {
             Response.Redirect("List.aspx?header=" + Getmessage("30009"));
         }
     }
     else
     {
         ShowMessage("請選擇職稱");
     }
 }
Exemplo n.º 18
0
    protected void Bind()
    {
        FriendLinkInfo info = fBLL.GetDataById(id);

        litName.Text      = info.f_title;
        litTitle.Text     = info.f_name;
        litDegree.Text    = info.f_degree;
        litHistory.Text   = info.f_history;
        litBooks.Text     = info.f_books;
        litSpecialty.Text = info.f_specialty;
        //litEmail.Text = info.f_license;
        //litPhone.Text = info.f_field;
        if (info.f_img != "")
        {
            Image1.ImageUrl = string.Format(Tools.GetAppSettings("FriendLinkTruePath") + info.f_img);
        }
        else
        {
            Image1.ImageUrl = "img/team/person.jpg";
        }
        Rpnews.DataSource = nBLL.GetDataByFIdOrderDesc(id, 3);
        Rpnews.DataBind();
    }
Exemplo n.º 19
0
 public int Insert(FriendLinkInfo info)
 {
     return(db.Insert(info.fc_id, info.f_title, InsertSortingWithCategory(info.fc_id), info.f_url, info.f_img, info.f_show, info.f_degree, info.f_history, info.f_books, info.f_specialty, info.f_license, info.f_field, info.f_ts, info.f_editDate, info.l_id, info.f_name));
 }
Exemplo n.º 20
0
 /// <summary>
 /// 创建友情链接
 /// </summary>
 public static void CreateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     OWZX.Core.BSPData.RDBS.CreateFriendLink(friendLinkInfo);
 }
Exemplo n.º 21
0
 /// <summary>
 /// 创建友情链接
 /// </summary>
 public static void CreateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     BrnMall.Core.BMAData.RDBS.CreateFriendLink(friendLinkInfo);
 }
Exemplo n.º 22
0
 /// <summary>
 /// 更新友情链接
 /// </summary>
 public static void UpdateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     BrnShop.Data.FriendLinks.UpdateFriendLink(friendLinkInfo);
     BrnShop.Core.BSPCache.Remove(CacheKeys.SHOP_FRIENDLINK_LIST);
 }
Exemplo n.º 23
0
 /// <summary>
 /// 更新友情链接
 /// </summary>
 public static void UpdateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     BrnShop.Core.BSPData.RDBS.UpdateFriendLink(friendLinkInfo);
 }
Exemplo n.º 24
0
 /// <summary>
 /// 更新友情链接
 /// </summary>
 public static void UpdateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     BonSite.Core.BSData.RDBS.UpdateFriendLink(friendLinkInfo);
 }
Exemplo n.º 25
0
 /// <summary>
 /// 创建友情链接
 /// </summary>
 public static void CreateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     OWZX.Data.FriendLinks.CreateFriendLink(friendLinkInfo);
     OWZX.Core.BSPCache.Remove(CacheKeys.SHOP_FRIENDLINK_LIST);
 }
Exemplo n.º 26
0
 /// <summary>
 /// 更新友情链接
 /// </summary>
 public static void UpdateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     NStore.Data.FriendLinks.UpdateFriendLink(friendLinkInfo);
     NStore.Core.BMACache.Remove(CacheKeys.MALL_FRIENDLINK_LIST);
 }
Exemplo n.º 27
0
 /// <summary>
 /// 创建友情链接
 /// </summary>
 public static void CreateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     BrnMall.Data.FriendLinks.CreateFriendLink(friendLinkInfo);
     BrnMall.Core.BMACache.Remove(CacheKeys.MALL_FRIENDLINK_LIST);
 }
Exemplo n.º 28
0
 /// <summary>
 /// 更新友情链接
 /// </summary>
 public static void UpdateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     BonSite.Data.FriendLinks.UpdateFriendLink(friendLinkInfo);
     BonSite.Core.BSCache.Remove(CacheKeys.SITE_FRIENDLINK_LIST);
 }
Exemplo n.º 29
0
 /// <summary>
 /// 更新友情链接
 /// </summary>
 public static void UpdateFriendLink(FriendLinkInfo friendLinkInfo)
 {
     NStore.Core.BMAData.RDBS.UpdateFriendLink(friendLinkInfo);
 }