예제 #1
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text.Trim() == "")
     {
         ComTool.Alert("请输入设备编号");
     }
     else if (TextBox2.Text.Trim() == "")
     {
         ComTool.Alert("请输入管理员姓名!");
     }
     else if (TextBox3.Text.Trim() == "")
     {
         ComTool.Alert("请输入维修日期!");
     }
     else
     {
         Equiprecord obj = new Equiprecord();
         obj.equipid    = Convert.ToInt64(TextBox1.Text);
         obj.adminname  = TextBox2.Text;
         obj.recorddate = DateTime.Parse(TextBox3.Text);
         if (Equiprecord.insertRecord(obj) == 1)
         {
             ComTool.Alert("新增成功!");
             ComTool.Redirect("recordview.aspx");
         }
         else
         {
             ComTool.Alert("新增失败!");
         }
     }
 }
예제 #2
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text.Trim() == "")
     {
         ComTool.Alert("请输入设备编号!");
     }
     else if (TextBox2.Text.Trim() == "")
     {
         ComTool.Alert("请输入设备状态!");
     }
     else
     {
         huiyi obj = new huiyi();
         obj.huiyiname = TextBox1.Text;
         obj.yuyue     = TextBox2.Text;
         if (huiyi.updateRecord(obj) == 1)
         {
             ComTool.Alert("更新成功!");
             ComTool.Redirect("huiyiListListM.aspx");
         }
         else
         {
             ComTool.Alert("更新失败!");
         }
     }
 }
예제 #3
0
    protected void B1Click(object sender, EventArgs e)
    {
        if (hyname.Text.Trim() == "")
        {
            ComTool.Alert("请输入会议室名!");
        }
        else if (shijian.Text.Trim() == "")
        {
            ComTool.Alert("请输入预约时间 !");
        }
        else
        {
            yuyuehuiyi obj = searchCon();

            if (obj.yuyue == "0")
            {
                int i = yuyuehuiyi.insertshenqingRecord(obj);
                if (i != 0)
                {
                    ComTool.Alert("预约单提交成功!等待管理员审核!");

                    ComTool.Redirect("huiyiList.aspx");
                }
                else
                {
                    ComTool.Alert("预约单提交失败!请再次提交!");
                }
            }

            else
            {
                ComTool.Alert("会议室已被他人预约!");
            }
        }
    }
예제 #4
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string    j       = GridView1.DataKeys[e.RowIndex].Value.ToString();
        string    sqlstr  = "delete from magazine where magazineId='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
        string    sqlstr1 = "delete from article where magazineId='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
        string    sqlstr2 = "delete from upImage where magazineId='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
        string    sqlstr3 = "select* from upImage where magazineId='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
        DataTable dt      = DBOper.execQueryBySQLText(sqlstr3);

        for (int k = 0; k < dt.Rows.Count; k++)
        {
            string path1 = dt.Rows[k]["savepath"].ToString();
            File.Delete(path1);
        }
        int i = DBOper.execNonQueryBySQLText(sqlstr2);

        i = DBOper.execNonQueryBySQLText(sqlstr1);
        if (DBOper.execNonQueryBySQLText(sqlstr) == 1)
        {
            BindData(searchCon());
        }
        else
        {
            ComTool.Alert("删除失败");
        }
        string dePath = "./image/" + j + "/";
        string path   = Server.MapPath(dePath);

        Directory.Delete(path);
    }
예제 #5
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (tbxManagerName.Text.Trim() == "")
     {
         ComTool.Alert("请输入用户名!");
     }
     else if (tbxManagerPWD.Text.Trim() == "")
     {
         ComTool.Alert("请输入密码!");
     }
     else if (tbxManagerTel.Text.Trim() == "")
     {
         ComTool.Alert("请输入联系方式!");
     }
     else
     {
         Manager obj = new Manager();
         obj.managername = tbxManagerName.Text;
         obj.managerpwd  = tbxManagerPWD.Text;
         obj.telephone   = tbxManagerTel.Text;
         if (Manager.selectDataTable(obj).Rows.Count == 0 && Manager.insertRecord(obj) == 1)
         {
             ComTool.Alert("注册成功!");
             ComTool.Redirect("DefaultM.aspx");
         }
         else
         {
             ComTool.Alert("用户名已存在!");
         }
     }
 }
