Пример #1
0
 protected void btnReg_Click(object sender, EventArgs e)
 {
     CheckInput();
     M_Link model = new M_Link();
     model.AddTime = DateTime.Now;
     model.Description = siteBll.GetFiltering(txtDescription.Text.Length > 200 ? txtDescription.Text.Substring(0, 200) : txtDescription.Text);
     model.Email = txtEmail.Text;
     model.LinkCategory = ddlLinkCategory.SelectedValue;
     if (rbPicLink.Checked)
     { model.LinkType = 2;}
     if (rbTextLink.Checked)
     { model.LinkType = 1; }
     model.OwnerName = txtRegName.Text;
     model.SiteLogo = txtRegLogo.Text;
     model.SiteName = txtRegSiteName.Text;
     model.SiteUrl = txtRegUrl.Text;
     model.Status = siteModel.IsCheckLink ? 1 : 2;
     model.IsDisable = false;
     linkBll.Add(model);
     if (siteModel.IsCheckLink)
     {
         Function.ShowMsg(1, "<li>您的申请已提交,请等待我们的审核</li><li><a href='" + hylnk.NavigateUrl + "'>返回首页</a></li>");
     }
     else
     {
         Function.ShowMsg(1, "<li>操作成功</li><li><a href='" + hylnk.NavigateUrl + "'>返回首页</a></li>");
     }
 }
Пример #2
0
 public void Add(M_Link model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@LinkType", SqlDbType.Int, 4), new SqlParameter("@LinkCategory", SqlDbType.NVarChar), new SqlParameter("@SiteName", SqlDbType.NVarChar), new SqlParameter("@SiteUrl", SqlDbType.VarChar, 255), new SqlParameter("@SiteLogo", SqlDbType.VarChar, 255), new SqlParameter("@OwnerName", SqlDbType.NVarChar), new SqlParameter("@Email", SqlDbType.NVarChar), new SqlParameter("@Description", SqlDbType.NVarChar), new SqlParameter("@AddTime", SqlDbType.DateTime, 8), new SqlParameter("@Status", SqlDbType.Int, 4), new SqlParameter("@IsDisable", SqlDbType.Bit, 1) };
     commandParameters[0].Value = model.LinkType;
     commandParameters[1].Value = model.LinkCategory;
     commandParameters[2].Value = model.SiteName;
     commandParameters[3].Value = model.SiteUrl;
     commandParameters[4].Value = model.SiteLogo;
     commandParameters[5].Value = model.OwnerName;
     commandParameters[6].Value = model.Email;
     commandParameters[7].Value = model.Description;
     commandParameters[8].Value = model.AddTime;
     commandParameters[9].Value = model.Status;
     commandParameters[10].Value = model.IsDisable;
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_Link_Add", commandParameters);
 }
Пример #3
0
 public M_Link GetModel(int LinkId)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@LinkId", SqlDbType.Int, 4) };
     commandParameters[0].Value = LinkId;
     M_Link link = new M_Link();
     DataTable table = SqlHelper.ExecuteTable(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_Link_GetModel", commandParameters);
     link.LinkId = LinkId;
     if (table.Rows.Count > 0)
     {
         link.LinkType = Convert.ToInt32(table.Rows[0]["LinkType"]);
         link.LinkCategory = table.Rows[0]["LinkCategory"].ToString();
         link.SiteName = table.Rows[0]["SiteName"].ToString();
         link.SiteUrl = table.Rows[0]["SiteUrl"].ToString();
         link.SiteLogo = table.Rows[0]["SiteLogo"].ToString();
         link.OwnerName = table.Rows[0]["OwnerName"].ToString();
         link.Email = table.Rows[0]["Email"].ToString();
         link.Description = table.Rows[0]["Description"].ToString();
         link.AddTime = DateTime.Parse(table.Rows[0]["AddTime"].ToString());
         link.Status = Convert.ToInt32(table.Rows[0]["Status"]);
         link.IsDisable = Convert.ToBoolean(table.Rows[0]["IsDisable"]);
         return link;
     }
     return null;
 }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AdminGroupBll.Power_Judge(19);

        //查看
        if (!string.IsNullOrEmpty(Request.QueryString["LinkId"]))
        {
            LinkId = Function.CheckNumber(Request.QueryString["LinkId"]) ? int.Parse(Request.QueryString["LinkId"]) : 0;
            model = linkBll.GetModel(LinkId);
            if (!IsPostBack)
            {
                BindData();
            }
        }

        //新增
        else if ((!string.IsNullOrEmpty(Request.QueryString["action"])) && Request.QueryString["action"] == "add")
        {
            TrIsDisable.Visible = TrStatus.Visible = false;
            IsAdd = true;
            btnReg.Text = "添加";
            if (!IsPostBack)
            { BindLinkCategory(); }
        }
        else
        { Response.Redirect("LinkList.aspx"); }
    }
Пример #5
0
 public void Update(M_Link model)
 {
     this.dal.Update(model);
 }
Пример #6
0
 public void Add(M_Link model)
 {
     this.dal.Add(model);
 }