/// <summary> /// 根据会场名称查询会场安排信息 /// </summary> /// <param name="roomName"></param> /// <returns></returns> public IList <RoomArrage> SearchRoomArrageStateByRoomName(string roomName) { IList <RoomArrage> list = new List <RoomArrage>(); string sql = "usp_SearchRoomArrageStateByRoomName"; using (DataTable dt = DBHelper.GetDataTableProc(sql, new SqlParameter("@RoomName", (roomName == null)?"":roomName))) { foreach (DataRow row in dt.Rows) { RoomArrage roomArrage = new RoomArrage(); roomArrage.Id = Convert.ToInt32(row["RID"]); roomArrage.RoomName = row["RoomName"].ToString(); roomArrage.RomeState = row["RomeState"].ToString(); roomArrage.Remark = row["Remark"].ToString(); roomArrage.InstancyDegree = row["InstancyDegree"].ToString(); roomArrage.ChargeMan = row["ChargeMan"].ToString();// userService.GetAllUserById(Convert.ToInt32(row["ChargeMan"])); roomArrage.MeetingType = row["MeetingType"].ToString(); roomArrage.BeginTime = Convert.ToDateTime(row["BeginTime"]); roomArrage.EndTime = Convert.ToDateTime(row["EndTime"]); list.Add(roomArrage); } } return(list); }
/// <summary> /// 添加会场安排信息 /// </summary> /// <param name="roomArrage"></param> public void AddRoomArrage(RoomArrage roomArrage) { string sql = "usp_addRoomArrage"; SqlParameter[] para = new SqlParameter[] { new SqlParameter("@BeginTime", roomArrage.BeginTime), new SqlParameter("@EndTime", roomArrage.EndTime), new SqlParameter("@RoomName", roomArrage.RoomName), new SqlParameter("@MeetingType", roomArrage.MeetingType), new SqlParameter("@RomeState", roomArrage.RomeState), new SqlParameter("@ChargeMan", roomArrage.ChargeMan), new SqlParameter("@InstancyDegree", roomArrage.InstancyDegree), new SqlParameter("@Remark", roomArrage.Remark) }; DBHelper.ExecuteNonQueryProc(sql, para); }
/// <summary> /// 修改/添加会议申请 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { MeetingApplication meetApplication = new MeetingApplication(); meetApplication.RoomInfo.RID = Convert.ToInt32(ddlRoomName.SelectedValue); meetApplication.MeetTitle = txtMeetTitle.Text; meetApplication.MeetContent = Server.HtmlDecode(txtContent.Value); meetApplication.MeetingSummary = txtsummary.Text; meetApplication.MeetNumber = int.Parse(txtMeetNumber.Value); meetApplication.InstancyDegree = ddlInstancyDegree.SelectedItem.Text; meetApplication.MeetType = txtMeetTitle.Text; meetApplication.BeginTime = Convert.ToDateTime(txtbeginTime.Value + " " + sHours.Value + ":" + sSecond.Value); meetApplication.EndTime = Convert.ToDateTime(txtendTime.Value + " " + sHourse2.Value + ":" + sSecond2.Value); meetApplication.Compere = txtcompere.Text; meetApplication.DepartmentID.Id = Convert.ToInt32(ddlDepartment.SelectedValue); meetApplication.WithinEnlistMan = "admin"; //与会人员 meetApplication.ApplicationTime = DateTime.Now; meetApplication.State = "未召开"; meetApplication.RoomInfo.RID = Convert.ToInt32(ddlRoomName.SelectedValue); UserInfo user = Session["user"] as UserInfo; meetApplication.ApplicationMan = "admin";//申请人为当前登录用户 meetApplication.ApplicationTime = DateTime.Now; //为修改 if (mid > 0) { try { meetApplication.MID = mid; //调用方法更新会议申请单 MeetingApplicationManager.UpdateMeetintApplication(meetApplication); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('更新成功');window.location='ApplictionMeetingList.aspx'</script>"); } catch (Exception) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('更新失败')", true); return; } } else //为添加会议申请及会场安排信息 { RoomArrage roomArrage = new RoomArrage(); roomArrage.BeginTime = Convert.ToDateTime(txtbeginTime.Value + " " + sHours.Value + ":" + sSecond.Value); //开始时间 roomArrage.EndTime = Convert.ToDateTime(txtendTime.Value + " " + sHourse2.Value + ":" + sSecond2.Value); //结束时间 roomArrage.ChargeMan = "admin"; //会议负责人 roomArrage.InstancyDegree = ddlInstancyDegree.SelectedItem.Text; roomArrage.MeetingType = txtMeetTitle.Text; //会议类型 roomArrage.RomeState = "占用中"; //会场状态 roomArrage.RoomName = ddlRoomName.SelectedItem.Text; //会场名称 roomArrage.Remark = txtContent.Value; try { //新增会议申请 MeetingApplicationManager.AddMeetingApplication(meetApplication); //新增会场安排信息 RoomArrageManager.AddRoomArrage(roomArrage); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('新增成功');window.location='ApplictionMeetingList.aspx'</script>"); } catch (Exception) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('新增失败')", true); return; } } }
/// <summary> /// 添加会场安排信息 /// </summary> /// <param name="roomArrage"></param> public static void AddRoomArrage(RoomArrage roomArrage) { roomArrageService.AddRoomArrage(roomArrage); }