예제 #6
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (tbxUserName.Text.Trim() == "")
     {
         ComTool.Alert("请输入会议室名称!");
     }
     else if (tbxUserPWD.Text.Trim() == "")
     {
         ComTool.Alert("请输入会议室位置!");
     }
     else if (TextBox2.Text.Trim() == "")
     {
         ComTool.Alert("请输入会议室状态!");
     }
     else
     {
         huiyi obj = new huiyi();
         obj.huiyiname = tbxUserName.Text;
         obj.didian    = tbxUserPWD.Text;
         obj.yuyue     = TextBox2.Text;
         if (huiyi.insertRecord(obj) == 1)
         {
             ComTool.Alert("新增成功!");
             ComTool.Redirect("huiyiListM.aspx");
         }
         else
         {
             ComTool.Alert("新增失败!");
         }
     }
 }
예제 #7
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text.Trim() == "")
     {
         ComTool.Alert("请输入设备编号!");
     }
     else if (TextBox2.Text.Trim() == "")
     {
         ComTool.Alert("请输入设备状态!");
     }
     else
     {
         Equip obj = new Equip();
         obj.equipcode = TextBox1.Text;
         obj.status    = TextBox2.Text;
         if (Equip.updateRecord(obj) == 1)
         {
             ComTool.Alert("更新成功!");
             ComTool.Redirect("EquipListM.aspx");
         }
         else
         {
             ComTool.Alert("更新失败!");
         }
     }
 }
예제 #8
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (tbxUserName.Text.Trim() == "")
     {
         ComTool.Alert("请输入用户名!");
     }
     else if (tbxUserPWD.Text.Trim() == "")
     {
         ComTool.Alert("请输入密码!");
     }
     else
     {
         Users obj = new Users();
         obj.username = tbxUserName.Text;
         obj.userpwd  = tbxUserPWD.Text;
         if (Users.selectDataTable(obj).Rows.Count == 0 && Users.insertRecord(obj) == 1)
         {
             ComTool.Alert("注册成功!");
             ComTool.Redirect("Default.aspx");
         }
         else
         {
             ComTool.Alert("用户名已存在!");
         }
     }
 }
예제 #9
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (tbxUserName.Text.Trim() == "")
     {
         ComTool.Alert("请输入用户名!");
     }
     else if (tbxUserPWD.Text.Trim() == "")
     {
         ComTool.Alert("请输入密码!");
     }
     else
     {
         Users obj = new Users();
         obj.username = tbxUserName.Text;
         obj.userpwd  = tbxUserPWD.Text;
         if (Users.insertRecord(obj) == 1)
         {
             ComTool.Alert("新增成功!");
         }
         else
         {
             ComTool.Alert("新增失败!");
         }
     }
 }
예제 #10
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string str = "delete from users where userId='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";

        if (DBOper.execNonQueryBySQLText(str) == 1)
        {
            BindData(searchCon());
        }
        else
        {
            ComTool.Alert("删除失败");
        }
    }
예제 #11
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Users obj = new Users();

        obj.username = TextBox1.Text;
        obj.userpwd  = TextBox2.Text;
        if (Users.ifLogin(obj))
        {
            ComTool.Redirect("UsersList.aspx");
        }
        else
        {
            ComTool.Alert("用户名或密码错误!");
        }
    }
예제 #12
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string    str  = "delete from upImage where imageId='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
        string    str1 = "select * from upImage where imageId='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
        DataTable dt   = DBOper.execQueryBySQLText(str1);
        string    path = dt.Rows[0]["savepath"].ToString();

        if (DBOper.execNonQueryBySQLText(str) == 1)
        {
            BindData(searchCon());
        }
        else
        {
            ComTool.Alert("删除失败");
        }
        File.Delete(path);
    }
예제 #13
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        string sqlstr = "update users set username='******',password='******' where userId='"
                        + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";

        if (DBOper.execNonQueryBySQLText(sqlstr) == 1)
        {
            GridView1.EditIndex = -1;
            BindData(searchCon());
        }
        else
        {
            ComTool.Alert("更新失败");
        }
    }
