public string SubmitWaitInfo(AMS.Model.AMS_School school, ClassModel.WaitSeatLogInfo waitInfo) { SeatManage.IPocketBespeakBllService.IPocketBespeakBllService pocketBespeak = BespeakServiceConnProxy.BespeakServiceConnProxy.CreateChannelPocketBespeakBllService(school.ConnectionString); try { return(pocketBespeak.SubmitWaitInfo(waitInfo)); } catch (Exception ex) { throw new RemoteServiceLinkFailed(ex.Message); } finally { ICommunicationObject ICommObjectService = pocketBespeak as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
public ClassModel.StudyBookingLog GetStudyLog(AMS.Model.AMS_School school, int logID) { SeatManage.IPocketBespeakBllService.IPocketBespeakBllService pocketBespeak = BespeakServiceConnProxy.BespeakServiceConnProxy.CreateChannelPocketBespeakBllService(school.ConnectionString); try { return(pocketBespeak.GetStudyLog(logID)); } catch (Exception ex) { throw new RemoteServiceLinkFailed(ex.Message); } finally { ICommunicationObject ICommObjectService = pocketBespeak as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
public bool IsCanWaitSeat(AMS.Model.AMS_School school, string CardNo, string roomNo) { SeatManage.IPocketBespeakBllService.IPocketBespeakBllService pocketBespeak = BespeakServiceConnProxy.BespeakServiceConnProxy.CreateChannelPocketBespeakBllService(school.ConnectionString); try { return(pocketBespeak.IsCanWaitSeat(CardNo, roomNo)); } catch (Exception ex) { throw new RemoteServiceLinkFailed(ex.Message); } finally { ICommunicationObject ICommObjectService = pocketBespeak as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
public string SelectSeat(AMS.Model.AMS_School school, string cardNo, string seatNum, string readingRoomNum) { SeatManage.IPocketBespeakBllService.IPocketBespeakBllService pocketBespeak = BespeakServiceConnProxy.BespeakServiceConnProxy.CreateChannelPocketBespeakBllService(school.ConnectionString); try { return(pocketBespeak.SelectSeat(cardNo, seatNum, readingRoomNum)); } catch (Exception ex) { throw ex; } finally { ICommunicationObject ICommObjectService = pocketBespeak as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
/// <summary> /// 获取读者信息 /// </summary> /// <param name="school"></param> /// <param name="reader"></param> /// <returns></returns> public ClassModel.ReaderInfo GetReaderInfo(AMS.Model.AMS_School school, ClassModel.ReaderInfo reader) { SeatManage.IPocketBespeakBllService.IPocketBespeakBllService pocketBespeak = BespeakServiceConnProxy.BespeakServiceConnProxy.CreateChannelPocketBespeakBllService(school.ConnectionString); try { return(pocketBespeak.GetReaderInfo(reader.CardNo)); } catch (ReaderHandlerFailed ex) { throw ex; } catch (Exception ex) { throw new RemoteServiceLinkFailed(); } finally { ICommunicationObject ICommObjectService = pocketBespeak as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
/// <summary> /// 验证用户信息并把用户信息和学校信息记录到Session /// </summary> /// <param name="user"></param> /// <param name="schoolId"></param> /// <returns></returns> private bool loginHandle(UserInfo user) { //this.UserSchoolInfo = handler.GetSingleSchoolInfo(schoolId); AMS.Model.AMS_School school = new AMS.Model.AMS_School(); school.ConnectionString = ConfigurationManager.ConnectionStrings["ConnStr"].ToString(); this.UserSchoolInfo = school; //ConfigurationSettings.AppSettings["ConnStr"]; if (string.IsNullOrEmpty(this.UserSchoolInfo.ConnectionString)) { return(false); } try { this.LoginUserInfo = handler.CheckAndGetReaderInfo(user, this.UserSchoolInfo); return(true); } catch (RemoteServiceLinkFailed ex) { spanWarmInfo.Visible = true; spanWarmInfo.InnerText = string.Format("连接学校服务器失败,可能是学校已经关闭了服务器的远程访问。"); Session.Clear(); CookiesManager.RemoveCookies("userInfo"); return(false); } catch (Exception ex) { spanWarmInfo.Visible = true; spanWarmInfo.InnerText = string.Format("登录失败:{0}", ex.Message); Session.Clear(); CookiesManager.RemoveCookies("userInfo"); return(false); } }
/// <summary> /// 续时 /// </summary> /// <param name="school"></param> /// <param name="reader"></param> /// <returns></returns> public string DelaySeatUsedTime(AMS.Model.AMS_School school, ReaderInfo reader) { SeatManage.IPocketBespeakBllService.IPocketBespeakBllService pocketBespeak = BespeakServiceConnProxy.BespeakServiceConnProxy.CreateChannelPocketBespeakBllService(school.ConnectionString); try { return(pocketBespeak.DelaySeatUsedTime(reader)); } catch (ReaderHandlerFailed ex) { throw ex; } catch (Exception ex) { throw ex; } finally { ICommunicationObject ICommObjectService = pocketBespeak as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
/// <summary> /// 验证用户信息并把用户信息和学校信息记录到Session /// </summary> /// <param name="user"></param> /// <param name="schoolId"></param> /// <returns></returns> private bool loginHandle(UserInfo user, string schoolId) { this.UserSchoolInfo = new TcpClient_BespeakSeat.TcpClient_Login().GetSingleSchoolInfo(schoolId); this.BespeakHandler = new TcpClient_BespeakSeat.TcpClient_BespeakSeatAllMethod(this.UserSchoolInfo); AMS.Model.AMS_School school = this.UserSchoolInfo; if (school == null) { spanWarmInfo.Visible = true; spanWarmInfo.InnerText = string.Format("获取学校信息失败。"); Session.Clear(); CookiesManager.RemoveCookies("userInfo"); return(false); } try { this.LoginUserInfo = BespeakHandler.CheckAndGetReaderInfo(user, school); return(true); } catch (RemoteServiceLinkFailed ex) { spanWarmInfo.Visible = true; spanWarmInfo.InnerText = string.Format("连接学校服务器失败,可能是学校已经关闭了服务器的远程访问。"); Session.Clear(); CookiesManager.RemoveCookies("userInfo"); return(false); } catch (Exception ex) { spanWarmInfo.Visible = true; spanWarmInfo.InnerText = string.Format("登录失败!"); Session.Clear(); CookiesManager.RemoveCookies("userInfo"); return(false); } }
/// <summary> /// 过去预约记录 /// </summary> /// <param name="school"></param> /// <param name="cardNo"></param> /// <param name="readingRoomID"></param> /// <param name="queryDays"></param> /// <returns></returns> public List <ClassModel.BespeakLogInfo> GetBookLogs(AMS.Model.AMS_School school, string cardNo, string readingRoomID, int queryDays) { SeatManage.IPocketBespeakBllService.IPocketBespeakBllService pocketBespeak = BespeakServiceConnProxy.BespeakServiceConnProxy.CreateChannelPocketBespeakBllService(school.ConnectionString); try { return(pocketBespeak.GetBookLogs(cardNo, readingRoomID, queryDays)); } catch (Exception ex) { throw ex; } finally { ICommunicationObject ICommObjectService = pocketBespeak as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
/// <summary> /// 验证用户信息并把用户信息和学校信息记录到Session /// </summary> /// <param name="user"></param> /// <param name="schoolId"></param> /// <returns></returns> private bool loginHandle(UserInfo user) { //this.UserSchoolInfo = handler.GetSingleSchoolInfo(schoolId); AMS.Model.AMS_School school = new AMS.Model.AMS_School(); school.ConnectionString = ConfigurationManager.ConnectionStrings["ConnStr"].ToString(); this.UserSchoolInfo = school; //ConfigurationSettings.AppSettings["ConnStr"]; if (string.IsNullOrEmpty(this.UserSchoolInfo.ConnectionString)) { return(false); } try { this.LoginUserInfo = handler.CheckAndGetReaderInfo(user, this.UserSchoolInfo); return(true); } catch (RemoteServiceLinkFailed ex) { Session.Clear(); CookiesManager.RemoveCookies("userInfo"); return(false); } catch (Exception ex) { Session.Clear(); CookiesManager.RemoveCookies("userInfo"); return(false); } }
/// <summary> /// 更新预约状态 /// </summary> /// <param name="school"></param> /// <param name="bookNo"></param> /// <returns></returns> public bool UpdateBookLogsState(AMS.Model.AMS_School school, int bookNo) { SeatManage.IPocketBespeakBllService.IPocketBespeakBllService pocketBespeak = BespeakServiceConnProxy.BespeakServiceConnProxy.CreateChannelPocketBespeakBllService(school.ConnectionString); try { return(pocketBespeak.UpdateBookLogsState(bookNo)); } catch (Exception ex) { throw ex; } finally { ICommunicationObject ICommObjectService = pocketBespeak as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
public List <ClassModel.Seat> GetBookSeatList(AMS.Model.AMS_School school, DateTime bespeakDate, string RoomId) { SeatManage.IPocketBespeakBllService.IPocketBespeakBllService pocketBespeak = BespeakServiceConnProxy.BespeakServiceConnProxy.CreateChannelPocketBespeakBllService(school.ConnectionString); try { return(pocketBespeak.GetBookSeatList(bespeakDate, RoomId)); } catch (Exception ex) { throw new RemoteServiceLinkFailed(ex.Message); } finally { ICommunicationObject ICommObjectService = pocketBespeak as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
public List <ClassModel.ReadingRoomInfo> GetReadingRoomUsingUsingState(AMS.Model.AMS_School school) { SeatManage.IPocketBespeakBllService.IPocketBespeakBllService pocketBespeak = BespeakServiceConnProxy.BespeakServiceConnProxy.CreateChannelPocketBespeakBllService(school.ConnectionString); try { return(pocketBespeak.GetReadingRoomUsingUsingState()); } catch (Exception ex) { throw ex; } finally { ICommunicationObject ICommObjectService = pocketBespeak as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(AMS.Model.AMS_School model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into AMS_School("); strSql.Append(" Number,Name,DTUip,Describe,ConnectionString,LinkMan,LinkAddress,ProvinceID,CardInfo,InterfaceInfo,Flag,ExecuteProgress,InstallDate,InstallMan,AppOpen)"); strSql.Append(" values ("); strSql.Append(" @Number,@Name,@DTUip,@Describe,@ConnectionString,@LinkMan,@LinkAddress,@ProvinceID,@CardInfo,@InterfaceInfo,@Flag,@ExecuteProgress,@InstallDate,@InstallMan,@AppOpen)"); SqlParameter[] parameters = { new SqlParameter("@Number", SqlDbType.NVarChar, 50), new SqlParameter("@Name", SqlDbType.NVarChar, 30), new SqlParameter("@DTUip", SqlDbType.NVarChar, 20), new SqlParameter("@Describe", SqlDbType.NVarChar, 200), new SqlParameter("@ConnectionString", SqlDbType.NVarChar, 200), new SqlParameter("@LinkMan", SqlDbType.NVarChar, 300), new SqlParameter("@LinkAddress", SqlDbType.NVarChar, 300), new SqlParameter("@ProvinceID", SqlDbType.Int, 4), new SqlParameter("@CardInfo", SqlDbType.Text), new SqlParameter("@InterfaceInfo", SqlDbType.Text), new SqlParameter("@Flag", SqlDbType.Int, 4), new SqlParameter("@ExecuteProgress", SqlDbType.NVarChar), new SqlParameter("@InstallDate", SqlDbType.DateTime), new SqlParameter("@InstallMan", SqlDbType.NVarChar), new SqlParameter("@AppOpen", SqlDbType.Int) }; parameters[0].Value = model.Number; parameters[1].Value = model.Name; parameters[2].Value = model.DTUip; parameters[3].Value = model.Describe; parameters[4].Value = model.ConnectionString; parameters[5].Value = model.LinkMan; parameters[6].Value = model.LinkAddress; parameters[7].Value = model.ProvinceID; parameters[8].Value = model.CardInfo; parameters[9].Value = model.InterfaceInfo; parameters[10].Value = model.IsSeatBespeak ? 1 : 0; parameters[11].Value = model.ExecuteProgress; parameters[12].Value = model.InstallDate; parameters[13].Value = model.InstallMan; parameters[14].Value = model.AppOpen ? 1 : 0; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 验证客户端连接权限 /// </summary> /// <param name="myHeader"></param> /// <param name="isCheckSchool"></param> /// <returns></returns> public bool CheckSoapHeader(MySoapHeader myHeader, bool isCheckSchool) { return(true); if (!myHeader.UserName.Equals(soapUserName) || !MD5Algorithm.GetMD5Str32(myHeader.PassWord).Equals(soapPwd)) { return(false); } if (!isCheckSchool) { return(true); } AMS.Model.AMS_School school = AMS.ServiceProxy.AMS_SchoolProxy.GetSchoolInfoByNum(myHeader.SchoolNum); return(school != null && school.AppOpen); }
/// <summary> /// 从学校获取读者 信息 /// </summary> /// <param name="user"></param> /// <param name="school"></param> /// <returns></returns> public ClassModel.ReaderInfo CheckAndGetReaderInfo(ClassModel.UserInfo user, AMS.Model.AMS_School school) { SeatManage.IPocketBespeakBllService.IPocketBespeakBllService pocketBespeak = BespeakServiceConnProxy.BespeakServiceConnProxy.CreateChannelPocketBespeakBllService(school.ConnectionString); try { return(pocketBespeak.CheckAndGetReaderInfo(user)); } catch (LoginFailed ex) { throw ex; } catch (ReaderHandlerFailed ex) { throw ex; } catch (EndpointNotFoundException ex) { throw new RemoteServiceLinkFailed(); } catch (CommunicationException ex) { throw ex; } catch (Exception ex) { throw ex; } finally { ICommunicationObject ICommObjectService = pocketBespeak as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
/// <summary> /// 学校信息转换成要显示的列表并显示 /// </summary> /// <param name="school"></param> /// <returns></returns> public List <CampusInfo> ConvertToCampusList(AMS.Model.AMS_School school) { List <CampusInfo> campuses = new List <CampusInfo>(); for (int i = 0; i < school.Campus.Count; i++) { CampusInfo campus = new CampusInfo(); campus.Id = school.Campus[i].Id; campus.Name = school.Campus[i].Name; campus.Number = school.Campus[i].Number; campus.Address = school.Campus[i].Address; campus.DeviceCount = school.Campus[i].Device.Count; campuses.Add(campus); } CampusList = campuses; return(campuses); }
/// <summary> /// 添加使用记录 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool AddNewSeatUsage(Model.SMS_SeatUsage model) { try { AMS.Model.AMS_School school = GetSchoolInfoByNum(model.SchoolNum); if (school != null) { model.SchoolID = school.Id; return(seatUsage_dal.Add(model) > 0 ? true : false); } else { return(true); } } catch { throw; } }
/// <summary> /// 添加学校 /// </summary> /// <param name="model"></param> /// <returns></returns> public static string AddSchoolInfo(AMS.Model.AMS_School model) { AMS.IBllService.IAdvertManageBllService bllService = AMS.ServiceConnectChannel.AdvertManageBllServiceChannel.CreateServiceChannel(); try { return(bllService.AddSchoolInfo(model)); } catch (EndpointNotFoundException ex) { throw new AMS.Model.CustomerException("连接服务器失败"); } catch (CommunicationException ex) { throw ex; } catch (Exception ex) { throw ex; } finally { ICommunicationObject ICommObjectService = bllService as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
public ViewModelCampusEditWindow(AMS.Model.AMS_School school) { SchoolModel = school; }
/// <summary> /// 得到一个对象实体 /// </summary> public AMS.Model.AMS_School GetModel(string strWhere) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 Id,Number,Name,DTUip,Describe,ConnectionString,LinkMan,LinkAddress,ProvinceID,CardInfo,InterfaceInfo,Flag from AMS_School "); if (!string.IsNullOrEmpty(strWhere) && strWhere.Trim() != "") { strSql.Append(" where " + strWhere); } AMS.Model.AMS_School model = new AMS.Model.AMS_School(); DataSet ds = DbHelperSQL.Query(strSql.ToString()); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["Id"] != null && ds.Tables[0].Rows[0]["Id"].ToString() != "") { model.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString()); } if (ds.Tables[0].Rows[0]["Number"] != null && ds.Tables[0].Rows[0]["Number"].ToString() != "") { model.Number = ds.Tables[0].Rows[0]["Number"].ToString(); } if (ds.Tables[0].Rows[0]["Name"] != null && ds.Tables[0].Rows[0]["Name"].ToString() != "") { model.Name = ds.Tables[0].Rows[0]["Name"].ToString(); } if (ds.Tables[0].Rows[0]["DTUip"] != null && ds.Tables[0].Rows[0]["DTUip"].ToString() != "") { model.DTUip = ds.Tables[0].Rows[0]["DTUip"].ToString(); } if (ds.Tables[0].Rows[0]["Describe"] != null && ds.Tables[0].Rows[0]["Describe"].ToString() != "") { model.Describe = ds.Tables[0].Rows[0]["Describe"].ToString(); } if (ds.Tables[0].Rows[0]["ConnectionString"] != null && ds.Tables[0].Rows[0]["ConnectionString"].ToString() != "") { model.ConnectionString = ds.Tables[0].Rows[0]["ConnectionString"].ToString(); } if (ds.Tables[0].Rows[0]["LinkMan"] != null && ds.Tables[0].Rows[0]["LinkMan"].ToString() != "") { model.LinkMan = ds.Tables[0].Rows[0]["LinkMan"].ToString(); } if (ds.Tables[0].Rows[0]["LinkAddress"] != null && ds.Tables[0].Rows[0]["LinkAddress"].ToString() != "") { model.LinkAddress = ds.Tables[0].Rows[0]["LinkAddress"].ToString(); } if (ds.Tables[0].Rows[0]["ProvinceID"] != null && ds.Tables[0].Rows[0]["ProvinceID"].ToString() != "") { model.ProvinceID = int.Parse(ds.Tables[0].Rows[0]["ProvinceID"].ToString()); } if (ds.Tables[0].Rows[0]["CardInfo"] != null && ds.Tables[0].Rows[0]["CardInfo"].ToString() != "") { model.CardInfo = ds.Tables[0].Rows[0]["CardInfo"].ToString(); } if (ds.Tables[0].Rows[0]["InterfaceInfo"] != null && ds.Tables[0].Rows[0]["InterfaceInfo"].ToString() != "") { model.InterfaceInfo = ds.Tables[0].Rows[0]["InterfaceInfo"].ToString(); } if (ds.Tables[0].Rows[0]["Flag"] != null && ds.Tables[0].Rows[0]["Flag"].ToString() != "") { model.IsSeatBespeak = ds.Tables[0].Rows[0]["Flag"].ToString() == "1" ? true : false; } return(model); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public AMS.Model.AMS_School GetModel(int Id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 Id,Number,Name,DTUip,Describe,ConnectionString,LinkMan,LinkAddress,ProvinceID,CardInfo,InterfaceInfo,Flag from AMS_School "); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.Int, 4) }; parameters[0].Value = Id; AMS.Model.AMS_School model = new AMS.Model.AMS_School(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["Id"] != null && ds.Tables[0].Rows[0]["Id"].ToString() != "") { model.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString()); } if (ds.Tables[0].Rows[0]["Number"] != null && ds.Tables[0].Rows[0]["Number"].ToString() != "") { model.Number = ds.Tables[0].Rows[0]["Number"].ToString(); } if (ds.Tables[0].Rows[0]["Name"] != null && ds.Tables[0].Rows[0]["Name"].ToString() != "") { model.Name = ds.Tables[0].Rows[0]["Name"].ToString(); } if (ds.Tables[0].Rows[0]["DTUip"] != null && ds.Tables[0].Rows[0]["DTUip"].ToString() != "") { model.DTUip = ds.Tables[0].Rows[0]["DTUip"].ToString(); } if (ds.Tables[0].Rows[0]["Describe"] != null && ds.Tables[0].Rows[0]["Describe"].ToString() != "") { model.Describe = ds.Tables[0].Rows[0]["Describe"].ToString(); } if (ds.Tables[0].Rows[0]["ConnectionString"] != null && ds.Tables[0].Rows[0]["ConnectionString"].ToString() != "") { model.ConnectionString = ds.Tables[0].Rows[0]["ConnectionString"].ToString(); } if (ds.Tables[0].Rows[0]["LinkMan"] != null && ds.Tables[0].Rows[0]["LinkMan"].ToString() != "") { model.LinkMan = ds.Tables[0].Rows[0]["LinkMan"].ToString(); } if (ds.Tables[0].Rows[0]["LinkAddress"] != null && ds.Tables[0].Rows[0]["LinkAddress"].ToString() != "") { model.LinkAddress = ds.Tables[0].Rows[0]["LinkAddress"].ToString(); } if (ds.Tables[0].Rows[0]["ProvinceID"] != null && ds.Tables[0].Rows[0]["ProvinceID"].ToString() != "") { model.ProvinceID = int.Parse(ds.Tables[0].Rows[0]["ProvinceID"].ToString()); } if (ds.Tables[0].Rows[0]["CardInfo"] != null && ds.Tables[0].Rows[0]["CardInfo"].ToString() != "") { model.CardInfo = ds.Tables[0].Rows[0]["CardInfo"].ToString(); } if (ds.Tables[0].Rows[0]["InterfaceInfo"] != null && ds.Tables[0].Rows[0]["InterfaceInfo"].ToString() != "") { model.InterfaceInfo = ds.Tables[0].Rows[0]["InterfaceInfo"].ToString(); } if (ds.Tables[0].Rows[0]["Flag"] != null && ds.Tables[0].Rows[0]["Flag"].ToString() != "") { model.IsSeatBespeak = ds.Tables[0].Rows[0]["Flag"].ToString() == "1" ? true : false; } return(model); } else { return(null); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(AMS.Model.AMS_School model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update AMS_School set "); strSql.Append("Number=@Number,"); strSql.Append("Name=@Name,"); strSql.Append("DTUip=@DTUip,"); strSql.Append("Describe=@Describe,"); strSql.Append("ConnectionString=@ConnectionString,"); strSql.Append("LinkMan=@LinkMan,"); strSql.Append("LinkAddress=@LinkAddress,"); strSql.Append("ProvinceID=@ProvinceID,"); strSql.Append("CardInfo=@CardInfo,"); strSql.Append("InterfaceInfo=@InterfaceInfo,"); strSql.Append("ExecuteProgress=@ExecuteProgress,"); strSql.Append("InstallDate=@InstallDate,"); strSql.Append("InstallMan=@InstallMan,"); strSql.Append("Flag=@Flag,"); strSql.Append("AppOpen=@AppOpen"); strSql.Append(" where Id=@Id "); SqlParameter[] parameters = { new SqlParameter("@Number", SqlDbType.NVarChar, 50), new SqlParameter("@Name", SqlDbType.NVarChar, 30), new SqlParameter("@DTUip", SqlDbType.NVarChar, 20), new SqlParameter("@Describe", SqlDbType.NVarChar, 200), new SqlParameter("@ConnectionString", SqlDbType.NVarChar, 200), new SqlParameter("@LinkMan", SqlDbType.NVarChar, 300), new SqlParameter("@LinkAddress", SqlDbType.NVarChar, 300), new SqlParameter("@ProvinceID", SqlDbType.Int, 4), new SqlParameter("@CardInfo", SqlDbType.Text), new SqlParameter("@InterfaceInfo", SqlDbType.Text), new SqlParameter("@Flag", SqlDbType.Int, 4), new SqlParameter("@Id", SqlDbType.Int, 4), new SqlParameter("@ExecuteProgress", SqlDbType.NVarChar), new SqlParameter("@InstallDate", SqlDbType.DateTime), new SqlParameter("@InstallMan", SqlDbType.NVarChar), new SqlParameter("@AppOpen", SqlDbType.Int) }; parameters[0].Value = model.Number; parameters[1].Value = model.Name; parameters[2].Value = model.DTUip; parameters[3].Value = model.Describe; parameters[4].Value = model.ConnectionString; parameters[5].Value = model.LinkMan; parameters[6].Value = model.LinkAddress; parameters[7].Value = model.ProvinceID; parameters[8].Value = model.CardInfo; parameters[9].Value = model.InterfaceInfo; parameters[10].Value = model.IsSeatBespeak ? 1 : 0; parameters[11].Value = model.Id; parameters[12].Value = model.ExecuteProgress; parameters[13].Value = model.InstallDate; parameters[14].Value = model.InstallMan; parameters[15].Value = model.AppOpen ? 1 : 0; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更换座位 /// </summary> /// <param name="cardNo">学号</param> /// <param name="seatNum">要更换的座位号</param> /// <param name="readingRoomNum">阅览室编号</param> /// <returns></returns> public string ChangeSeat(AMS.Model.AMS_School school, string cardNo, string seatNum, string readingRoomNum) { throw new NotImplementedException(); }
/// <summary> /// 获取座位信息 /// </summary> /// <param name="cardNo">学号</param> /// <param name="seatNum">座位号</param> /// <param name="readingRoomNum">阅览室编号</param> /// <returns></returns> public ClassModel.BespeakSeatModel.ScanCodeViewModel GetScanCodeSeatInfo(AMS.Model.AMS_School school, string cardNo, string seatNum, string readingRoomNum) { throw new NotImplementedException(); }
public string DelaySeatUsedTime(AMS.Model.AMS_School school, SeatManage.ClassModel.ReaderInfo reader) { SMS.BespeakServerProxy.BespeakServerProxy bespeakProxy = new SMS.BespeakServerProxy.BespeakServerProxy(school.ConnectionString); return(bespeakProxy.DelaySeatUsedTime(reader)); }
public SeatManage.ClassModel.ReaderInfo GetReaderInfo(AMS.Model.AMS_School school, string cardNo) { SMS.BespeakServerProxy.BespeakServerProxy bespeakProxy = new SMS.BespeakServerProxy.BespeakServerProxy(school.ConnectionString); return(bespeakProxy.GetReaderInfo(cardNo)); }
public Dictionary <string, SeatManage.ClassModel.ReadingRoomSeatUsedState_Ex> GetAllRoomSeatUsedState(AMS.Model.AMS_School school) { SMS.BespeakServerProxy.BespeakServerProxy bespeakProxy = new SMS.BespeakServerProxy.BespeakServerProxy(school.ConnectionString); return(bespeakProxy.GetAllRoomSeatUsedState()); }
private void cbxSchool_SelectionChanged(object sender, SelectionChangedEventArgs e) { AMS.Model.AMS_School school = cbxSchool.SelectedItem as AMS.Model.AMS_School; vms.SelectedSchoolNumValue = school.Number; }
public string FreeSeat(AMS.Model.AMS_School school, SeatManage.ClassModel.ReaderInfo reader) { SMS.BespeakServerProxy.BespeakServerProxy bespeakProxy = new SMS.BespeakServerProxy.BespeakServerProxy(school.ConnectionString); return(bespeakProxy.FreeSeat(reader.CardNo)); }