} // function DelARecord /// <summary> /// 会议管理员向会议使用资源表添加一条记录 /// </summary> /// <param name="useRsc">使用资源实体类的实例化对象</param> /// <returns>true:添加成功;false:添加失败</returns> public bool AddConUseResource(ConUseResourceModel useRsc) { try { ConUseResourceDAL CURD = new ConUseResourceDAL(); CURD.AddARecord(useRsc); return(true); } catch { return(false); } } // function AddConUseResource
}// function GetBoardroomInfo /// <summary> /// 申请会议 /// </summary> /// <param name="conferenceInfo">会议信息</param> /// <param name="resource">资源设备编号信息</param> /// <returns>是否成功申请</returns> /// 作者:王宇昊 /// 创建时间:2014-09-18 /// 修改时间: /// /// public int ConApply(ConferenceModel conferenceInfo, List <string> resource) { try { ConferenceDAL ConDAL = new ConferenceDAL(); ConUseResourceDAL CURDAL = new ConUseResourceDAL(); ConUseResourceModel CURM = new ConUseResourceModel(); // ResourceDAL RDAL = new ResourceDAL(); ResourceModel RMODEL = new ResourceModel(); int CId = ConDAL.AddARecordReturnId(conferenceInfo);//返回会议的ID if (CId != -1) { foreach (string DeviceId in resource) { CURM.ConId = CId; CURM.DeviceId = Convert.ToInt32(DeviceId); CURDAL.AddARecord(CURM); // 将资源表中的状态标志改为1,被预订 RMODEL.ResourceId = Convert.ToInt32(DeviceId); RMODEL.ResourceStatus = '1'; RDAL.UpdateAStatus(RMODEL); } return(CId); } else { return(-1); } } catch (Exception ex) { throw new Exception(ex.Message); } }// function ConApply