예제 #1
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string cmdType = e.CommandName;

            baoid = Convert.ToInt32(e.CommandArgument);

            if (cmdType == "update")
            {
                int result = bll.update(Convert.ToInt32(baoid));
                if (result > 0)
                {
                    ClientScript.RegisterStartupScript(GetType(), "", "alert('处理成功');window.location='baoxiu.aspx';", true);
                    baoxiuModel ss = bll.getbaoxiu(Convert.ToInt32(baoid));
                    int         s  = ss.ischuli;
                    if (s == 1)
                    {
                        LinkButton link = e.Item.FindControl("LinkButton1") as LinkButton;
                        link.Enabled = false;
                    }
                    return;
                    //Response.Redirect("tousu.aspx");
                }
                else
                {
                    Response.Write("<script>alert('处理失败!')</script>");
                    return;
                }
            }
        }
예제 #2
0
파일: LBH-DAL.cs 프로젝트: Yangshen888/JDGL
        public List <baoxiuModel> getbaoxiu()
        {
            string             sql    = "select * from [JDGL].[dbo].[baoxiu]";
            SqlDataReader      reader = SqlHelper.QueryReader(sql);
            List <baoxiuModel> users  = new List <baoxiuModel>();

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    baoxiuModel model = new baoxiuModel();
                    model.baoid      = Convert.ToInt32(reader["baoid"]);
                    model.baoname    = reader["baoname"].ToString();
                    model.baofang    = Convert.ToInt32(reader["baofang"]);
                    model.wupin      = reader["wupin"].ToString();
                    model.shijian    = reader["shijian"].ToString();
                    model.ischuli    = Convert.ToInt32(reader["ischuli"]);
                    model.chushijian = reader["chushijian"].ToString();
                    users.Add(model);
                }
            }
            return(users);
        }
예제 #3
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            if (TextBox2.Text == "")
            {
                ClientScript.RegisterStartupScript(GetType(), "", "alert('请输入您的姓名" +
                                                   "');window.location='insbaoxiu.aspx';", true);
                //Response.Write("<script>alert('请输入您的投诉理由!')</script>");
                return;
            }
            else
            {
                if (TextBox3.Text == "")
                {
                    ClientScript.RegisterStartupScript(GetType(), "", "alert('请输入损坏物品的名称" +
                                                       "');window.location='insbaoxiu.aspx';", true);
                    //Response.Write("<script>alert('请输入您的投诉理由!')</script>");
                    return;
                }
                baoxiuModel model = new baoxiuModel();
                model.baoname = TextBox2.Text;
                model.baofang = Convert.ToInt32(DropDownList2.SelectedItem.Text);
                model.wupin   = TextBox3.Text;
                model.shijian = DateTime.Now.ToString();
                //model.ischuli = Convert.ToInt32("");
                LBH_BLL blll   = new LBH_BLL();
                int     result = 0;
                result = blll.insbaoxiu(model);

                if (result > 0)
                {
                    ClientScript.RegisterStartupScript(GetType(), "", "alert('添加成功');window.location='insbaoxiu.aspx';", true);
                    //Response.Write("<script>alert('保存成功!')</script>");
                    return;
                }
            }
        }
예제 #4
0
파일: LBH-DAL.cs 프로젝트: Yangshen888/JDGL
        public int insbaoxiu(baoxiuModel model)
        {
            string sql = @"insert into [JDGL].[dbo].[baoxiu](baoname,baofang,wupin,shijian,ischuli,chushijian) values (@baoname,@baofang,@wupin,@shijian,@ischuli,null)";
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.Add(new SqlParameter("@baoname", model.baoname));
            parameters.Add(new SqlParameter("@baofang", model.baofang));
            parameters.Add(new SqlParameter("@wupin", model.wupin));
            parameters.Add(new SqlParameter("@shijian", model.shijian));
            parameters.Add(new SqlParameter("@ischuli", model.ischuli));
            //string sqlExist = "select UserID from [Test].[dbo].[UserInfo] where username=@name and isdelete=0";
            //SqlParameter[] sqlp = new SqlParameter[1];
            //sqlp[0] = new SqlParameter("@touname", model.username);
            //object obj = SqlHelper.NoQuery(sqlExist, sqlp);
            int result = 0;

            //if (obj != null)
            //{
            //    result = 100;
            //    return result;
            //}
            result = SqlHelper.NoQuery(sql, parameters.ToArray());
            return(result);
        }
예제 #5
0
 public int insbaoxiu(baoxiuModel model)
 {
     return(dal.insbaoxiu(model));
 }