예제 #14
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        myUser obj = new myUser();

        obj.username  = UserName.Text.Trim();
        obj.userkey   = Password.Text.Trim();
        obj.userphone = Phone.Text.Trim();
        if (myUser.selectDataTable(obj).Rows.Count != 0)
        {
            ComTool.Alert("注册失败,该用户名已存在!");
        }
        else if (myUser.insertRecord(obj) == 1)
        {
            ComTool.Alert("注册成功!");
            ComTool.Redirect(" Default.aspx");
        }
    }
예제 #15
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");
        }
    }
예제 #16
0
    protected void btnlook_Click(object sender, EventArgs e)
    {
        string    sqllookupT = "select TValue from 汇总表";
        DataTable DTC        = DBOper.execQueryBySQLText(sqllookupT);

        if (DTC.Rows.Count > 0)
        {
            txtteacher.Text = DTC.Rows[0]["TValue"].ToString();
        }
        string    sqllookupS = "select SValue from 汇总表";
        DataTable DSUC       = DBOper.execQueryBySQLText(sqllookupS);

        if (DSUC.Rows.Count > 0)
        {
            txtstudent.Text = DSUC.Rows[0]["SValue"].ToString();
        }
        ComTool.Alert("第" + txtgroup.Text + "组的教师评委评分为:" + txtteacher.Text + "第" + txtgroup.Text + "组的学生评委评分为:" + txtstudent.Text);
    }
예제 #17
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (UserName.Text.Trim() == "")
     {
         ComTool.Alert("请输入用户名!");
     }
     else if (Password.Text.Trim() == "")
     {
         ComTool.Alert("请输入密码!");
     }
     else
     {
         if (Int32.Parse(DropDownList1.SelectedItem.Value) == 0)
         {
             Admin obj = new Admin();
             obj.adminname = UserName.Text;
             obj.adminkey  = Password.Text;
             if (Admin.ifLogin(obj))
             {
                 ComTool.Alert("登陆成功!");
                 ComTool.Redirect("aroomstate.aspx");
             }
             else
             {
                 ComTool.Alert("登陆失败!");
             }
         }
         else if (Int32.Parse(DropDownList1.SelectedItem.Value) == 1)
         {
             myUser obj = new myUser();
             obj.username = UserName.Text;
             obj.userkey  = Password.Text;
             if (myUser.ifLogin(obj))
             {
                 ComTool.Alert("登陆成功!");
                 ComTool.Redirect("uroomstate.aspx");
             }
             else
             {
                 ComTool.Alert("登陆失败!");
             }
         }
     }
 }
예제 #18
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (TextBox1.Text.Trim() == "")
        {
            ComTool.Alert("请输入文章编号!");
        }
        else if (TextBox2.Text.Trim() == "")
        {
            ComTool.Alert("请输入文章名称!");
        }
        else if (TextBox4.Text.Trim() == "")
        {
            ComTool.Alert("请输入作者!");
        }

        else if (TextBox6.Text.Trim() == "")
        {
            ComTool.Alert("请输入权限!");
        }
        else if (DropDownList1.SelectedValue.Trim() == "")
        {
            ComTool.Alert("请输入期刊编号!");
        }
        else
        {
            Article obj = new Article();
            obj.articleId    = TextBox1.Text;
            obj.articleName  = TextBox2.Text;
            obj.articleKey   = TextBox3.Text;
            obj.author       = TextBox4.Text;
            obj.adescription = TextBox5.Text;
            obj.limits       = TextBox6.Text;
            obj.magazineId   = DropDownList1.SelectedValue;
            if (Article.insertRecord(obj) == 1)
            {
                ComTool.Alert("新增成功!");
            }
            else
            {
                ComTool.Alert("新增失败!");
            }
        }
    }
예제 #19
0
    protected void btnScoreAgain_Click(object sender, EventArgs e)
    {
        string    STRC   = "";
        string    strSQL = "select TransID from 传值表";
        DataTable DDT    = DBOper.execQueryBySQLText(strSQL);

        if (DDT.Rows.Count > 0)
        {
            STRC = DDT.Rows[0]["TransID"].ToString();
        }
        if (STRC == txtgroup.Text)
        {
            ComTool.Alert("尚未创建新组,请稍后!");
        }
        else
        {
            ComTool.Redirect("Score.aspx?A=" + txtCNO.Text);
        }
    }
