using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Data; using BLWWS_BLL; using System.Threading.Tasks; namespace BLWWS { /// /// syncstatus 的摘要说明 /// [WebService(Namespace = "http://www.blw.com/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。 [System.Web.Script.Services.ScriptService] public class syncstatus : System.Web.Services.WebService { /// /// 获取客户记录 /// /// /// /// [WebMethod] public DataSet GetRoomRecord(string code, string roomNumber, string tableName) { try { return BLL.GetRoomRecords(code, roomNumber, tableName); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return null; } /// /// 根据酒店ID,房号获取当前入住人信息 /// /// 酒店ID /// 房号 /// [WebMethod] public string GetRoomCustomerByHotelID(int hotelID, string roomNumber, ref string phoneNumber) { try { return BLL.GetRoomCustomer(hotelID, roomNumber, ref phoneNumber); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return ""; } /// /// 获取入住人信息 /// /// /// [WebMethod] public DataSet GetRoomCustomer(long checkInID) { try { return BLL.GetRoomCustomer(checkInID); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return null; } /// /// 获取酒店编码 /// /// [WebMethod] public DataSet GetHotelCode() { try { return BLL.GetHotelCode(); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return null; } /// /// 获取酒店编码 /// /// [WebMethod] public DataTable GetHotelByCode(string code) { try { return BLL.GetHotelCode(code); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return null; } /// /// 定时获取酒店新的开房/退房/待租记录 /// /// 酒店编码 /// [WebMethod] public DataSet GetCheckInOrOutRecord(string code) { try { return BLL.GetCheckInOrOutRecord(code); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return null; } /// /// 获取人脸机设备信息 /// /// /// [WebMethod] public DataSet GetDevices(string code) { try { return BLL.GetDevices(code); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return null; } /// /// 人脸机绑定房号 /// /// /// /// /// [WebMethod] public int SaveDevice(long id, string hotelCode, string roomNumber) { try { return BLL.SaveDevice(id, hotelCode, roomNumber); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return 0; } /// /// 更新已同步的新开房/退房/待租状态 /// /// 酒店编码 /// 记录ID /// 0开房,1退房,2待租 /// [WebMethod] public int UpdateCheckInOrOutRecord(string code, Int64 id, int flag) { try { return BLL.UpdateCheckInOrOutRecord(code, id, flag); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return 0; } /// /// 判断验证码是否正确 /// /// 酒店ID /// 房号 /// 用户输入验证码 /// [WebMethod] public bool ValidateNumber(int hotelID, string roomNumber, string validateCode) { try { return BLL.ValidateNumber(hotelID, roomNumber, validateCode); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return false; } /// /// 判断验证码是否正确 /// /// 酒店编码 /// 房号 /// 用户输入验证码 /// [WebMethod] public bool ValidateNumberByCode(string code, string roomNumber, string validateCode) { try { return BLL.ValidateNumberByCode(code, roomNumber, validateCode); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return false; } /// /// 根据手机号获取当前入住记录信息 /// /// /// [WebMethod] public DataTable GetCodeAndRoomNumberByPhone(string phone) { try { return BLL.GetCodeAndRoomNumberByPhone(phone); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return null; } /// /// 上传/变更图像及信息 /// /// 证件类型:0身份证,1护照 /// 证件号码 /// 姓名 /// 性别:0女,1男 /// 图像 /// [WebMethod] public bool UploadPhoto(int idType, string idCard, string name, int sex, string birthday, byte[] photo) { try { if (BLL.UploadPhoto(idType, idCard, name, sex, birthday, photo) > 0) { return true; } } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return false; } /// /// 人脸识别 /// /// /// /// /// /// /// /// [WebMethod] public bool FaceMatch(byte[] photo, ref int idType, ref string idCard, ref string name, ref int sex, ref byte[] matchPhoto) { try { return BLL.FaceMatch(photo, ref idType, ref idCard, ref name, ref sex, ref matchPhoto); } catch (Exception ex) { LogHelper.WriteLog(ex.ToString()); } return false; } //[WebMethod] //public int SendSMS(string phoneNumber) //{ // try // { // string validateCode = Tools.CreateValidateCode(4); // //发送短信验证码 // AliyunSMSHelper.SendVerifySMS(phoneNumber, validateCode); // } // catch (Exception ex) // { // LogHelper.WriteLog(ex.ToString()); // } // return 0; //} } }