protected void btnDel_Click(object sender, EventArgs e)
        {
            if (grid1.SelectedRowIndexArray != null && grid1.SelectedRowIndexArray.Length > 0)
            {
                string strSelectID = "0";
                for (int i = 0, count = grid1.SelectedRowIndexArray.Length; i < count; i++)
                {
                    int rowIndex = grid1.SelectedRowIndexArray[i];
                    foreach (object key in grid1.DataKeys[rowIndex])
                    {
                        strSelectID = key.ToString();
                    }
                }
                #region 删除逻辑

                zlzw.BLL.GeneralFriendlyLinkBLL generalFriendlyLinkBLL = new zlzw.BLL.GeneralFriendlyLinkBLL();
                DataTable dt = generalFriendlyLinkBLL.GetList("LinkGuid='" + strSelectID + "'").Tables[0];
                zlzw.Model.GeneralFriendlyLinkModel generalFriendlyLinkModel = generalFriendlyLinkBLL.GetModel(int.Parse(dt.Rows[0]["LinkID"].ToString()));
                generalFriendlyLinkModel.CanUsable = 0;
                generalFriendlyLinkBLL.Update(generalFriendlyLinkModel);
                GeneralFriendlyList_BindGrid();

                #endregion
            }
            else
            {
                return;
            }
        }
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["Type"] == "1")
            {
                //编辑保存
                zlzw.Model.GeneralFriendlyLinkModel generalFriendlyLinkModel = new zlzw.Model.GeneralFriendlyLinkModel();
                generalFriendlyLinkModel.LinkTitle = txbLinkTitle.Text;
                generalFriendlyLinkModel.LinkType = int.Parse(drpLinkType.SelectedValue);
                generalFriendlyLinkModel.LinkTargetUrl = txbLinkTargetUrl.Text;
                generalFriendlyLinkModel.LinkOrderNumber = int.Parse(txbOrderNumber.Text);
                generalFriendlyLinkModel.LinkDesc = txbLinkDesc.Text;
                generalFriendlyLinkModel.PublishDate = DateTime.Parse(ViewState["PublishDate"].ToString());
                generalFriendlyLinkModel.LinkGuid = new Guid(ViewState["LinkGuid"].ToString());
                zlzw.BLL.GeneralFriendlyLinkBLL generalFriendlyLinkBLL = new zlzw.BLL.GeneralFriendlyLinkBLL();
                generalFriendlyLinkModel.LinkID = int.Parse(Get_ID(generalFriendlyLinkBLL, Request.QueryString["value"]));
                generalFriendlyLinkModel.CanUsable = 1;
                if (fileUploadImage.PostedFile.ContentLength > 0)
                {
                    fileUploadImage.SaveAs(Server.MapPath(ViewState["LinkImagePath"].ToString()));
                    generalFriendlyLinkModel.LinkImagePath = ViewState["LinkImagePath"].ToString();
                }
                else
                {
                    generalFriendlyLinkModel.LinkImagePath = ViewState["LinkImagePath"].ToString();
                }
                generalFriendlyLinkBLL.Update(generalFriendlyLinkModel);
            }
            else
            {
                //添加保存

                zlzw.Model.GeneralFriendlyLinkModel generalFriendlyLinkModel = new zlzw.Model.GeneralFriendlyLinkModel();
                generalFriendlyLinkModel.LinkTitle = txbLinkTitle.Text;
                generalFriendlyLinkModel.LinkType = int.Parse(drpLinkType.SelectedValue);
                generalFriendlyLinkModel.LinkTargetUrl = txbLinkTargetUrl.Text;
                generalFriendlyLinkModel.LinkOrderNumber = int.Parse(txbOrderNumber.Text);
                generalFriendlyLinkModel.LinkDesc = txbLinkDesc.Text;
                generalFriendlyLinkModel.PublishDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
                generalFriendlyLinkModel.CanUsable = 1;
                if (fileUploadImage.PostedFile.ContentLength > 0)
                {
                    string fileName = DateTime.Now.Ticks.ToString() + "_" + fileUploadImage.FileName;
                    fileUploadImage.SaveAs(Server.MapPath("~/UploadImages/" + fileName));
                    generalFriendlyLinkModel.LinkImagePath = "~/UploadImages/" + fileName;//保存友情链接图片路径
                }
                zlzw.BLL.GeneralFriendlyLinkBLL generalFriendlyLinkBLL = new zlzw.BLL.GeneralFriendlyLinkBLL();
                generalFriendlyLinkBLL.Add(generalFriendlyLinkModel);
            }

            // 2. Close this window and Refresh parent window
            PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
        }