예제 #20
0
 protected void ADSubmit_Click(object sender, EventArgs e)
 {
     if (txtADRID.Text.Trim() == "" || txtADRPwd.Text.Trim() == "" || txtADRPwdAgain.Text.Trim() == "")
     {
         ComTool.Alert("请输入全部注册信息后点击登录!");
     }
     else if (txtADRPwd.Text.Trim() != txtADRPwdAgain.Text.Trim())
     {
         ComTool.Alert("您两次输入密码不一致,请重新输入!");
     }
     else
     {
         string strSQL = "insert into 管理员表(AdminID,AdminPwd) values('" + txtADRID.Text + "','" + txtADRPwd.Text + "')";
         if (DBOper.execNonQueryBySQLText(strSQL) == 1)//调用公共类
         {
             ComTool.Redirect("AdminLogin.aspx");
         }
     }
 }
예제 #21
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtCID.Text.Trim() == "" || txtPwd.Text.Trim() == "" || txtPwdAgain.Text.Trim() == "" || txtAge.Text.Trim() == "" || rdlRole.SelectedValue.Trim() == "" || txtUserName.Text.Trim() == "")
     {
         ComTool.Alert("请输入全部注册信息后点击登录!");
     }
     else if (txtPwd.Text.Trim() != txtPwdAgain.Text.Trim())
     {
         ComTool.Alert("您两次输入密码不一致,请重新输入!");
     }
     else
     {
         string strSQL = "insert into 用户表(URID,CID,Name,Pwd) values('" + rdlRole.SelectedValue + "','" + txtCID.Text + "','" + txtUserName.Text + "','" + txtPwd.Text + "')";
         if (DBOper.execNonQueryBySQLText(strSQL) == 1)//调用公共类
         {
             ComTool.Redirect("Login.aspx");
         }
     }
 }
예제 #22
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Users obj = new Users();

        obj.username = TextBox1.Text;
        obj.userpwd  = TextBox2.Text;
        if (Users.ifLogin(obj))
        {
            ComTool.Redirect("ManagerList.aspx");
        }
        else if (Users.selectDataTable(obj).Rows.Count == 0)
        {
            ComTool.Alert("用户名未注册,请先注册!");
        }
        else
        {
            ComTool.Alert("密码错误!");
        }
    }
예제 #23
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        string sqlstr = "update upImage set magazineId='"
                        + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim() + "',articleId='"
                        + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim() + "',sequence='"
                        + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text.ToString().Trim() + "',imageDesc='"
                        + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0])).Text.ToString().Trim() + "',uptime='"
                        + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[5].Controls[0])).Text.ToString().Trim() + "' where imageId='"
                        + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";

        if (DBOper.execNonQueryBySQLText(sqlstr) == 1)
        {
            GridView1.EditIndex = -1;
            BindData(searchCon());
        }
        else
        {
            ComTool.Alert("更新失败");
        }
    }
예제 #24
0
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        string sqlstr = "update article set articleName='"
                        + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim() + "',articleKey='"
                        + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text.ToString().Trim() + "',author='"
                        + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0])).Text.ToString().Trim() + "',adescription='"
                        + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[5].Controls[0])).Text.ToString().Trim() + "',limits='"
                        + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[6].Controls[0])).Text.ToString().Trim() + "',magazineId='"
                        + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[7].Controls[0])).Text.ToString().Trim() + "' where articleId='"
                        + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";

        if (DBOper.execNonQueryBySQLText(sqlstr) == 1)
        {
            GridView1.EditIndex = -1;
            BindData(searchCon());
        }
        else
        {
            ComTool.Alert("更新失败");
        }
    }
예제 #25
0
    protected void btnLog_Click(object sender, EventArgs e)
    {
        if (txtADRID.Text.Trim() == "" || txtADRPwd.Text.Trim() == "")
        {
            ComTool.Alert("请输账号或密码!");
        }
        else
        {
            bool   blRet  = false;
            string strSQL = "select * from 管理员表 where AdminID='" + txtADRID.Text + "'"
                            + " and AdminPwd='" + txtADRPwd.Text + "'";

            DataTable 管理员表 = DBOper.execQueryBySQLText(strSQL);
            try
            {
                if (管理员表.Rows.Count > 0)
                {
                    blRet = true;
                }
                else
                {
                    blRet = false;
                }
            }
            catch
            {
                blRet = false;
            }
            if (blRet)
            {
                ComTool.Redirect("DesGroup.aspx");
            }
            else
            {
                ComTool.Alert("学/工号或密码错误!");
            }
        }
    }
