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());
        }
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public zlzw.Model.GeneralFriendlyLinkModel DataRowToModel(DataRow row)
		{
			zlzw.Model.GeneralFriendlyLinkModel model=new zlzw.Model.GeneralFriendlyLinkModel();
			if (row != null)
			{
				if(row["LinkID"]!=null && row["LinkID"].ToString()!="")
				{
					model.LinkID=int.Parse(row["LinkID"].ToString());
				}
				if(row["LinkGuid"]!=null && row["LinkGuid"].ToString()!="")
				{
					model.LinkGuid= new Guid(row["LinkGuid"].ToString());
				}
				if(row["LinkType"]!=null && row["LinkType"].ToString()!="")
				{
					model.LinkType=int.Parse(row["LinkType"].ToString());
				}
				if(row["LinkCategory"]!=null)
				{
					model.LinkCategory=row["LinkCategory"].ToString();
				}
				if(row["LinkTitle"]!=null)
				{
					model.LinkTitle=row["LinkTitle"].ToString();
				}
				if(row["LinkTargetUrl"]!=null)
				{
					model.LinkTargetUrl=row["LinkTargetUrl"].ToString();
				}
				if(row["LinkImageKey"]!=null)
				{
					model.LinkImageKey=row["LinkImageKey"].ToString();
				}
				if(row["LinkImagePath"]!=null)
				{
					model.LinkImagePath=row["LinkImagePath"].ToString();
				}
				if(row["PublishDate"]!=null && row["PublishDate"].ToString()!="")
				{
					model.PublishDate=DateTime.Parse(row["PublishDate"].ToString());
				}
				if(row["LinkDesc"]!=null)
				{
					model.LinkDesc=row["LinkDesc"].ToString();
				}
				if(row["CanUsable"]!=null && row["CanUsable"].ToString()!="")
				{
					model.CanUsable=int.Parse(row["CanUsable"].ToString());
				}
				if(row["LinkOrderNumber"]!=null && row["LinkOrderNumber"].ToString()!="")
				{
					model.LinkOrderNumber=int.Parse(row["LinkOrderNumber"].ToString());
				}
				if(row["PropertyNames"]!=null)
				{
					model.PropertyNames=row["PropertyNames"].ToString();
				}
				if(row["PropertyValues"]!=null)
				{
					model.PropertyValues=row["PropertyValues"].ToString();
				}
			}
			return model;
		}
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public zlzw.Model.GeneralFriendlyLinkModel GetModel(int LinkID)
		{
			SqlParameter[] parameters = {
					new SqlParameter("@LinkID", SqlDbType.Int,4)
			};
			parameters[0].Value = LinkID;

			zlzw.Model.GeneralFriendlyLinkModel model=new zlzw.Model.GeneralFriendlyLinkModel();
			DataSet ds= DbHelperSQL.RunProcedure("GeneralFriendlyLink_GetModel",parameters,"ds");
			if(ds.Tables[0].Rows.Count>0)
			{
				return DataRowToModel(ds.Tables[0].Rows[0]);
			}
			else
			{
				return null;
			}
		}