public static int InsertConsultRoomHistory(APPContentEntity APPContentEntity) { string IsWriteLog = ConfigurationManager.AppSettings["IsWriteLog"].ToString(); if ("0".Equals(IsWriteLog)) { return 1; } if (APPContentEntity.APPContentDBEntity.Count == 0) { return 0; } DataCommand cmd = DataCommandManager.GetDataCommand("InsertConsultRoomHistory"); foreach (APPContentDBEntity dbParm in APPContentEntity.APPContentDBEntity) { cmd.SetParameterValue("@CityID", dbParm.CityID); cmd.SetParameterValue("@HotelID", dbParm.HotelID ); cmd.SetParameterValue("@PlanDate", dbParm.PlanTime); cmd.SetParameterValue("@PriceCode", dbParm.PriceCode); cmd.SetParameterValue("@RoomCode", dbParm.RoomCode); cmd.SetParameterValue("@TwoPrice", dbParm.TwoPrice); cmd.SetParameterValue("@RoomNum", dbParm.RoomCount); cmd.SetParameterValue("@Status", dbParm.PlanStatus); cmd.SetParameterValue("@Remark", dbParm.Remark); cmd.SetParameterValue("@IsReserve", dbParm.IsReserve); cmd.SetParameterValue("@Create_User", dbParm.CreateUser); cmd.ExecuteNonQuery(); } return 1; }
public static APPContentEntity CommonSelect(APPContentEntity appcontentEntity) { DataSet dsResult = new DataSet(); dsResult.Tables.Add(new DataTable()); dsResult.Tables[0].Columns.Add(new DataColumn("cityid")); dsResult.Tables[0].Columns.Add(new DataColumn("cityNM")); try { string url = JsonRequestURLBuilder.getSearchCityUrl(); CallWebPage callWebPage = new CallWebPage(); string strJson = callWebPage.CallWebByURL(url, ""); //解析json数据 JObject o = JObject.Parse(strJson); //JArray jsa = (JArray)o.SelectToken("result"); string oCityList = o.SelectToken("result").ToString(); JArray jsa = (JArray)JsonConvert.DeserializeObject(oCityList); for (int i = 0; i < jsa.Count; i++) { JObject jso = (JObject)jsa[i]; DataRow drRow = dsResult.Tables[0].NewRow(); drRow["cityid"] = JsonRequestURLBuilder.GetJsonStringValue(jso, "cityid").Trim('"'); drRow["cityNM"] = JsonRequestURLBuilder.GetJsonStringValue(jso, "namecn").Trim('"') + "[" + JsonRequestURLBuilder.GetJsonStringValue(jso, "nameen").Trim('"') + "]"; dsResult.Tables[0].Rows.Add(drRow); } } catch { } appcontentEntity.QueryResult = dsResult; return appcontentEntity; }
public static APPContentEntity ApplyFullRoom(APPContentEntity appcontentEntity) { APPContentDBEntity dbParm = (appcontentEntity.APPContentDBEntity.Count > 0) ? appcontentEntity.APPContentDBEntity[0] : new APPContentDBEntity(); Hashtable alRoom = QueryFullRoomList(appcontentEntity); string[] strRoomList = dbParm.RoomList.Split(','); string HotelID = dbParm.HotelID.Substring((dbParm.HotelID.IndexOf('[') + 1), (dbParm.HotelID.IndexOf(']') - 1)); string RoomCode = ""; //dbParm.HotelID, RoomCode, dbParm.PriceCode, dbParm.StartDTime, dbParm.EndDTime //{"roomTypeName":"单人房","roomTypeCode":"123","status":false,"isReserve":”0”} bool bFlag = true; string msg = string.Empty; foreach (string strRoomCode in strRoomList) { if (String.IsNullOrEmpty(strRoomCode)) { continue; } if (alRoom.Count == 0 || !alRoom.ContainsKey(strRoomCode)) { msg = msg + strRoomCode + ","; bFlag = false; } RoomCode = RoomCode + "{\"roomTypeName\":\"" + APPContentDA.HotelRoomNM(HotelID, strRoomCode) + "\"," + "\"roomTypeCode\":\"" + strRoomCode + "\"," + "\"status\":" + "true" + ",\"isReserve\":\"" + "0" + "\"" + "},"; } if (!bFlag) { appcontentEntity.ErrorMSG = msg; appcontentEntity.Result = 2; return appcontentEntity; } RoomCode = (RoomCode.Length > 0) ? RoomCode.Substring(0, RoomCode.Length - 1) : RoomCode; string DataString = "{\"moneyType\":\"" + "CHY" + "\"," + "\"hotelId\":\"" + HotelID + "\"," + "\"rateCode\":\"" + dbParm.PriceCode + "\"," + "\"roomNum\":" + "0" + "," + "\"whatDay\":\"" + "1,2,3,4,5,6,7" + "\"," + "\"beginDate\":\"" + dbParm.StartDTime + "\"," + "\"endDate\":\"" + dbParm.EndDTime + "\"," + "\"lmroom\":[" + RoomCode + "]," + "\"updateUser\":\"" + dbParm.UpdateUser + "\"," + "\"platformCode\":\"" + "CMS" + "\"}"; string HotelFullRoomUrl = JsonRequestURLBuilder.applyHotelFullRoomV2(); string strHotelFullRoom = CommonCallWebUrl(HotelFullRoomUrl + DataString); JObject oHotelFullRoom = JObject.Parse(strHotelFullRoom); if ("success".Equals(JsonRequestURLBuilder.GetJsonStringValue(oHotelFullRoom, "result").Trim('"'))) { appcontentEntity.Result = 1; } else { string ErrorMSG = JsonRequestURLBuilder.GetJsonStringValue(oHotelFullRoom, "code").Trim('"'); appcontentEntity.ErrorMSG = ("1001".Equals(ErrorMSG)) ? "酒店满房标记失败 指定的房型在该时间区间内存在无销售计划,请确认!" : ""; appcontentEntity.Result = 3; } return appcontentEntity; }
/// <summary> /// 房态控制 -- 批量更新计划的接口 type:1 满房、2 关房、3 开房 /// </summary> /// <param name="appcontentEntity"></param> /// <returns></returns> public static APPContentEntity BatchUpdatePlan(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "BatchUpdatePlan"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { return HotelInfoSA.BatchUpdatePlan(appcontentEntity); } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "BatchUpdatePlan Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
public static int InsertConsultRoomHistory(APPContentEntity APPContentEntity) { APPContentEntity.LogMessages.MsgType = MessageType.INFO; APPContentEntity.LogMessages.Content = _nameSpaceClass + "InsertConsultRoomHistory"; LoggerHelper.LogWriter(APPContentEntity.LogMessages); try { return CommonDA.InsertConsultRoomHistory(APPContentEntity); } catch (Exception ex) { APPContentEntity.LogMessages.MsgType = MessageType.ERROR; APPContentEntity.LogMessages.Content = _nameSpaceClass + "InsertConsultRoomHistory Error: " + ex.Message; LoggerHelper.LogWriter(APPContentEntity.LogMessages); throw ex; } }
public static APPContentEntity ApplyUnFullRoom(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "ApplyUnFullRoom"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { return APPContentV2SA.ApplyUnFullRoom(appcontentEntity); } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "ApplyUnFullRoom Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
/// <summary> /// 房态控制 -- 批量更新计划的接口 type:1 满房、2 关房、3 开房 /// </summary> /// <param name="appcontentEntity"></param> /// <returns></returns> public static APPContentEntity BatchUpdatePlan(APPContentEntity appcontentEntity) { APPContentDBEntity dbParm = (appcontentEntity.APPContentDBEntity.Count > 0) ? appcontentEntity.APPContentDBEntity[0] : new APPContentDBEntity(); string DataString = "{\"hotelId\":\"" + dbParm.HotelID + "\",\"whatDay\":\"1,2,3,4,5,6,7\",\"beginDate\":\"" + dbParm.StartDTime + "\",\"endDate\":\"" + dbParm.EndDTime + "\",\"operator\":\"" + dbParm.UpdateUser + "\",\"type\":\"" + dbParm.TypeID + "\",\"priceCodeRoom\":[{\"priceCode\":\"LMBAR\",\"roomCode\":\"" + dbParm.LmbarRoomCode + "\"},{\"priceCode\":\"LMBAR2\",\"roomCode\":\"" + dbParm.Lmbar2RoomCode + "\"}]}"; string HotelFullRoomUrl = JsonRequestURLBuilder.BatchUpdatePlan(); CallWebPage callWebPage = new CallWebPage(); string strHotelFullRoom = callWebPage.CallWebByURL(HotelFullRoomUrl, DataString); JObject oHotelFullRoom = JObject.Parse(strHotelFullRoom); if ("200".Equals(JsonRequestURLBuilder.GetJsonStringValue(oHotelFullRoom, "code").Trim('"'))) { appcontentEntity.Result = 1; } else { appcontentEntity.Result = 2; } return appcontentEntity; }
public static APPContentEntity GetFullRoomHistoryList(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "GetFullRoomHistoryList"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { return APPContentDA.GetFullRoomHistoryList(appcontentEntity); //APPContentDA.CommonSelect(appcontentEntity); } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "GetFullRoomHistoryList Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
public static APPContentEntity GetHotelFogList(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "GetHotelFogList"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { DataSet dsHotel = APPContentDA.GetHotelFogList(appcontentEntity).QueryResult; ArrayList alIgnore = new ArrayList(); DataSet dsRestult = new DataSet(); dsRestult.Tables.Add(new DataTable()); dsRestult.Tables[0].Columns.Add("HOTELID"); dsRestult.Tables[0].Columns.Add("HOTELNM"); dsRestult.Tables[0].Columns.Add("TYPEID"); dsRestult.Tables[0].Columns.Add("TYPENM"); dsRestult.Tables[0].Columns.Add("HVPVAL"); dsRestult.Tables[0].Columns.Add("HUBVAL"); string desc = ""; string desc_f = ""; foreach (DataRow drHotel in dsHotel.Tables[0].Rows) { alIgnore = APPContentDA.GetHotelCompare(drHotel["HOTELID"].ToString()); if (!alIgnore.Contains("HOTELNMZH") && !drHotel["HOTELNMZH"].ToString().Trim().Equals(drHotel["HOTELNMZH_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "HOTELNMZH"; drErNm["TYPENM"] = "酒店名称"; drErNm["HVPVAL"] = drHotel["HOTELNMZH"].ToString(); drErNm["HUBVAL"] = drHotel["HOTELNMZH_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("HOTELNMEN") && !drHotel["HOTELNMEN"].ToString().Trim().Equals(drHotel["HOTELNMEN_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "HOTELNMEN"; drErNm["TYPENM"] = "酒店英文名称"; drErNm["HVPVAL"] = drHotel["HOTELNMEN"].ToString(); drErNm["HUBVAL"] = drHotel["HOTELNMEN_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("FOGSTATUS") && !drHotel["FOGSTATUS"].ToString().Trim().Equals(drHotel["FOGSTATUS_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "FOGSTATUS"; drErNm["TYPENM"] = "FOG酒店上下线状态"; drErNm["HVPVAL"] = drHotel["FOGSTATUS"].ToString(); drErNm["HUBVAL"] = drHotel["FOGSTATUS_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("CITY") && !drHotel["CITY"].ToString().Trim().Equals(drHotel["CITY_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "CITY"; drErNm["TYPENM"] = "酒店所在城市"; drErNm["HVPVAL"] = drHotel["CITY"].ToString(); drErNm["HUBVAL"] = drHotel["CITY_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("DIAMOND") && !drHotel["DIAMOND"].ToString().Trim().Equals(drHotel["DIAMOND_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "DIAMOND"; drErNm["TYPENM"] = "酒店钻石级"; drErNm["HVPVAL"] = drHotel["DIAMOND"].ToString(); drErNm["HUBVAL"] = drHotel["DIAMOND_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("STAR") && !drHotel["STAR"].ToString().Trim().Equals(drHotel["STAR_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "STAR"; drErNm["TYPENM"] = "酒店星级"; drErNm["HVPVAL"] = drHotel["STAR"].ToString(); drErNm["HUBVAL"] = drHotel["STAR_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("OPENDT") && !drHotel["OPENDT"].ToString().Trim().Equals(drHotel["OPENDT_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "OPENDT"; drErNm["TYPENM"] = "开业日期"; drErNm["HVPVAL"] = drHotel["OPENDT"].ToString(); drErNm["HUBVAL"] = drHotel["OPENDT_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("RENOVATIONDT") && !drHotel["RENOVATIONDT"].ToString().Trim().Equals(drHotel["RENOVATIONDT_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "RENOVATIONDT"; drErNm["TYPENM"] = "开业日期"; drErNm["HVPVAL"] = drHotel["RENOVATIONDT"].ToString(); drErNm["HUBVAL"] = drHotel["RENOVATIONDT_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("TRADEAREA") && (!drHotel["TRADEAREA"].ToString().Trim().Equals(drHotel["TRADEAREA_F"].ToString().Trim()) || !drHotel["TRADEAREANM"].ToString().Trim().Equals(drHotel["TRADEAREANM_F"].ToString().Trim()))) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "TRADEAREA"; drErNm["TYPENM"] = "酒店商圈"; drErNm["HVPVAL"] = drHotel["TRADEAREANM"].ToString(); drErNm["HUBVAL"] = drHotel["TRADEAREANM_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("ADDRESS") && !drHotel["ADDRESS"].ToString().Trim().Equals(drHotel["ADDRESS_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "ADDRESS"; drErNm["TYPENM"] = "酒店地址"; drErNm["HVPVAL"] = drHotel["ADDRESS"].ToString(); drErNm["HUBVAL"] = drHotel["ADDRESS_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("WEBSITE") && !drHotel["WEBSITE"].ToString().Trim().Equals(drHotel["WEBSITE_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "WEBSITE"; drErNm["TYPENM"] = "酒店网址"; drErNm["HVPVAL"] = drHotel["WEBSITE"].ToString(); drErNm["HUBVAL"] = drHotel["WEBSITE_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("LINKTEL") && !drHotel["LINKTEL"].ToString().Trim().Equals(drHotel["LINKTEL_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "LINKTEL"; drErNm["TYPENM"] = "预订电话"; drErNm["HVPVAL"] = drHotel["LINKTEL"].ToString(); drErNm["HUBVAL"] = drHotel["LINKTEL_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("LINKFAX") && !drHotel["LINKFAX"].ToString().Trim().Equals(drHotel["LINKFAX_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "LINKFAX"; drErNm["TYPENM"] = "预订传真"; drErNm["HVPVAL"] = drHotel["LINKFAX"].ToString(); drErNm["HUBVAL"] = drHotel["LINKFAX_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("LINKMAN") && !drHotel["LINKMAN"].ToString().Trim().Equals(drHotel["LINKMAN_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "LINKMAN"; drErNm["TYPENM"] = "联系人"; drErNm["HVPVAL"] = drHotel["LINKMAN"].ToString(); drErNm["HUBVAL"] = drHotel["LINKMAN_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("LINKMAIL") && !drHotel["LINKMAIL"].ToString().Trim().Equals(drHotel["LINKMAIL_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "LINKMAIL"; drErNm["TYPENM"] = "联系邮箱"; drErNm["HVPVAL"] = drHotel["LINKMAIL"].ToString(); drErNm["HUBVAL"] = drHotel["LINKMAIL_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("LONGITUDE") && !drHotel["LONGITUDE"].ToString().Trim().Equals(drHotel["LONGITUDE_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "LONGITUDE"; drErNm["TYPENM"] = "经度"; drErNm["HVPVAL"] = drHotel["LONGITUDE"].ToString(); drErNm["HUBVAL"] = drHotel["LONGITUDE_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("LATITUDE") && !drHotel["LATITUDE"].ToString().Trim().Equals(drHotel["LATITUDE_F"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "LATITUDE"; drErNm["TYPENM"] = "纬度"; drErNm["HVPVAL"] = drHotel["LATITUDE"].ToString(); drErNm["HUBVAL"] = drHotel["LATITUDE_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } desc = (drHotel["DESCZH"].ToString().Trim().Length > 100) ? drHotel["DESCZH"].ToString().Trim().Substring(0, 100) : drHotel["DESCZH"].ToString().Trim(); desc_f = (drHotel["DESCZH_F"].ToString().Trim().Length > 100) ? drHotel["DESCZH_F"].ToString().Trim().Substring(0, 100) : drHotel["DESCZH_F"].ToString().Trim(); if (!alIgnore.Contains("DESCZH") && !desc.Equals(desc_f)) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNMZH"].ToString(); drErNm["TYPEID"] = "DESCZH"; drErNm["TYPENM"] = "酒店详情"; drErNm["HVPVAL"] = drHotel["DESCZH"].ToString(); drErNm["HUBVAL"] = drHotel["DESCZH_F"].ToString(); dsRestult.Tables[0].Rows.Add(drErNm); } } appcontentEntity.QueryResult = dsRestult; return appcontentEntity; } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "GetHotelFogList Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
public static APPContentEntity ExportOrderSettleMangeList(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "ExportOrderSettleMangeList"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { return APPContentDA.ExportOrderSettleMangeList(appcontentEntity); } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "ExportOrderSettleMangeList Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
public static APPContentEntity GetCoreHotelGroupDetail(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "GetCoreHotelGroupDetail"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { return APPContentDA.GetCoreHotelGroupDetail(appcontentEntity); } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "GetCoreHotelGroupDetail Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
public static APPContentEntity GetConsultRoomHistoryList(APPContentEntity APPContentEntity) { APPContentDBEntity dbParm = (APPContentEntity.APPContentDBEntity.Count > 0) ? APPContentEntity.APPContentDBEntity[0] : new APPContentDBEntity(); DataCommand cmd = DataCommandManager.GetDataCommand("GetConsultRoomHistoryList"); cmd.SetParameterValue("@CityID", dbParm.CityID); cmd.SetParameterValue("@HotelID", dbParm.HotelID); cmd.SetParameterValue("@PriceCode", dbParm.PriceCode); cmd.SetParameterValue("@RoomCode", dbParm.RoomCode); cmd.SetParameterValue("@PlanDate", dbParm.PlanDTime); APPContentEntity.QueryResult = cmd.ExecuteDataSet(); return APPContentEntity; }
public static int UpdateHotelCompareGridBatch(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "UpdateHotelCompareGridBatch"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { return APPContentDA.UpdateHotelCompareGridBatch(appcontentEntity); } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "UpdateHotelCompareGridBatch Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
public static string GetHistoryRemarkByJson(string CityID, string HotelID, string PriceCode, string RoomCode, string PlanDTime) { APPContentEntity _appcontentEntity = new APPContentEntity(); _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage(); _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount; _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName; _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP; _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>(); APPContentDBEntity appcontentDBEntity = new APPContentDBEntity(); appcontentDBEntity.CityID = CityID; appcontentDBEntity.HotelID = HotelID; appcontentDBEntity.PriceCode = PriceCode; appcontentDBEntity.RoomCode = RoomCode; appcontentDBEntity.PlanDTime = DateTime.Parse(PlanDTime).ToShortDateString(); _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity); string json = ""; if (!CityID.Equals("undefined")) { DataSet dsResult = HotelInfoBP.GetConsultRoomHistoryList(_appcontentEntity).QueryResult; try { if (dsResult.Tables[0] != null && dsResult.Tables[0].Rows.Count > 0) { json = ToJson(dsResult.Tables[0]); } else { json = "{\"d\":\"[]\"}"; } } catch (Exception ex) { json = "{\"d\":\"[]\"}"; } } return json; }
/// <summary> /// 计划关房(批量操作 关闭计划) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void btnPlanCloseRoom(string remark, string status, bool isRenew) { DataTable dtPlanLMBAR2 = new DataTable(); DataTable dtPlanLMBAR = new DataTable(); string hotelId = this.HidPid.Value;//酒店ID string dateSE = this.HidMarkFullRoom.Value;//起止日期 #region APPContentEntity _appcontentEntity = new APPContentEntity(); _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage(); _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount; _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName; _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP; CommonEntity _commonEntity = new CommonEntity(); _commonEntity.CommonDBEntity = new List<CommonDBEntity>(); _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage(); _commonEntity.LogMessages.IpAddress = UserSession.Current.UserIP; _commonEntity.LogMessages.Username = UserSession.Current.UserDspName; _commonEntity.LogMessages.Userid = UserSession.Current.UserAccount; CommonDBEntity commonDBEntity = new CommonDBEntity(); _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>(); APPContentDBEntity appcontentDBEntity = new APPContentDBEntity(); bool IsFlag = false; if (!string.IsNullOrEmpty(dateSE)) { DataTable dtPlan = GetBindLmbarPlanList(this.planStartDate.Value, this.planEndDate.Value, this.HidPid.Value).Tables[0];//总计划 dtPlanLMBAR2 = dtPlan.Clone(); dtPlanLMBAR = dtPlan.Clone(); DataRow[] drPlanLMBAR2 = dtPlan.Select("RATECODE='LMBAR2'"); //LMBAR2计划 for (int i = 0; i < drPlanLMBAR2.Length; i++) { dtPlanLMBAR2.ImportRow(drPlanLMBAR2[i]); } DataRow[] drPlanLMBAR = dtPlan.Select("RATECODE='LMBAR'"); //LMBAR计划 for (int i = 0; i < drPlanLMBAR.Length; i++) { dtPlanLMBAR.ImportRow(drPlanLMBAR[i]); } string[] datas = dateSE.Split(','); for (int i = 0; i < datas.Length; i++) { if (!string.IsNullOrEmpty(datas[i].ToString())) { if (DateTime.Parse(datas[i].ToString()).ToShortDateString() == System.DateTime.Now.ToShortDateString()) { IsFlag = true; } string effDate = datas[i].ToString().Replace("/", "-"); #region for (int l = 0; l < this.HidLastHotelRoomListLMBAR2.Value.Split(',').Length; l++) { DataRow[] rowsLmbar2 = dtPlanLMBAR2.Select("EFFECTDATESTRING='" + DateTime.Parse(effDate).ToString("yyyy-MM-dd") + "' and ROOMTYPECODE='" + this.HidLastHotelRoomListLMBAR2.Value.Split(',')[l].ToString() + "'"); for (int j = 0; j < rowsLmbar2.Length; j++) { if (!string.IsNullOrEmpty(rowsLmbar2[j]["RoomNum"].ToString()) && rowsLmbar2[j]["RoomNum"].ToString().ToLower() != "null") { //城市ID appcontentDBEntity.CityID = this.HidCityID.Value; //酒店ID appcontentDBEntity.HotelID = hotelId; //酒店名称 appcontentDBEntity.HotelNM = this.HidPcode.Value; //PlanDate appcontentDBEntity.PlanTime = DateTime.Parse(effDate).ToShortDateString(); //价格代码 appcontentDBEntity.PriceCode = rowsLmbar2[j]["RATECODE"].ToString(); //价格 appcontentDBEntity.TwoPrice = rowsLmbar2[j]["TWOPRICE"].ToString(); //状态 开启 关闭 //appcontentDBEntity.PlanStatus = rowsLmbar2[j]["STATUS"].ToString(); appcontentDBEntity.PlanStatus = status == "" ? rowsLmbar2[j]["STATUS"].ToString() : status; appcontentDBEntity.RoomCount = rowsLmbar2[j]["ROOMNUM"].ToString(); appcontentDBEntity.IsReserve = rowsLmbar2[j]["ISRESERVE"].ToString(); //房型名称 appcontentDBEntity.RoomName = rowsLmbar2[j]["ROOMTYPENAME"].ToString(); //房型Code appcontentDBEntity.RoomCode = rowsLmbar2[j]["ROOMTYPECODE"].ToString(); appcontentDBEntity.WeekList = "1,2,3,4,5,6,7"; //备注 appcontentDBEntity.Remark = remark; //操作人 appcontentDBEntity.CreateUser = UserSession.Current.UserAccount; _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity); CommonBP.InsertConsultRoomHistory(_appcontentEntity); _appcontentEntity.APPContentDBEntity.Clear(); } } } #endregion #region for (int l = 0; l < this.HidLastHotelRoomListLMBAR.Value.Split(',').Length; l++) { DataRow[] rowsLmbar = dtPlanLMBAR.Select("EFFECTDATESTRING='" + DateTime.Parse(effDate).ToString("yyyy-MM-dd") + "' and ROOMTYPECODE='" + this.HidLastHotelRoomListLMBAR.Value.Split(',')[l].ToString() + "'"); for (int j = 0; j < rowsLmbar.Length; j++) { if (!string.IsNullOrEmpty(rowsLmbar[j]["ROOMNUM"].ToString()) && rowsLmbar[j]["RoomNum"].ToString().ToLower() != "null") { //城市ID appcontentDBEntity.CityID = this.HidCityID.Value; //酒店ID appcontentDBEntity.HotelID = hotelId; //酒店名称 appcontentDBEntity.HotelNM = this.HidPcode.Value; //PlanDate appcontentDBEntity.PlanTime = DateTime.Parse(effDate).ToShortDateString(); //价格代码 appcontentDBEntity.PriceCode = rowsLmbar[j]["RATECODE"].ToString(); //价格 appcontentDBEntity.TwoPrice = rowsLmbar[j]["TWOPRICE"].ToString(); //状态 开启 关闭 //appcontentDBEntity.PlanStatus = rowsLmbar[j]["STATUS"].ToString(); appcontentDBEntity.PlanStatus = status == "" ? rowsLmbar[j]["STATUS"].ToString() : status; appcontentDBEntity.RoomCount = rowsLmbar[j]["ROOMNUM"].ToString(); appcontentDBEntity.IsReserve = rowsLmbar[j]["ISRESERVE"].ToString(); //房型名称 appcontentDBEntity.RoomName = rowsLmbar[j]["ROOMTYPENAME"].ToString(); //房型Code appcontentDBEntity.RoomCode = rowsLmbar[j]["ROOMTYPECODE"].ToString(); appcontentDBEntity.WeekList = "1,2,3,4,5,6,7"; //备注 appcontentDBEntity.Remark = remark; //操作人 appcontentDBEntity.CreateUser = UserSession.Current.UserAccount; _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity); CommonBP.InsertConsultRoomHistory(_appcontentEntity); _appcontentEntity.APPContentDBEntity.Clear(); } } } #endregion if (isRenew) { appcontentDBEntity.HotelID = hotelId; appcontentDBEntity.StartDTime = effDate; appcontentDBEntity.EndDTime = effDate; appcontentDBEntity.Lmbar2RoomCode = this.HidLastHotelRoomListLMBAR2.Value; appcontentDBEntity.LmbarRoomCode = this.HidLastHotelRoomListLMBAR.Value; appcontentDBEntity.TypeID = status == "true" ? "3" : "2";// "2";//type:1 满房、2 关房、3 开房 appcontentDBEntity.UpdateUser = UserSession.Current.UserAccount; _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity); _appcontentEntity = HotelInfoBP.BatchUpdatePlan(_appcontentEntity); _appcontentEntity.APPContentDBEntity.Clear(); } } } } #endregion int SelectedIndex = int.Parse(this.HidSelIndex.Value); //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "keyclosebtn", "BtnCompleteStyle();", true); //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "clickbtnSingle", "ClickEvent('" + this.HidPcode.Value + "','" + this.HidPid.Value + "','" + SelectedIndex + "','" + this.HidCityID.Value + "','" + this.HidHotelEXLinkMan.Value + "','" + this.HidHotelEXLinkTel.Value + "','" + this.HidHotelEXLinkRemark.Value + "','false','true','false');", true); //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "scrollReset", "GetResultFromServer();", true); //ScriptManager.RegisterStartupScript(this.UpdatePanel11, this.GetType(), "keyclosebtn", "BtnCompleteStyle();", true); //btnSelect_Click(null, null); btnSingleHotel_Click(null, null); if (IsFlag) { if (DateTime.Now.Hour >= 18) { if (gridHotelList.Rows[SelectedIndex].BackColor != System.Drawing.ColorTranslator.FromHtml("#FF6666")) { gridHotelList.Rows[SelectedIndex].Cells[6].Text = "#FF6666"; gridHotelList.Rows[SelectedIndex].Cells[7].Text = "#CD5C5C"; this.operandNum.InnerText = (int.Parse(this.operandNum.InnerText) + 1).ToString(); gridHotelList.Rows[SelectedIndex].BackColor = System.Drawing.ColorTranslator.FromHtml("#FF6666"); ((System.Web.UI.WebControls.WebControl)((Label)gridHotelList.Rows[int.Parse(this.HidSelIndex.Value)].FindControl("Label1"))).BackColor = System.Drawing.ColorTranslator.FromHtml("#CD5C5C"); } } else { if (gridHotelList.Rows[SelectedIndex].BackColor != System.Drawing.ColorTranslator.FromHtml("#80c0a0")) { gridHotelList.Rows[SelectedIndex].Cells[6].Text = "#80c0a0"; gridHotelList.Rows[SelectedIndex].Cells[7].Text = "#70A88C"; this.operandNum.InnerText = (int.Parse(this.operandNum.InnerText) + 1).ToString(); gridHotelList.Rows[SelectedIndex].BackColor = System.Drawing.ColorTranslator.FromHtml("#80c0a0"); ((System.Web.UI.WebControls.WebControl)((Label)gridHotelList.Rows[int.Parse(this.HidSelIndex.Value)].FindControl("Label1"))).BackColor = System.Drawing.ColorTranslator.FromHtml("#70A88C"); } } } }
protected void btnSave_Click(object sender, EventArgs e) { messageContent.InnerHtml = ""; if (String.IsNullOrEmpty(hidHotelID.Value.Trim())) { messageContent.InnerHtml = GetLocalResourceObject("Error1").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if (!wctHotel.AutoResult.Equals(hidHotelID.Value)) { messageContent.InnerHtml = GetLocalResourceObject("Error19").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); return; } if (String.IsNullOrEmpty(dpKeepStart.Value.Trim()) || String.IsNullOrEmpty(dpKeepEnd.Value.Trim())) { messageContent.InnerHtml = GetLocalResourceObject("Error2").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if (String.IsNullOrEmpty(hidWeekList.Value.Trim(','))) { messageContent.InnerHtml = GetLocalResourceObject("Error11").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if ("2".Equals(ddpSaveType.SelectedValue.Trim()) && String.IsNullOrEmpty(hidPlanWeekList.Value.Trim(','))) { messageContent.InnerHtml = GetLocalResourceObject("Error16").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if ("2".Equals(ddpSaveType.SelectedValue.Trim()) && (String.IsNullOrEmpty(dpKeepStart.Value.Trim()) || String.IsNullOrEmpty(dpKeepEnd.Value.Trim()) || String.IsNullOrEmpty(dpPlanTime.Value.Trim()))) { messageContent.InnerHtml = GetLocalResourceObject("Error17").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if ("1".Equals(ddpSaveType.SelectedValue.Trim()) && (String.IsNullOrEmpty(dpPlanDTime.Value.Trim()))) { messageContent.InnerHtml = GetLocalResourceObject("Error18").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } //if (String.IsNullOrEmpty(hidCommonList.Value.Trim())) //{ // messageContent.InnerHtml = GetLocalResourceObject("Error3").ToString(); // //UpdatePanel6.Update(); // return; //} if (String.IsNullOrEmpty(ddpHotelRoomList.SelectedValue.Trim())) { messageContent.InnerHtml = GetLocalResourceObject("Error3").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if (String.IsNullOrEmpty(ddpSup.SelectedValue.Trim())) { messageContent.InnerHtml = GetLocalResourceObject("Error21").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if ("true".Equals(ddpRoomStatus.SelectedValue.Trim().ToLower()) && String.IsNullOrEmpty(txtTwoPrice.Text.Trim())) { messageContent.InnerHtml = GetLocalResourceObject("Error12").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if (!IsValidNumber(txtOnePrice.Text.Trim()) || !IsValidNumber(txtThreePrice.Text.Trim()) || !IsValidNumber(txtFourPrice.Text.Trim()) || !IsValidNumber(txtBedPrice.Text.Trim()) || !IsValidNumber(txtBreakPrice.Text.Trim()) || !IsValidNumber(txtNetPrice.Text.Trim())) { messageContent.InnerHtml = GetLocalResourceObject("Error13").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if (!IsValidTwoPrice(txtTwoPrice.Text.Trim())) { messageContent.InnerHtml = GetLocalResourceObject("Error15").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if (!ChkNumber(txtOffsetval.Text.Trim())) { messageContent.InnerHtml = GetLocalResourceObject("Error14").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if ("true".Equals(ddpRoomStatus.SelectedValue.Trim().ToLower()) && String.IsNullOrEmpty(txtRoomCount.Text.Trim())) { messageContent.InnerHtml = GetLocalResourceObject("Error4").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if (!ChkNumber(txtRoomCount.Text.Trim())) { messageContent.InnerHtml = GetLocalResourceObject("Error4").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } if (!String.IsNullOrEmpty(txtTwoPrice.Text.Trim()) && !ChkLowPrice(txtTwoPrice.Text.Trim())) { this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } string effHour = ""; effHour = GetEffHourVal(ddpEffHour.SelectedValue.Trim()); if ("99".Equals(ddpEffHour.SelectedValue.Trim()) && String.IsNullOrEmpty(effHour)) { messageContent.InnerHtml = GetLocalResourceObject("Error22").ToString(); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); return; } APPContentEntity _appcontentEntity = new APPContentEntity(); _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage(); _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount; _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName; _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP; _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>(); APPContentDBEntity appcontentDBEntity = new APPContentDBEntity(); appcontentDBEntity.HotelID = hidHotelID.Value.ToString().Trim(); appcontentDBEntity.PriceCode = ddpPriceType.SelectedValue.Trim(); //appcontentDBEntity.RoomList = hidCommonList.Value.ToString().Trim(); appcontentDBEntity.RoomCode = ddpHotelRoomList.SelectedValue.Trim(); appcontentDBEntity.RoomName = (ddpHotelRoomList.SelectedItem.Text.Trim().Contains("]")) ? ddpHotelRoomList.SelectedItem.Text.Trim().Substring(ddpHotelRoomList.SelectedItem.Text.Trim().IndexOf(']') + 1) : ddpHotelRoomList.SelectedItem.Text.Trim(); appcontentDBEntity.StartDTime = dpKeepStart.Value.ToString().Trim(); appcontentDBEntity.EndDTime = dpKeepEnd.Value.ToString().Trim(); appcontentDBEntity.EffHour = effHour; appcontentDBEntity.WeekList = hidWeekList.Value.Trim(','); //if ("lmbar".Equals(ddpPriceType.SelectedValue.Trim().ToLower())) //{ // appcontentDBEntity.Note1 = lbNote1.Text.Trim().Substring(1, lbNote1.Text.Trim().IndexOf('】') -1); // appcontentDBEntity.Note2 = lbNote11.Text.Trim().Substring(1, lbNote11.Text.Trim().IndexOf('】') -1); //} //else //{ // appcontentDBEntity.Note1 = lbNote2.Text.Trim().Substring(1, lbNote2.Text.Trim().IndexOf('】') - 1); // appcontentDBEntity.Note2 = lbNote22.Text.Trim().Substring(1, lbNote22.Text.Trim().IndexOf('】') - 1 ); //} appcontentDBEntity.Note1 = ddpGuaid.SelectedValue.Trim(); appcontentDBEntity.Note2 = ddpCxlid.SelectedValue.Trim(); appcontentDBEntity.OnePrice = txtOnePrice.Text.Trim(); appcontentDBEntity.TwoPrice = txtTwoPrice.Text.Trim(); appcontentDBEntity.ThreePrice = txtThreePrice.Text.Trim(); appcontentDBEntity.FourPrice = txtFourPrice.Text.Trim(); appcontentDBEntity.BedPrice = txtBedPrice.Text.Trim(); appcontentDBEntity.NetPrice = txtNetPrice.Text.Trim(); appcontentDBEntity.BreakfastNum = ddpBreakfastNum.SelectedValue.Trim(); appcontentDBEntity.BreakPrice = txtBreakPrice.Text.Trim(); appcontentDBEntity.IsNetwork = ddpIsNetwork.SelectedValue.Trim(); appcontentDBEntity.Offsetval = txtOffsetval.Text.Trim(); appcontentDBEntity.Offsetunit = ddpOffsetunit.SelectedValue.Trim(); appcontentDBEntity.RoomStatus = ddpRoomStatus.SelectedValue.Trim(); appcontentDBEntity.RoomCount = txtRoomCount.Text.Trim(); appcontentDBEntity.IsReserve = ddpIsReserve.SelectedValue.Trim(); appcontentDBEntity.SaveType = ddpSaveType.SelectedValue.Trim(); appcontentDBEntity.PlanDTime = dpPlanDTime.Value.Trim(); appcontentDBEntity.PlanTime = dpPlanTime.Value.Trim(); appcontentDBEntity.PlanStart = dpKeepStart.Value.ToString().Trim(); //dpPlanStart.Value.Trim(); appcontentDBEntity.PlanEnd = dpKeepEnd.Value.ToString().Trim(); //dpPlanEnd.Value.Trim(); appcontentDBEntity.PlanWeek = hidWeekList.Value.Trim(','); //hidPlanWeekList.Value.Trim(','); appcontentDBEntity.Supplier = ddpSup.SelectedValue.Trim(); appcontentDBEntity.UpdateUser = UserSession.Current.UserDspName; _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity); _appcontentEntity = APPContentBP.CreateSalesPlan(_appcontentEntity); int iResult = _appcontentEntity.Result; string strPlanID = _appcontentEntity.APPContentDBEntity[0].PlanID; _commonEntity.LogMessages = _appcontentEntity.LogMessages; _commonEntity.CommonDBEntity = new List<CommonDBEntity>(); CommonDBEntity commonDBEntity = new CommonDBEntity(); commonDBEntity.Event_Type = "酒店销售计划-保存"; commonDBEntity.Event_ID = strPlanID; string conTent = GetLocalResourceObject("EventInsertMessage").ToString(); string msgCommon = string.Empty; msgCommon = ddpHotelRoomList.SelectedItem.Text;// +"[" + ddpHotelRoomList.SelectedValue + "]"; string msgPlanDTime = ""; string PlanStart = ""; string PlanWeekList = ""; if ("1".Equals(ddpSaveType.SelectedValue.Trim())) { msgPlanDTime = dpPlanDTime.Value; } else if ("2".Equals(ddpSaveType.SelectedValue.Trim())) { msgPlanDTime = dpPlanTime.Value; PlanStart = dpKeepStart.Value.ToString().Trim() + "-" + dpKeepEnd.Value.ToString().Trim(); PlanWeekList = hidWeekList.Value.Trim(','); } conTent = string.Format(conTent, hidHotelID.Value.ToString().Trim(), msgCommon, dpKeepStart.Value, dpKeepEnd.Value, ddpEffHour.SelectedValue.Trim(), ddpPriceType.SelectedValue, txtRoomCount.Text.Trim(), ddpRoomStatus.SelectedValue.Trim(), hidWeekList.Value.Trim(','), txtOnePrice.Text.Trim(), txtTwoPrice.Text.Trim(), txtThreePrice.Text.Trim(), txtFourPrice.Text.Trim(), txtBedPrice.Text.Trim(), txtNetPrice.Text.Trim(), ddpBreakfastNum.SelectedValue.Trim(), txtBreakPrice.Text.Trim(), ddpIsNetwork.SelectedValue.Trim(), txtOffsetval.Text.Trim(), ddpOffsetunit.SelectedValue.Trim(), ddpIsReserve.SelectedValue.Trim(), ddpSaveType.SelectedValue.Trim(), msgPlanDTime, PlanStart, PlanWeekList, strPlanID, ddpSup.SelectedValue); commonDBEntity.Event_Content = conTent; if (iResult == 1) { commonDBEntity.Event_Result = GetLocalResourceObject("InsertSuccess").ToString(); messageContent.InnerHtml = GetLocalResourceObject("InsertSuccess").ToString(); } else { commonDBEntity.Event_Result = GetLocalResourceObject("Error8").ToString() + _appcontentEntity.ErrorMSG; messageContent.InnerHtml = GetLocalResourceObject("Error8").ToString() + _appcontentEntity.ErrorMSG; } _commonEntity.CommonDBEntity.Add(commonDBEntity); CommonBP.InsertEventHistory(_commonEntity); this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "BtnCompleteStyle();", true); //UpdatePanel6.Update(); }
public static APPContentEntity HotelDetailListSelect(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "HotelDetailListSelect"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { if (appcontentEntity.APPContentDBEntity.Count > 0 && "1".Equals(appcontentEntity.APPContentDBEntity[0].SerVer)) { return APPContentSA.HotelDetailListSelect(appcontentEntity); } else { return APPContentV2SA.HotelDetailListSelectV2(appcontentEntity); } } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "HotelDetailListSelect Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
public static APPContentEntity BindHotelListGrid(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "BindHotelListGrid"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { return APPContentDA.BindHotelListGrid(appcontentEntity); } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "BindHotelListGrid Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
public static APPContentEntity UpdateSalesPlanStatus(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "UpdateSalesPlanStatus"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { return APPContentDA.UpdateSalesPlanStatus(appcontentEntity); } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "UpdateSalesPlanStatus Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
public static APPContentEntity UpdateSalesPlanList(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "UpdateSalesPlanList"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { APPContentDBEntity dbParm = (appcontentEntity.APPContentDBEntity.Count > 0) ? appcontentEntity.APPContentDBEntity[0] : new APPContentDBEntity(); APPContentDA.UpdateSalesPlanManager(appcontentEntity); APPContentDA.UpdateSalesPlanEventDetail(appcontentEntity); if ("1".Equals(dbParm.SaveType)) { APPContentDA.UpdateSalesPlanEventJobList(appcontentEntity, "0"); if ("1".Equals(dbParm.PlanStatus)) { APPContentDA.CreateSalesPlanEventJobList(appcontentEntity, int.Parse(dbParm.PlanID)); } appcontentEntity.Result = 1; } else if ("2".Equals(dbParm.SaveType)) { if (!ChkPlanJobAction(appcontentEntity)) { DateTime dtStart = DateTime.Parse(dbParm.PlanStart); appcontentEntity.APPContentDBEntity[0].PlanStart = dtStart.AddDays(1).ToShortDateString(); appcontentEntity.Result = 2; } else { appcontentEntity.Result = 1; } APPContentDA.UpdateSalesPlanEventJobListForTime(appcontentEntity, "0"); if ("1".Equals(dbParm.PlanStatus)) { APPContentDA.CreateSalesPlanEventJobList(appcontentEntity, int.Parse(dbParm.PlanID)); } } return appcontentEntity; } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "UpdateSalesPlanList Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
private void BindDataListGrid() { _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage(); _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount; _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName; _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP; _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>(); APPContentDBEntity appcontentDBEntity = new APPContentDBEntity(); appcontentDBEntity.UserCode = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["SalesUser"].ToString())) ? null : ViewState["SalesUser"].ToString(); //appcontentDBEntity.HotelNM = (ViewState.Count == 0 || String.IsNullOrEmpty(ViewState["HotelNm"].ToString())) ? null : ViewState["HotelNm"].ToString(); _appcontentEntity.PageCurrent = AspNetPager1.CurrentPageIndex; _appcontentEntity.PageSize = gridViewCSAPPContenList.PageSize; _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity); _appcontentEntity = APPContentBP.SalesMangeListSelect(_appcontentEntity); DataSet dsResult = _appcontentEntity.QueryResult; gridViewCSAPPContenList.DataSource = dsResult.Tables[0].DefaultView; gridViewCSAPPContenList.DataKeyNames = new string[] { "USERACCOUNT" };//主键 gridViewCSAPPContenList.DataBind(); AspNetPager1.PageSize = gridViewCSAPPContenList.PageSize; AspNetPager1.RecordCount = _appcontentEntity.TotalCount; }
public static APPContentEntity ChkHotelLowLimitPrice(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "ChkHotelLowLimitPrice"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { return APPContentDA.ChkHotelLowLimitPrice(appcontentEntity); } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "ChkHotelLowLimitPrice Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
private bool ChkLowPrice(string param) { APPContentEntity _appcontentEntity = new APPContentEntity(); _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage(); _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount; _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName; _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP; _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>(); APPContentDBEntity appcontentDBEntity = new APPContentDBEntity(); string HotelID = hidHotelID.Value.ToString().Trim().Substring((hidHotelID.Value.ToString().Trim().IndexOf('[') + 1), (hidHotelID.Value.ToString().Trim().IndexOf(']') - 1)); appcontentDBEntity.HotelID = HotelID; appcontentDBEntity.UpdateUser = UserSession.Current.UserDspName; _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity); DataSet dsResult = APPContentBP.ChkHotelLowLimitPrice(_appcontentEntity).QueryResult; if (dsResult.Tables.Count == 0 || dsResult.Tables[0].Rows.Count == 0 || String.IsNullOrEmpty(dsResult.Tables[0].Rows[0][0].ToString().Trim())) { return true; } decimal ilimit = decimal.Parse(dsResult.Tables[0].Rows[0][0].ToString().Trim()); if (ilimit < 1) { return true; } if (decimal.Parse(param) <= ilimit) { messageContent.InnerHtml = String.Format(GetLocalResourceObject("Error20").ToString(), ilimit); return false; } return true; }
public static bool ChkPlanJobAction(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "ChkPlanJobAction"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); bool bResult = true; if (DateTime.Parse(appcontentEntity.APPContentDBEntity[0].PlanStart) > DateTime.Parse(DateTime.Now.ToShortDateString())) { return bResult; } try { APPContentDBEntity dbParm = (appcontentEntity.APPContentDBEntity.Count > 0) ? appcontentEntity.APPContentDBEntity[0] : new APPContentDBEntity(); DataSet dsResult = APPContentDA.CheckSalesPlanEventJobAction(appcontentEntity); if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0) { bResult = false; } return bResult; } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "ChkPlanJobAction Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
/// <summary> /// 更新计划 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDivRenewPlan_Click(object sender, EventArgs e) { APPContentEntity _appcontentEntity = new APPContentEntity(); _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage(); _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount; _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName; _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP; CommonEntity _commonEntity = new CommonEntity(); _commonEntity.CommonDBEntity = new List<CommonDBEntity>(); _commonEntity.LogMessages = new HotelVp.Common.Logger.LogMessage(); _commonEntity.LogMessages.IpAddress = UserSession.Current.UserIP; _commonEntity.LogMessages.Username = UserSession.Current.UserDspName; _commonEntity.LogMessages.Userid = UserSession.Current.UserAccount; CommonDBEntity commonDBEntity = new CommonDBEntity(); _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>(); APPContentDBEntity appcontentDBEntity = new APPContentDBEntity(); #region //城市ID string CityID = this.HidCityID.Value; appcontentDBEntity.CityID = CityID; //酒店ID string hotelID = this.HidPid.Value; appcontentDBEntity.HotelID = hotelID; //酒店名称 string hotelName = this.HidPcode.Value; appcontentDBEntity.HotelNM = hotelName; //价格代码 string priceCode = this.HiddenPriceCode.Value; appcontentDBEntity.PriceCode = priceCode; //价格 string twoPrice = this.HiddenPrice.Value; appcontentDBEntity.TwoPrice = twoPrice; //状态 开启 关闭 string status = this.dropDivStatusOpen.Checked == true ? "true" : "false"; appcontentDBEntity.RoomStatus = status; appcontentDBEntity.PlanStatus = status; if (status == "true") { //房量 if (this.txtDivRoomCount.Text.Trim() != "") { string roomNum = this.txtDivRoomCount.Text; appcontentDBEntity.RoomCount = roomNum; } //是否是保留房 string isReserve = this.ckDivReserve.Checked == true ? "0" : "1"; appcontentDBEntity.IsReserve = isReserve; } else { appcontentDBEntity.RoomCount = this.HiddenRoomNum.Value; appcontentDBEntity.IsReserve = this.HiddenIsReserve.Value; } //房型名称 string RoomName = this.HiddenRoomName.Value; appcontentDBEntity.RoomName = RoomName; //房型Code string RoomCode = this.HiddenRoomCode.Value; appcontentDBEntity.RoomCode = RoomCode; bool IsFlag = false; //批量更新日期 开始 结束 string divPlanStartDate = this.divPlanStartDate.Value; string divPlanEndDate = this.divPlanEndDate.Value; //if (DateTime.Parse(divPlanStartDate) >= System.DateTime.Now || DateTime.Parse(divPlanEndDate) <= System.DateTime.Now) if (DateTime.Parse(divPlanStartDate) == DateTime.Parse(System.DateTime.Now.ToShortDateString())) { IsFlag = true; } appcontentDBEntity.WeekList = "1,2,3,4,5,6,7"; //备注 string remark = this.txtRemark.Value; appcontentDBEntity.Remark = remark; //操作人 string userName = UserSession.Current.UserAccount; appcontentDBEntity.CreateUser = userName; appcontentDBEntity.UpdateUser = userName; #endregion #region appcontentDBEntity.StartDTime = divPlanStartDate; appcontentDBEntity.EndDTime = divPlanEndDate; int DateDiff = calculateDateDiff(divPlanStartDate, divPlanEndDate); for (int j = 0; j <= DateDiff; j++) { appcontentDBEntity.PlanTime = DateTime.Parse(divPlanStartDate).AddDays(j).ToShortDateString(); _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity); CommonBP.InsertConsultRoomHistory(_appcontentEntity); _appcontentEntity.APPContentDBEntity.Clear(); } _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity); _appcontentEntity = HotelInfoBP.RenewPlanFullRoomByUpdatePlan(_appcontentEntity); int SelectedIndex = int.Parse(this.HidSelIndex.Value); //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "clickbtnSingle", "ClickEvent('" + this.HidPcode.Value + "','" + this.HidPid.Value + "','" + SelectedIndex + "','" + this.HidCityID.Value + "','false');", true); //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "clickbtnSingle", "ClickEvent('" + this.HidPcode.Value + "','" + this.HidPid.Value + "','" + SelectedIndex + "','" + this.HidCityID.Value + "','" + this.HidHotelEXLinkMan.Value + "','" + this.HidHotelEXLinkTel.Value + "','" + this.HidHotelEXLinkRemark.Value + "','false','true','false');", true); btnSingleHotel_Click(null, null); //ScriptManager.RegisterStartupScript(this.UpdatePanel4, this.GetType(), "scrollReset", "GetResultFromServer();", true); if (IsFlag) { if (DateTime.Now.Hour >= 18) { if (gridHotelList.Rows[SelectedIndex].BackColor != System.Drawing.ColorTranslator.FromHtml("#FF6666")) { gridHotelList.Rows[SelectedIndex].Cells[6].Text = "#FF6666"; gridHotelList.Rows[SelectedIndex].Cells[7].Text = "#CD5C5C"; this.operandNum.InnerText = (int.Parse(this.operandNum.InnerText) + 1).ToString(); gridHotelList.Rows[SelectedIndex].BackColor = System.Drawing.ColorTranslator.FromHtml("#FF6666"); ((System.Web.UI.WebControls.WebControl)((Label)gridHotelList.Rows[int.Parse(this.HidSelIndex.Value)].FindControl("Label1"))).BackColor = System.Drawing.ColorTranslator.FromHtml("#CD5C5C"); } } else { if (gridHotelList.Rows[SelectedIndex].BackColor != System.Drawing.ColorTranslator.FromHtml("#80c0a0")) { gridHotelList.Rows[SelectedIndex].Cells[6].Text = "#80c0a0"; gridHotelList.Rows[SelectedIndex].Cells[7].Text = "#70A88C"; this.operandNum.InnerText = (int.Parse(this.operandNum.InnerText) + 1).ToString(); gridHotelList.Rows[SelectedIndex].BackColor = System.Drawing.ColorTranslator.FromHtml("#80c0a0"); ((System.Web.UI.WebControls.WebControl)((Label)gridHotelList.Rows[int.Parse(this.HidSelIndex.Value)].FindControl("Label1"))).BackColor = System.Drawing.ColorTranslator.FromHtml("#70A88C"); } } } #endregion ScriptManager.RegisterStartupScript(this.UpdatePanel10, this.GetType(), "keyinvokeCloseDiv", "invokeCloseDiv();", true); ScriptManager.RegisterStartupScript(this.UpdatePanel10, this.GetType(), "keyinvokeCloseDiv1", "BtnCompleteStyle();", true); this.UpdatePanel5.Update(); }
public static APPContentEntity CreateSalesPlan(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "CreateSalesPlan"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { APPContentDBEntity dbParm = (appcontentEntity.APPContentDBEntity.Count > 0) ? appcontentEntity.APPContentDBEntity[0] : new APPContentDBEntity(); using (TransactionScope scope = new TransactionScope()) { int planID = APPContentDA.CreateSalesPlanEvent(appcontentEntity); appcontentEntity.APPContentDBEntity[0].PlanID = planID.ToString(); APPContentDA.CreateSalesPlanEventDetail(appcontentEntity, planID); APPContentDA.CreateSalesPlanEventJobList(appcontentEntity, planID); appcontentEntity.Result = 1; if ("0".Equals(dbParm.SaveType)) { appcontentEntity = APPContentV2SA.CreateSalesPlan(appcontentEntity); APPContentDA.UpdateSalesPlanEventJobStatus(appcontentEntity); } scope.Complete(); } return appcontentEntity; } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "CreateSalesPlan Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }
//public static string GetFaxHotelListColr(string HotelID, HotelInfoEntity hotelInfoEntity) //{ // OracleParameter[] parm ={ // new OracleParameter("HOTELID",OracleType.VarChar), // new OracleParameter("OutDate",OracleType.VarChar), // new OracleParameter("FaxNum",OracleType.VarChar), // new OracleParameter("FaxStatus",OracleType.VarChar), // new OracleParameter("AuditStatus",OracleType.VarChar), // new OracleParameter("OrderID",OracleType.VarChar), // }; // HotelInfoDBEntity dbParm = (hotelInfoEntity.HotelInfoDBEntity.Count > 0) ? hotelInfoEntity.HotelInfoDBEntity[0] : new HotelInfoDBEntity(); // parm[0].Value = HotelID; // if (String.IsNullOrEmpty(dbParm.OutDate)) // { // parm[1].Value = DBNull.Value; // } // else // { // parm[1].Value = dbParm.OutDate; // } // if (String.IsNullOrEmpty(dbParm.FaxNum)) // { // parm[2].Value = DBNull.Value; // } // else // { // parm[2].Value = dbParm.FaxNum; // } // if (String.IsNullOrEmpty(dbParm.FaxStatus)) // { // parm[3].Value = DBNull.Value; // } // else // { // parm[3].Value = dbParm.FaxStatus; // } // if (String.IsNullOrEmpty(dbParm.AuditStatus)) // { // parm[4].Value = DBNull.Value; // } // else // { // parm[4].Value = dbParm.AuditStatus; // } // if (String.IsNullOrEmpty(dbParm.OrderID)) // { // parm[5].Value = DBNull.Value; // } // else // { // parm[5].Value = dbParm.OrderID; // } // DataSet dsResult = DbManager.Query("OrderInfo", "t_lm_orderappromginfo_fax_select", true, parm); // if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0) // { // } // else // { // return "0"; // } //} public static APPContentEntity GetHasChangedConsultRoomList(APPContentEntity APPContentEntity) { APPContentDBEntity dbParm = (APPContentEntity.APPContentDBEntity.Count > 0) ? APPContentEntity.APPContentDBEntity[0] : new APPContentDBEntity(); DataCommand cmd = DataCommandManager.GetDataCommand("GetHasChangedConsultRoomList"); cmd.SetParameterValue("@CreateUser", dbParm.CreateUser); APPContentEntity.QueryResult = cmd.ExecuteDataSet(); return APPContentEntity; }
public static APPContentEntity AutoSelect(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "Select"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); DataSet dsRestult = new DataSet(); dsRestult.Tables.Add(new DataTable()); dsRestult.Tables[0].Columns.Add("CITYID"); dsRestult.Tables[0].Columns.Add("CITYNM"); dsRestult.Tables[0].Columns.Add("HOTELID"); dsRestult.Tables[0].Columns.Add("HOTELNM"); dsRestult.Tables[0].Columns.Add("ERRMSG"); dsRestult.Tables[0].Columns.Add("TYPEID"); string strVer = (appcontentEntity.APPContentDBEntity.Count > 0) ? appcontentEntity.APPContentDBEntity[0].SerVer : ""; try { DataSet dsCity = new DataSet(); if (String.IsNullOrEmpty(appcontentEntity.APPContentDBEntity[0].CityID)) { if ("1".Equals(strVer)) { dsCity = APPContentSA.CommonSelect(appcontentEntity).QueryResult; } else { dsCity = APPContentV2SA.CommonSelect(appcontentEntity).QueryResult; } } else { dsCity.Tables.Add(new DataTable()); dsCity.Tables[0].Columns.Add("cityid"); dsCity.Tables[0].Columns.Add("cityNM"); DataRow drRow = dsCity.Tables[0].NewRow(); drRow["cityid"] = appcontentEntity.APPContentDBEntity[0].CityID; drRow["cityNM"] = appcontentEntity.APPContentDBEntity[0].CityNM; dsCity.Tables[0].Rows.Add(drRow); } APPContentEntity _appcontentEntity = new APPContentEntity(); _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage(); _appcontentEntity.LogMessages.Userid = appcontentEntity.LogMessages.Userid; _appcontentEntity.LogMessages.Username = appcontentEntity.LogMessages.Username; _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>(); APPContentDBEntity _appcontentDBEntity = new APPContentDBEntity(); _appcontentEntity.APPContentDBEntity.Add(_appcontentDBEntity); _appcontentEntity.APPContentDBEntity[0].PlatForm = "IOS"; _appcontentEntity.APPContentDBEntity[0].TypeID = "1"; DataSet dsHotel = new DataSet(); DataSet dsHotelMain = new DataSet(); ArrayList ayHotelImage = new ArrayList(); DataSet dsHotelRoom = new DataSet(); DataSet dsHotelFtType = new DataSet(); ArrayList alIgnore = new ArrayList(); APPContentEntity dsHotelDetail = new APPContentEntity(); foreach (DataRow drCity in dsCity.Tables[0].Rows) { _appcontentEntity.APPContentDBEntity[0].CityID = drCity["cityid"].ToString(); if ("1".Equals(strVer)) { dsHotel = APPContentSA.HotelListSelect(_appcontentEntity).QueryResult; } else { dsHotel = APPContentV2SA.HotelListSelect(_appcontentEntity).QueryResult; } foreach (DataRow drHotel in dsHotel.Tables[0].Rows) { _appcontentEntity.APPContentDBEntity[0].HotelID = drHotel[0].ToString(); if ("1".Equals(strVer)) { dsHotelDetail = APPContentSA.HotelDetailListSelect(_appcontentEntity); } else { dsHotelDetail = APPContentV2SA.HotelDetailListSelectV2(_appcontentEntity); } dsHotelMain = dsHotelDetail.APPContentDBEntity[0].HotelMain; ayHotelImage = dsHotelDetail.APPContentDBEntity[0].HotelImage; dsHotelRoom = dsHotelDetail.APPContentDBEntity[0].HotelRoom; dsHotelFtType = dsHotelDetail.APPContentDBEntity[0].HotelFtType; if (dsHotelMain.Tables.Count > 0 && dsHotelMain.Tables[0].Rows.Count > 0) { alIgnore = APPContentDA.GetHotelIgnore(drHotel[0].ToString()); if (!alIgnore.Contains("HOTELNM") && String.IsNullOrEmpty(dsHotelMain.Tables[0].Rows[0]["HOTELNM"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少酒店名称"; drErNm["TYPEID"] = "HOTELNM"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("ADDRESS") && String.IsNullOrEmpty(dsHotelMain.Tables[0].Rows[0]["ADDRESS"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少酒店地址"; drErNm["TYPEID"] = "ADDRESS"; dsRestult.Tables[0].Rows.Add(drErNm); } if ((!alIgnore.Contains("LGLTTUDE")) && ((String.IsNullOrEmpty(dsHotelMain.Tables[0].Rows[0]["LONGITUDE"].ToString().Trim()) || String.IsNullOrEmpty(dsHotelMain.Tables[0].Rows[0]["LATITUDE"].ToString().Trim())) || (!ChkTudeValue(dsHotelMain.Tables[0].Rows[0]["LONGITUDE"].ToString().Trim()) || !ChkTudeValue(dsHotelMain.Tables[0].Rows[0]["LATITUDE"].ToString().Trim())))) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少酒店经纬度"; drErNm["TYPEID"] = "LGLTTUDE"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("HOTELDES") && String.IsNullOrEmpty(dsHotelMain.Tables[0].Rows[0]["HOTELDES"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少酒店概况"; drErNm["TYPEID"] = "HOTELDES"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("HOTELAPPR") && (String.IsNullOrEmpty(dsHotelMain.Tables[0].Rows[0]["HOTELAPPR"].ToString().Trim()) || (!ChkApprValue(dsHotelMain.Tables[0].Rows[0]["HOTELAPPR"].ToString().Trim())))) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "请检查酒店小贴士"; drErNm["TYPEID"] = "HOTELAPPR"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("HOTELSERVICE") && String.IsNullOrEmpty(dsHotelMain.Tables[0].Rows[0]["HOTELSERVICE"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少酒店服务信息"; drErNm["TYPEID"] = "HOTELSERVICE"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("BUSSES") && String.IsNullOrEmpty(dsHotelMain.Tables[0].Rows[0]["BUSSES"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少商务设施信息"; drErNm["TYPEID"] = "BUSSES"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("TRADEAREA") && (String.IsNullOrEmpty(drHotel["TRADEAREA"].ToString().Trim()) || "其它".Equals(drHotel["TRADEAREA"].ToString().Trim()))) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少商圈信息"; drErNm["TYPEID"] = "TRADEAREA"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("SALES") && (!APPContentDA.GetHotelSales(drHotel["HOTELID"].ToString()))) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少酒店销售人员信息"; drErNm["TYPEID"] = "SALES"; dsRestult.Tables[0].Rows.Add(drErNm); } //if (String.IsNullOrEmpty(dsHotelMain.Tables[0].Rows[0]["CUSTOMTEL"].ToString().Trim())) //{ // lbCustomTel.Text = ""; // messageContent = messageContent + GetLocalResourceObject("ErrorMsgHotelSerTel").ToString() + "<br/>"; //} } else { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少酒店基础信息"; drErNm["TYPEID"] = ""; dsRestult.Tables[0].Rows.Add(drErNm); } DataSet dsLink = APPContentDA.HotelLinkSelect(_appcontentEntity); if (dsLink.Tables.Count > 0 && dsLink.Tables[0].Rows.Count > 0) { if (!alIgnore.Contains("LINKTEL") && String.IsNullOrEmpty(dsLink.Tables[0].Rows[0]["LINKTEL"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少酒店预订电话"; drErNm["TYPEID"] = "LINKTEL"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("LINKFAX") && String.IsNullOrEmpty(dsLink.Tables[0].Rows[0]["LINKFAX"].ToString().Trim())) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少酒店预订传真"; drErNm["TYPEID"] = "LINKFAX"; dsRestult.Tables[0].Rows.Add(drErNm); } } else { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少订单传递方式"; drErNm["TYPEID"] = ""; dsRestult.Tables[0].Rows.Add(drErNm); } if (!alIgnore.Contains("HTIMAGE") && (ayHotelImage.Count == 0 || !ChkHotelImagePath(ayHotelImage))) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "请检查酒店图片信息"; drErNm["TYPEID"] = "HTIMAGE"; dsRestult.Tables[0].Rows.Add(drErNm); } if (dsHotelRoom.Tables.Count > 0 && dsHotelRoom.Tables[0].Rows.Count > 0) { string strROOMNM = ""; string strROOMCODE = ""; string strBEDNM = ""; string strNETPRICE = ""; string strVPPRICE = ""; for (int i = 0; i < dsHotelRoom.Tables[0].Rows.Count; i++) { if (!alIgnore.Contains("ROOMNM") && String.IsNullOrEmpty(dsHotelRoom.Tables[0].Rows[i]["ROOMNM"].ToString()) && String.IsNullOrEmpty(strROOMNM)) { strROOMNM = "缺少房型名称"; } if (!alIgnore.Contains("ROOMCODE") && String.IsNullOrEmpty(dsHotelRoom.Tables[0].Rows[i]["ROOMCODE"].ToString()) && String.IsNullOrEmpty(strROOMCODE)) { strROOMCODE = "缺少房型代码"; } if (!alIgnore.Contains("BEDNM") && String.IsNullOrEmpty(dsHotelRoom.Tables[0].Rows[i]["BEDNM"].ToString()) && String.IsNullOrEmpty(strBEDNM)) { strBEDNM = "缺少床型名称"; } if (!alIgnore.Contains("NETPRICE") && String.IsNullOrEmpty(dsHotelRoom.Tables[0].Rows[i]["NETPRICE"].ToString()) && String.IsNullOrEmpty(strNETPRICE)) { strNETPRICE = "缺少网络价"; } if (!alIgnore.Contains("VPPRICE") && String.IsNullOrEmpty(strVPPRICE) && (String.IsNullOrEmpty(dsHotelRoom.Tables[0].Rows[i]["VPPRICE"].ToString()) || (!String.IsNullOrEmpty(dsHotelRoom.Tables[0].Rows[i]["VPPRICE"].ToString()) && decimal.Parse(dsHotelRoom.Tables[0].Rows[i]["VPPRICE"].ToString()) < 10))) { strVPPRICE = "价格低于10元"; } } if (!String.IsNullOrEmpty(strROOMNM)) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = strROOMNM; drErNm["TYPEID"] = "ROOMNM"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!String.IsNullOrEmpty(strROOMCODE)) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = strROOMCODE; drErNm["TYPEID"] = "ROOMCODE"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!String.IsNullOrEmpty(strBEDNM)) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = strBEDNM; drErNm["TYPEID"] = "BEDNM"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!String.IsNullOrEmpty(strNETPRICE)) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = strNETPRICE; drErNm["TYPEID"] = "NETPRICE"; dsRestult.Tables[0].Rows.Add(drErNm); } if (!String.IsNullOrEmpty(strVPPRICE)) { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = strVPPRICE; drErNm["TYPEID"] = "VPPRICE"; dsRestult.Tables[0].Rows.Add(drErNm); } } else { DataRow drErNm = dsRestult.Tables[0].NewRow(); drErNm["CITYID"] = drCity["cityid"].ToString(); drErNm["CITYNM"] = drCity["cityNM"].ToString(); drErNm["HOTELID"] = drHotel["HOTELID"].ToString(); drErNm["HOTELNM"] = drHotel["HOTELNM"].ToString(); drErNm["ERRMSG"] = "缺少酒店房型信息"; drErNm["TYPEID"] = ""; dsRestult.Tables[0].Rows.Add(drErNm); } } } appcontentEntity.QueryResult = dsRestult; return appcontentEntity; } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "Select Error: " + ex.Message; throw ex; } }
private DataSet GetConsultRoomHistoryList() { APPContentEntity _appcontentEntity = new APPContentEntity(); _appcontentEntity.LogMessages = new HotelVp.Common.Logger.LogMessage(); _appcontentEntity.LogMessages.Userid = UserSession.Current.UserAccount; _appcontentEntity.LogMessages.Username = UserSession.Current.UserDspName; _appcontentEntity.LogMessages.IpAddress = UserSession.Current.UserIP; _appcontentEntity.APPContentDBEntity = new List<APPContentDBEntity>(); APPContentDBEntity appcontentDBEntity = new APPContentDBEntity(); appcontentDBEntity.CreateUser = UserSession.Current.UserDspName; _appcontentEntity.APPContentDBEntity.Add(appcontentDBEntity); DataSet dsResult = HotelInfoBP.GetHasChangedConsultRoomList(_appcontentEntity).QueryResult; return dsResult; }
public static int DeteleHotelGroupList(APPContentEntity appcontentEntity) { appcontentEntity.LogMessages.MsgType = MessageType.INFO; appcontentEntity.LogMessages.Content = _nameSpaceClass + "DeteleHotelGroupList"; LoggerHelper.LogWriter(appcontentEntity.LogMessages); try { return APPContentDA.DeteleHotelGroupList(appcontentEntity); } catch (Exception ex) { appcontentEntity.LogMessages.MsgType = MessageType.ERROR; appcontentEntity.LogMessages.Content = _nameSpaceClass + "DeteleHotelGroupList Error: " + ex.Message; LoggerHelper.LogWriter(appcontentEntity.LogMessages); throw ex; } }