Beispiel #1
0
        //下一步
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            ProjectinfoModel p = new ProjectinfoModel();

            p.Project_Name      = this.tbusername.Text;
            Session["username"] = this.tbusername.Text;
            p.Project_Money     = decimal.Parse(this.tbusermoney.Text);
            //筹集天数
            p.Raise_day        = int.Parse(this.tbuserdays.Text);
            Session["day"]     = p.Raise_day;
            p.Project_Type     = this.RadioButtonList1.SelectedItem.Text;
            p.Project_Province = this.DropDownList1.Text;
            p.Project_City     = this.DropDownList2.Text;
            p.Project_cover    = this.Label3.Text;
            p.Video            = this.tbuservideo.Text;
            p.Project_brief    = this.tbuserjianjie.Text;
            p.Project_Details  = this.tbuserxiangqing.Text;
            p.Label            = this.tbuserbiaoqiao.Text;
            if (ProjectinfoBLL.Add(p))
            {
                Response.Redirect("return.aspx");
            }
            else
            {
                Response.Write("<script>alert('添加失败')</script>");
            }
        }
        public static bool Add(ProjectinfoModel p)
        {
            string sql = string.Format(@"insert into ProjectInfo values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}')"
                                       , p.Project_Name, p.Project_Money, p.Raise_day, p.Project_Type, p.Project_Province, p.Project_City, p.Project_cover, p.Project_Details, p.Label, "", p.Project_brief, p.Video);

            return(DBHelper.Update(sql));
        }
 public static bool Add(ProjectinfoModel p)
 {
     return(ProjectinfoDAL.Add(p));
 }