예제 #26
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (txtUserName.Text.Trim() == "" || txtPwd.Text.Trim() == "")
        {
            ComTool.Alert("请输入学/工号或密码!");
        }
        else
        {
            bool   blRet  = false;
            string strSQL = "select * from 用户表 where CID='" + txtUserName.Text + "'"
                            + " and pwd='" + txtPwd.Text + "'";

            DataTable 用户表 = DBOper.execQueryBySQLText(strSQL);
            try
            {
                if (用户表.Rows.Count > 0)
                {
                    blRet = true;
                }
                else
                {
                    blRet = false;
                }
            }
            catch
            {
                blRet = false;
            }
            if (blRet)
            {
                ComTool.Redirect("Score.aspx?A=" + txtUserName.Text);    //明文参数传值,不安全。
            }
            else
            {
                ComTool.Alert("学/工号或密码错误!");
            }
        }
    }
예제 #27
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text.Trim() == "")
     {
         ComTool.Alert("请输入期刊编号!");
     }
     else if (TextBox2.Text.Trim() == "")
     {
         ComTool.Alert("请输入期刊名称!");
     }
     else if (TextBox3.Text.Trim() == "")
     {
         ComTool.Alert("请输入期刊描述!");
     }
     else if (TextBox4.Text.Trim() == "")
     {
         ComTool.Alert("请输入关键字!");
     }
     else
     {
         Magazine obj = new Magazine();
         obj.magazineId   = TextBox1.Text;
         obj.magazineName = TextBox2.Text;
         obj.mdescription = TextBox3.Text;
         obj.magazineKey  = TextBox4.Text;
         if (Magazine.insertRecord(obj) == 1)
         {
             ComTool.Alert("新增成功!");
         }
         else
         {
             ComTool.Alert("新增失败!");
         }
         string crPath = "./image/" + obj.magazineId + "/";
         string path   = Server.MapPath(crPath);
         Directory.CreateDirectory(path);
     }
 }
예제 #28
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string    sqlstr1 = "delete from article where articleId='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
        string    sqlstr2 = "delete from upImage where articleId='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
        string    sqlstr3 = "select* from upImage where articleId='" + GridView1.DataKeys[e.RowIndex].Value.ToString() + "'";
        DataTable dt      = DBOper.execQueryBySQLText(sqlstr3);

        for (int j = 0; j < dt.Rows.Count; j++)
        {
            string path = dt.Rows[j]["savepath"].ToString();
            File.Delete(path);
        }
        int i = DBOper.execNonQueryBySQLText(sqlstr2);

        if (DBOper.execNonQueryBySQLText(sqlstr1) == 1)
        {
            BindData(searchCon());
        }
        else
        {
            ComTool.Alert("删除失败");
        }
    }
예제 #29
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text.Trim() == "")
     {
         ComTool.Alert("请输入设备编号!");
     }
     else if (tbxUserName.Text.Trim() == "")
     {
         ComTool.Alert("请输入设备名称!");
     }
     else if (tbxUserPWD.Text.Trim() == "")
     {
         ComTool.Alert("请输入设备所在位置!");
     }
     else if (TextBox2.Text.Trim() == "")
     {
         ComTool.Alert("请输入设备状态!");
     }
     else
     {
         Equip obj = new Equip();
         obj.equipcode = TextBox1.Text;
         obj.equipname = tbxUserName.Text;
         obj.location  = tbxUserPWD.Text;
         obj.status    = TextBox2.Text;
         if (Equip.selectcon(obj).Rows.Count == 0 && Equip.insertRecord(obj) == 1)
         {
             ComTool.Alert("新增成功!");
             ComTool.Redirect("EquipListM.aspx");
         }
         else
         {
             ComTool.Alert("编号重复!");
         }
     }
 }
예제 #30
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("预约失败!");
         }
     }
 }