Example #1
0
    public static int insertRecord(roomBook obj)
    {
        string strSQL = "insert into roombook(username,roomid,begintime,endtime) values('" + obj.username + "','" + obj.roomid + "','" + obj.begintime + "','" + obj.endtime + "')";
        int    iRet   = DBOper.execNonQueryBySQLText(strSQL);

        return(iRet);
    }
Example #2
0
    public static int deleteRecord(roomBook obj)
    {
        string strSQL = "delete from roombook where username='******' and roomid = '" + obj.roomid + "' and begintime = '" + obj.begintime + "' and endtime = '" + obj.endtime + "'";
        int    iRet   = DBOper.execNonQueryBySQLText(strSQL);

        return(iRet);
    }
Example #3
0
    public static DataTable selectDataTable(roomBook obj)
    {
        string strSQL = "select roomid,roomnum from room where roomid in(select roomid from roombook where ( datediff(s,begintime, '" + obj.begintime + "' )<0)and(datediff(s,endtime,'" + obj.begintime + "')>0)and (datediff(s,begintime,'" + obj.endtime + "')<0) and (datediff(s,endtime,'" + obj.endtime + "')>0))";
        //string strSQL = "select * from room where roomid in (select)"
        //string strSQL = "select * from room where 1=1 ";
        //if (obj.begintime != "" && obj.username != null)
        //    strSQL = strSQL + "and ='" + obj.username + "'";
        //string strSQL = "select roomid,roomnum from room";
        DataTable dt = DBOper.execQueryBySQLText(strSQL);

        return(dt);
    }
Example #4
0
    protected void gvcourse_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        roomBook obj = new roomBook();
        int      i   = roomBook.updateRecord(" update roombook set review='true' where bookid=" + e.CommandArgument.ToString());
        int      j   = roomBook.updateRecord(" update roombook set adminname='管理员' where bookid=" + e.CommandArgument.ToString());

        if (i == 1 & j == 1)
        {
            ComTool.Alert("审核成功!");
            BindData1();
            ComTool.Redirect("bookreview.aspx");
        }
        else
        {
            ComTool.Alert("审核失败!");
            ComTool.Redirect("bookreview.aspx");
        }
    }
Example #5
0
 protected void add_Click(object sender, EventArgs e)
 {
     if (TextBox3.Text.Trim() == "")
     {
         ComTool.Alert("请输入用户名!");
     }
     else if (TextBox4.Text.Trim() == "")
     {
         ComTool.Alert("请输入要预约的会议室!");
     }
     else if (TextBox1.Text.Trim() == "")
     {
         ComTool.Alert("请输入会议开始时间!");
     }
     else if (TextBox2.Text.Trim() == "")
     {
         ComTool.Alert("请输入会议结束时间!");
     }
     else
     {
         roomBook obj = new roomBook();
         obj.username  = TextBox3.Text;
         obj.roomid    = TextBox4.Text;
         obj.begintime = DateTime.Parse(TextBox1.Text);
         obj.endtime   = DateTime.Parse(TextBox2.Text);
         if (roomBook.insertRecord(obj) == 1)
         {
             ComTool.Alert("预约成功!");
             ComTool.Redirect("bookview.aspx");
         }
         else
         {
             ComTool.Alert("预约失败!");
         }
     }
 }