public static int deleteshenqingRecord(yuyuehuiyi obj) { string strSQL = "delete from shenqinghuiyi where huiyiname='" + obj.huiyiname + "'"; int iRet = DBOper.execNonQueryBySQLText(strSQL); return(iRet); }
//public static int delRecord(yuyuehuiyi obj) //{ // string strSQL = "delete from shenqinghuiyi where huiyiid='" + obj.huiyiid + "'"; // int iRet = DBOper.execNonQueryBySQLText(strSQL); // return iRet; //} public static int updateshenheRecord(yuyuehuiyi obj) { string strSQL = "update shenqinghuiyi set shenhe='" + "1" + "' where huiyiname='" + obj.huiyiname + "'"; int iRet = DBOper.execNonQueryBySQLText(strSQL); return(iRet); }
public static DataTable huiyishenqingqb(yuyuehuiyi hy) { string str = "select * from shenqinghuiyi where 1=1 "; DataTable dt = DBOper.execQueryBySQLText(str); return(dt); }
public static int insertshenqingRecord(yuyuehuiyi obj) { string strSQL = "insert into shenqinghuiyi(huiyiname,shijian,shenhe) values('" + obj.huiyiname + "','" + obj.shijian + "','" + "0" + "')"; int iRet = DBOper.execNonQueryBySQLText(strSQL); return(iRet); }
private void BindData(yuyuehuiyi obj) { DataTable dt = yuyuehuiyi.selecthuiyishenqing(obj); gvcourse.DataSource = dt; gvcourse.DataBind(); }
private void BindData2(yuyuehuiyi obj) { DataTable dt = yuyuehuiyi.selectyuyueshijian(obj); gvcourse.DataSource = dt; gvcourse.DataBind(); }
private yuyuehuiyi searchCon2() { yuyuehuiyi obj = new yuyuehuiyi(); obj.shijian = TB2.Text.Trim(); return(obj); }
private yuyuehuiyi searchCon1() { yuyuehuiyi obj = new yuyuehuiyi(); obj.huiyiname = TB.Text.Trim(); return(obj); }
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("会议室已被他人预约!"); } } }
private void BindData3() { yuyuehuiyi obj = new yuyuehuiyi(); DataTable dt = yuyuehuiyi.huiyishenqingqb(obj); gvcourse.DataSource = dt; gvcourse.DataBind(); } //申请表全部
public static DataTable selectyuyueshijian(yuyuehuiyi hy) { string str = "select * from tbhuiyi where 1=1 "; if (hy.shijian != "" && hy.shijian != null) { str = str + "and shijian='" + hy.shijian + "'"; } DataTable dt = DBOper.execQueryBySQLText(str); return(dt); }
public static DataTable selectshenhe(yuyuehuiyi hy) { string str = "select * from shenqinghuiyi where 1=1 "; if (hy.shenhe != "" && hy.shenhe != null) { str = str + "and shenhe='" + hy.shenhe + "'"; } DataTable dt = DBOper.execQueryBySQLText(str); return(dt); }
//private void BindData4(yuyuehuiyi obj) //{ // DataTable dt = yuyuehuiyi.update(obj); // gvcourse.DataSource = dt; // gvcourse.DataBind(); //} protected void gvcourse_RowCommand(object sender, GridViewCommandEventArgs e) { huiyi hy = new huiyi(); hy.huiyiname = e.CommandArgument.ToString(); huiyi.updateRecord(hy);//yuyue=1 BindData5(hy); yuyuehuiyi obj = new yuyuehuiyi(); obj.huiyiname = e.CommandArgument.ToString(); yuyuehuiyi.updateshenheRecord(obj); BindData(obj); }
private yuyuehuiyi searchCon() { huiyi h = new huiyi(); h.huiyiname = hyname.Text.Trim(); DataTable da = huiyi.selecthuiyi(h); yuyuehuiyi obj = new yuyuehuiyi(); obj.huiyiname = hyname.Text.Trim(); obj.shijian = shijian.Text.Trim(); obj.yuyue = (string )da.Rows[0][2]; return(obj); }
protected void lbtndel_Click(object sender, EventArgs e) { for (int i = 0; i < gvcourse.Rows.Count; i++) { CheckBox cb = (CheckBox)gvcourse.Rows[i].FindControl("cbsel"); if (cb.Checked) { string name = gvcourse.DataKeys[i].Value.ToString(); yuyuehuiyi myhuiyi = new yuyuehuiyi(); myhuiyi.huiyiname = name; yuyuehuiyi.deleteshenqingRecord(myhuiyi); BindData(myhuiyi); huiyi huiy = new huiyi(); huiy.huiyiname = name; huiyi.quxiaoRecord(huiy); BindData5(huiy); } } }