public void Bind1() { ul1.InnerHtml = ""; string Divli = ""; string img = ""; string sjsj = ""; int count = 0; DataSet dt = fmnumber.GetList(" Rn_roomNum in('F-02','A-20','A-18','A-16','A-15' ) order by Rn_roomNum desc"); foreach (DataRow dr in dt.Tables[0].Rows) { string Names = ""; if ((dr["Rn_state"]) == null || dr["Rn_state"].ToString() == "") { dr["Rn_state"] = "0"; } string FtNames = fmft.GetModel(Convert.ToInt32(dr["Rn_state"])).room_state_name; GetClass(Convert.ToInt32(dr["Rn_state"])); if (FtNames == "干净房") { sjsj = "ondblclick=\"ShowTab('在住房信息'," + dr["id"].ToString() + ",0)\""; } else { sjsj = ""; } if (FtNames == "在住房") { try { string a = dr["Rn_roomNum"].ToString(); Names = fmmx.GetModels(" where occ_with='否' and state_id=0 and room_number='" + dr["Rn_roomNum"].ToString() + "'").occ_name; dr["id"] = fmmx.GetModels(" where occ_with='否' and state_id=0 and room_number='" + dr["Rn_roomNum"].ToString() + "'").occ_id; } catch { } } string b = dr["Rn_roomNum"].ToString(); string Room_suods = fmnumber.GetModelList(" Rn_roomNum='" + b + "'")[0].Room_suod.ToString().Trim(); if (Room_suods == "是") { img = "锁定"; } else { img = ""; } if (count == 0) { Divli += "<li rooms=" + dr["Rn_roomNum"].ToString() + " id=" + Convert.ToInt32(dr["id"].ToString()) + " state=" + Convert.ToInt32(dr["Rn_state"]) + " " + sjsj + " class='bgblue left01roomb " + Style + "' >" + dr["Rn_roomNum"].ToString() + " " + img + "</li>"; } else { Divli += "<li rooms=" + dr["Rn_roomNum"].ToString() + " id=" + Convert.ToInt32(dr["id"].ToString()) + " state=" + Convert.ToInt32(dr["Rn_state"]) + " " + sjsj + " class='" + Style + "'>" + dr["Rn_roomNum"].ToString() + " " + img + "</li>"; } count++; } ul1.InnerHtml = Divli; }
void Yue() { double xiaofei = 0; //消费 double shoukuan = 0; //收款 double yue = 0; //余额 string room1 = context.Request.QueryString["roomNum"].ToString(); int id = fmoc.GetModels(" where room_number='" + room1 + "' and state_id=0 and occ_with='否'").occ_id; string orderid = fmoc.GetModels(" where room_number='" + room1 + "' and state_id=0 and occ_with='否'").order_id; IList <Model.goods_account> list = gmGood.GetModelList1(" ga_occuid='" + orderid + "'"); for (int i = 0; i < list.Count; i++) { xiaofei += Convert.ToDouble((list[i].ga_price)); shoukuan += Convert.ToDouble((list[i].ga_sum_price)); } yue = shoukuan - xiaofei; context.Response.Write(yue); }
/// <summary> /// 绑定是否催帐 /// </summary> private void Bind() { try { Model.FtSet modelfs = bllfs.GetModel(1); DataSet dts = brbll.GetList("Rn_state in(2,7)"); foreach (DataRow drs in dts.Tables[0].Rows) { string a = drs["Rn_roomNum"].ToString(); Model.occu_infor modelocc = fmmx.GetModels(" where occ_with='否' and state_id=0 and room_number='" + a + "'"); if (modelocc != null) { str1 = "state_id=0 and u.sa < " + modelocc.real_price + " and"; if (modelfs.showday) { str1 = "state_id=0 and u.sa < " + Convert.ToInt32(modelfs.daynum) * modelocc.real_price + " and"; } else { str1 = ""; } if (modelfs.showyue) { str1 += " u.sa<" + modelfs.moneyNum + " and"; } dstable = brbll.GetProc(str1, 5, a, DateTime.Now.ToString()); //dstable = brBll.GetListed("", "inner join( select * from occu_infor as oi inner join (select SUM(ga_price)-SUM(ga_sum_price) as sa,ga_occuid as t from goods_account where ga_isys=1 group by ga_occuid) as u on u.t =oi.order_id where " + str1 + " datediff(D,[depar_time],'" + DateTime.Now.ToString() + "')=0) as uio on uio.room_number=a.Rn_roomNum and Rn_floor=" + dr["floor_id"].ToString() + " and room_number='" + a + "'"); if (dstable.Tables[0].Rows.Count > 0) { if (!dicCz.ContainsKey(a)) { dicCz.Add(a, "1"); } } } } Session["iscz"] = dicCz; } catch (Exception ex) { throw; } }
/// <summary> ///添加入住信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAdds_Click(object sender, EventArgs e) { try { Model.order_infor ordermodel = new Model.order_infor(); Model.goods_account goodmodles = new Model.goods_account(); Model.goods_account goodmodlfz = new Model.goods_account(); CdHotelManage.Model.occu_infor model = new CdHotelManage.Model.occu_infor(); CdHotelManage.Model.occu_infor models = new CdHotelManage.Model.occu_infor(); CdHotelManage.BLL.occu_infor bll = new CdHotelManage.BLL.occu_infor(); model.order_id = occno; model.occ_no = "RZ" + System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "").Replace("/", ""); model.room_number = this.txt_roomid.Value; model.real_type_id = Convert.ToInt32(this.ddroomtype.SelectedValue); model.real_price = Convert.ToDecimal(this.txt_money.Value); model.occ_with = "否"; model.occ_time = Convert.ToDateTime(this.txt_rzdate.Value); model.stay_day = Convert.ToInt32(this.txt_Day.Value); model.depar_time = Convert.ToDateTime(this.txt_ylDate.Value); model.occ_name = this.txt_name.Value; model.sex = this.txt_Sex.Value; model.brithday = this.txt_Date2.Value; model.family_name = this.txt_mingzhu.Value; model.card_id = Convert.ToInt32(this.DDlSFz.SelectedValue);; model.card_no = (this.txt_CardId.Value); model.remark = this.txt_Remaker.Value;//备注 if (DDlZffs.SelectedValue == "信用预授权") { // model.meth_pay_id = 0; } else { model.meth_pay_id = Convert.ToInt32(DDlZffs.SelectedValue);//支付方式 } model.deposit = Convert.ToDecimal(txt_yjmoney.Value); model.address = txt_address.Value; //地址 model.lordRoomid = txt_zfzhanghao.Value; //主房账号 model.phonenum = txt_lxphone.Value; //联系电话 model.tuifaId = "0"; model.continuelive = 0; model.sort = txtsort.Value; string[] hidAdd = contents.Split('|'); if (Request.QueryString["type"].ToString() == "0" || Request.QueryString["type"].ToString() == "yding") { if (hidAdd.Length > 2) { for (int i = 0; i < hidAdd.Length - 1; i++) { try { string NumNo = "000" + i; string a = hidAdd[i].Split('#')[0].Trim(); model.order_id = occno.ToString(); model.occ_no = "RZ" + System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "").Replace("/", "") + NumNo; model.room_number = hidAdd[i].Split('#')[0]; model.real_type_id = Convert.ToInt32(hidAdd[i].Split('#')[1]); model.source_id = Convert.ToInt32(hidAdd[i].Split('#')[2]); model.real_scheme_id = Convert.ToInt32(hidAdd[i].Split('#')[3]); model.real_price = Convert.ToDecimal(hidAdd[i].Split('#')[4]); model.occ_with = hidAdd[i].Split('#')[5]; model.real_mode_id = Convert.ToInt32(hidAdd[i].Split('#')[6]); model.occ_time = Convert.ToDateTime(hidAdd[i].Split('#')[7]); model.pre_live_day = Convert.ToInt32(hidAdd[i].Split('#')[8]); model.depar_time = Convert.ToDateTime(hidAdd[i].Split('#')[9]); model.occ_name = hidAdd[i].Split('#')[10]; model.sex = hidAdd[i].Split('#')[11]; model.brithday = hidAdd[i].Split('#')[12]; model.family_name = hidAdd[i].Split('#')[13]; model.card_id = Convert.ToInt32(hidAdd[i].Split('#')[14]); model.card_no = (hidAdd[i].Split('#')[15]); model.mem_cardno = hidAdd[i].Split('#')[16];//会员卡号 // model.remark = hidAdd[i].Split('#')[17]; // model.meth_pay_id = Convert.ToInt32(contents.Split('#')[18]);//支付方式 // model.deposit = Convert.ToInt32(contents.Split('#')[19]); model.address = hidAdd[i].Split('#')[19];//地址 if (a != "") { if (model.lordRoomid == model.room_number) { model.deposit = Convert.ToDecimal(txt_yjmoney.Value); model.remark = txt_Remaker.Value; } else { model.deposit = 0; txt_Remaker.Value = ""; } bll.Add(model); if (Request.QueryString["type"].ToString() == "yding") { try { string sql = " update Book_Rdetail set Room_typeid=2 from Book_Rdetail where Book_no='" + Request.QueryString["ydbookno"].ToString() + "' and Room_typeid=1 and Room_number='" + model.room_number + "'"; fmrdet.Updates(sql); } catch { } } goodmodlfz.ga_name = "房费"; goodmodlfz.ga_sum_price = Convert.ToDecimal(hidAdd[i].Split('#')[4]); goodmodlfz.ga_number = "FZ" + System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "").Replace("/", ""); goodmodlfz.ga_price = 0; goodmodlfz.ga_date = Convert.ToDateTime(System.DateTime.Now); goodmodlfz.ga_people = UserNow.UserID; goodmodlfz.ga_sfacount = "否"; goodmodlfz.ga_Type = 8; goodmodlfz.ga_isjz = 0; goodmodles.Ga_goodNo = bll.GetModels(" where occ_with='否' and room_number='" + txt_roomid.Value + "' and state_id=0").occ_no; // goodmodlfz.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue); goodmodlfz.ga_remker = txt_Remaker.Value; goodmodlfz.ga_roomNumber = model.room_number; goodmodlfz.ga_occuid = occno; fmzj.Add(goodmodlfz); string str2 = "update room_number set Rn_state=2 where Rn_roomNum='" + model.room_number + "'"; fhBll.Updates(str2); } } catch { } } } else { if (bll.Add(model) > 0) { goodmodlfz.ga_name = "房费"; goodmodlfz.ga_sum_price = Convert.ToDecimal(txt_money.Value); goodmodlfz.ga_number = "FZ" + System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "").Replace("/", ""); goodmodlfz.ga_price = 0; goodmodlfz.ga_date = Convert.ToDateTime(System.DateTime.Now); goodmodlfz.ga_people = UserNow.UserID; goodmodlfz.ga_sfacount = "否"; goodmodlfz.ga_Type = 8; goodmodlfz.ga_isjz = 0; // goodmodlfz.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue); goodmodlfz.ga_remker = txt_Remaker.Value; goodmodlfz.ga_roomNumber = txt_roomid.Value; goodmodlfz.Ga_goodNo = bll.GetModels(" where occ_with='否' and room_number='" + txt_roomid.Value + "' and state_id=0").occ_no; // goodmodlfz.ga_occuid = bll.GetModels(" where occ_with='否' and room_number=" + txt_roomid.Value + " and state_id=0").order_id; goodmodlfz.ga_occuid = occno; fmzj.Add(goodmodlfz); string SQl = "update room_number set Rn_state=2 where Rn_roomNum='" + txt_roomid.Value + "'"; fhBll.Updates(SQl); } } } if (Request.QueryString["type"].ToString() == "1") { model.order_id = fmmx.GetModels(" where occ_with='否' and state_id=0 and room_number='" + roomsid + "'").order_id; model.occ_id = Convert.ToInt32(ids); if (bll.Update(model)) { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "alert('修改成功');ShowTabs('房态图');", true); } else { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "alert('修改失败')", true); } } else { ordermodel.order_no = occno; ordermodel.order_time = System.DateTime.Now; ordermodel.room_id = txt_zfzhanghao.Value; if (fmorder.Add(ordermodel) > 0) { goodmodles.ga_name = "入住收款"; goodmodles.ga_sum_price = 0; goodmodles.ga_number = "YZYJ" + System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "");; goodmodles.ga_price = Convert.ToDecimal(txt_yjmoney.Value); goodmodles.ga_date = Convert.ToDateTime(System.DateTime.Now); goodmodles.ga_people = UserNow.UserID; goodmodles.ga_sfacount = "是"; goodmodles.ga_Type = 7; goodmodlfz.ga_isjz = 0; goodmodles.Ga_goodNo = bll.GetModels(" where occ_with='否' and room_number='" + txt_roomid.Value + "' and state_id=0").occ_no; goodmodles.ga_remker = txt_Remaker.Value; goodmodles.ga_roomNumber = txt_roomid.Value; if (DDlZffs.SelectedValue == "信用预授权") { // goodmodles.ga_zffs_id =0; goodmodles.ga_occuid = bll.GetModels(" where occ_with='否' and room_number='" + txt_roomid.Value + "' and state_id=0").occ_no; } else { goodmodles.ga_occuid = occno; // goodmodles.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue); } fmzj.Add(goodmodles); ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "if(confirm('开房成功,是否打印入住单')){PrintRZ(this," + model.order_id + ");}else{ShowTabs('房态图');}", true); } else { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "alert('开房失败')", true); } } string SQL = "delete from occu_infor where room_number='" + this.txt_roomid.Value + "' and state_id=0 and occ_with='是'"; fmmx.Deletes(SQL); string[] content = txt_zhi.Value.Split('|'); for (int i = 0; i < content.Length; i++) { models.order_id = fmmx.GetModels(" where occ_with='否' and state_id=0 and room_number='" + roomsid + "'").order_id; models.room_number = content[i].Split(',')[0]; models.occ_name = content[i].Split(',')[1]; models.sex = content[i].Split(',')[2]; models.brithday = content[i].Split(',')[3]; models.card_id = fsfBll.GetModelList(" ct_name='" + content[i].Split(',')[4] + "'")[0].id; models.card_no = content[i].Split(',')[5]; models.address = content[i].Split(',')[6]; models.occ_time = Convert.ToDateTime(System.DateTime.Now.ToString()); models.occ_with = "是"; // models.room_number = this.txt_roomid.Value; bll.Add(models); } } catch { } }
//更新连房ICOSession private void UpdateSeesion() { int index = 0; ListOcc = fmmx.GetModelList("occ_with='否' and state_id=0"); if (ListOcc.Count > 1) { foreach (Model.occu_infor item in ListOcc) { List <Model.occu_infor> listocc1 = fmmx.GetModelList("order_id='" + fmmx.GetModels(" where occ_with='否' and occ_no!='' and state_id=0 and room_number='" + item.room_number + "'").order_id + "' and occ_no!='' and state_id=0"); if (listocc1.Count > 1) { if (dicstr.ContainsKey(item.room_number.ToString())) { //如果包含 //LFimg = dicstr[drs["Rn_roomNum"].ToString()]; } else { index++; foreach (Model.occu_infor i1 in listocc1) { if (!dicstr.ContainsKey(i1.room_number)) { dicstr.Add(i1.room_number, "<img src='/admin/images/" + index + ".png' />"); } } } } } } context.Session["dic"] = dicstr; }
public void Bind() { sbhtml.Clear(); Dictionary <string, string> dicstr = new Dictionary <string, string>(); Dictionary <string, string> dicCz = new Dictionary <string, string>(); /*计算边房对应的图标*/ List <Model.occu_infor> listocc = fmmx.GetModelList("occ_with='否' and state_id=0"); dicstr = Session["dic"] as Dictionary <string, string>; dicCz = Session["iscz"] as Dictionary <string, string>; StrWheres(); DivContent.InnerHtml = ""; string sjsj = ""; string img = ""; string GoodNo = ""; Model.room_number frmfh = new Model.room_number(); Model.floor_manage frmlc = new Model.floor_manage(); DataTable dt = fmlc.GetListYou(); List <Model.room_number> listrn = bllrn.GetModelList(""); if (listrn.Count > 0) { allroom = listrn.Count; } DataSet dts = null; foreach (DataRow dr in dt.Rows) { dts = brBll.GetList(stwhere + " and Rn_floor=" + dr["floor_id"].ToString() + ""); //if (txt_Namesp.Value == "") //{ // dts = brBll.GetList(stwhere + " and Rn_floor=" + dr["floor_id"].ToString() + ""); //} //else if (txt_Namesp.Value == "欠费") //{ // string SQL = "select (SUM(ga_price)-SUM(ga_sum_price)) as c,ga_occuid from dbo.goods_account where ga_occuid in (select order_id from dbo.occu_infor where state_id=0) group by ga_occuid"; // spanqianf.Attributes.Add("class", "bor"); // dtQX = fmgood.GoodsQX(SQL); // foreach (DataRow drqf in dtQX.Tables[0].Rows) // { // if (Convert.ToDouble(drqf["c"]) < 0) // { // if (GoodNo == "") // { // drqfsb.Append("'" + drqf["ga_occuid"].ToString() + "'"); // } // else { drqfsb.Append("," + "'" + drqf["ga_occuid"].ToString() + "'"); } // } // } // if (drqfsb.ToString() == "") //如果没有欠费 // { // dts = brBll.GetList("1!=1"); // } // else//查询出来所有的欠费房间 // { // dts = brBll.GetListed(stwhere + " and Rn_floor=" + dr["floor_id"].ToString() + " and b.order_id in(" + drqfsb.ToString() + ")", " left join occu_infor as b on a.Rn_roomNum=b.room_number left join real_mode as c on b.real_mode_id=c.real_mode_id "); // } //} //else if (txt_Namesp.Value == "催帐") { // dts = brBll.GetListed("", "inner join( select * from occu_infor as oi inner join (select SUM(ga_price)-SUM(ga_sum_price) as sa,ga_occuid as t from goods_account where ga_isys=1 group by ga_occuid) as u on u.t =oi.order_id where u.sa<oi.real_price and datediff(D,[depar_time],'"+DateTime.Now.ToString()+"')=0) as uio on uio.room_number=a.Rn_roomNum and Rn_floor=" + dr["floor_id"].ToString() + ""); //} //else if (txt_Namesp.Value == "将走房") { // dts = brBll.GetList("Rn_floor=" + dr["floor_id"].ToString() + ""); //} //else //{ // dts = brBll.GetListed(stwhere + " and Rn_floor=" + dr["floor_id"].ToString() + "", " left join occu_infor as b on a.Rn_roomNum=b.room_number left join real_mode as c on b.real_mode_id=c.real_mode_id "); //} if (dts.Tables[0].Rows.Count > 0) { sbhtml.Append("<ul class='main'>"); foreach (DataRow drs in dts.Tables[0].Rows) { price = ""; Names = ""; xuzhu = ""; jzfimg = ""; LFimg = ""; totime = ""; numDay = ""; if ((drs["Rn_state"]) == null || drs["Rn_state"].ToString() == "") { drs["Rn_state"] = "0"; } FtNames = fmft.GetModel(Convert.ToInt32(drs["Rn_state"])).room_state_name; GetClass(Convert.ToInt32(drs["Rn_state"])); if (FtNames == "干净房") { sjsj = "ondblclick=\"ShowTabt('在住房信息'," + drs["id"].ToString() + ",0,this)\""; } else { sjsj = ""; } if (txt_Namesp.Value == "催帐") { czico = "<img src='/admin/images/iconcuizhang.png' />"; czCount++; } if (FtNames == "在住房" || FtNames == "脏住房") { try { a = drs["Rn_roomNum"].ToString(); lfcounts = 0; modelocc = fmmx.GetModels(" where occ_with='否' and state_id=0 and room_number='" + a + "'"); Names = modelocc.occ_name; totime = modelocc.occ_time.ToString("g"); real_mode_id = modelocc.real_mode_id; drs["id"] = modelocc.occ_id; switch (real_mode_id) { case 2: price = "<img src='../../images/sicon04.png' class=\"zdf\"/>"; zdfang++; break; case 19: price = "<img src='../../images/sicon01.png' class=\"yuezhu\"/>"; yzf++; break; case 5: price = "<img src='../../images/sicon03.png' class=\"lccio\" />"; lingcfang++; break; case 20: price = "<img src='/admin/images/iconfree.png' class=\"free\"/>"; mfcount++; break; default: break; } //str1 = "u.sa < " + modelocc.real_price + " and"; //if (modelfs.showday) //{ // str1 = "u.sa < " + Convert.ToInt32(modelfs.daynum) * modelocc.real_price + " and"; //} //else //{ // str1 = ""; //} //if (modelfs.showyue) //{ // str1 += " u.sa<" + modelfs.moneyNum + " and"; //} //dstable = brBll.GetProc(str1, Convert.ToInt32(dr["floor_id"]), a, DateTime.Now.ToString()); //dstable = brBll.GetListed("", "inner join( select * from occu_infor as oi inner join (select SUM(ga_price)-SUM(ga_sum_price) as sa,ga_occuid as t from goods_account where ga_isys=1 group by ga_occuid) as u on u.t =oi.order_id where " + str1 + " datediff(D,[depar_time],'" + DateTime.Now.ToString() + "')=0) as uio on uio.room_number=a.Rn_roomNum and Rn_floor=" + dr["floor_id"].ToString() + " and room_number='" + a + "'"); //if (dstable.Tables[0].Rows.Count > 0) //{ // if (modelfs.showyjb) // { // czico = "<img src='/admin/images/iconcuizhang.png'/>"; // } // czCount++; //} if (dicCz.ContainsKey(a.ToString())) { if (dicCz[a.ToString()].ToString() == "1") { if (modelfs.showyjb) { czico = "<img src='/admin/images/iconcuizhang.png'/>"; } czCount++; bs = true; } } date1 = Convert.ToDateTime(fmmx.GetModels(" where occ_with='否' and state_id=0 and real_mode_Id!=2 and real_mode_Id!=19 and room_number='" + a.ToString() + "'").depar_time.ToString()); date2 = System.DateTime.Now; cc = date1.Day - date2.Day; if (cc < 0) { cc = (Convert.ToDateTime(date1.ToString("yyyy-MM-dd")) - Convert.ToDateTime(date2.ToString("yyyy-MM-dd"))).Days; } if (modelfs.yuliDay) {//只是当日预离 if (cc == 0) { if (modelfs.showYuli) { //jzfimg = "<img src=\"/admin/images/iconjiangzou.png\">"; } jzhouf++; } } else if (modelfs.showDayTime) { //多少天内预离显示 if (Convert.ToInt32(cc) <= Convert.ToInt32(modelfs.dayNumYl)) { if (Convert.ToInt32(cc) == 0 || cc < 0) { numDay = "<span class=\"numday\"> </span>"; } else { numDay = "<span class=\"numday\">" + cc + "</span>"; } if (modelfs.showYuli) { //jzfimg = "<img src=\"/admin/images/iconjiangzou.png\">"; } jzhouf++; } } countxuzhu = fmmx.GetRecordCount(" where continuelive=" + modelocc.occ_id + ""); if (countxuzhu > 0) { xuzhu = "<img src=\"/admin/images/iconxz.png\">"; xuzhufang++; } countLF = fmmx.GetRecordCount(" where order_id='" + modelocc.order_id + "'"); if (listocc.Count > 1) { LFimg = dicstr[a.ToString()]; LFcount++; } //SQLlf = "select order_id from occu_infor where order_id in (select order_id from occu_infor group by order_id having count(order_id) > 1) group by order_id"; //DtLF = fmgood.GoodsQX(SQLlf); //LFcount = DtLF.Tables[0].Rows.Count; } catch { } } b = drs["Rn_roomNum"].ToString(); if (drs["Room_suod"].ToString().Trim() == "是")//是否为锁房间 { img = "<img src='/admin/images/iconsuofang.png' class=\"suofang\">"; sjsj = ""; suofang++; } else { img = ""; } yudao = string.Empty; string yustr = string.Empty; string yudaoDay = string.Empty; if (drs["Rn_Tobe"] != null)//是否为预定房间 { if (Convert.ToInt32(drs["Rn_Tobe"]) == 1) { yudao = GetYuDao(b); yustr = "yuding"; DateTime datestr = Convert.ToDateTime(yudao); DateTime dataend = Convert.ToDateTime(DateTime.Now); int days = datestr.Day - dataend.Day; if (days < 0) { TimeSpan tss = (Convert.ToDateTime(datestr.ToString("yyyy-MM-dd")) - Convert.ToDateTime(dataend.ToString("yyyy-MM-dd"))); days = tss.Days; } if (days <= 0) { yudaoDay = "<div class=\"yuding hrj\"> </div>"; yudao = Convert.ToDateTime(yudao).ToString("hh:mm"); } else { yudao = ""; yudaoDay = "<div class=\"yuding hrj\">" + days + "</div>"; } } } sbhtml.Append("<li class=\"hidli\" rooms=" + b + "><ul><li rooms=" + b + " id=" + Convert.ToInt32(drs["id"].ToString()) + " state=" + Convert.ToInt32(drs["Rn_state"]) + " " + sjsj + " class='" + yustr + " " + Style + "'><a href='#'><span class='span01'>" + b + "</span>" + numDay + "<span style='color:yellow'>" + ZC(drs["Rn_roomNum"].ToString()) + "</span><br /><span class=\"fxhrj\">" + fxdic[Convert.ToInt32(drs["Rn_room"])] + "</span> <p>" + img + "<span class=\"icospan\">" + price + "</span><span class=\"lfico\">" + LFimg + "</span><span class=\"qianfei\"></span> <span class=\"xuzhu\">" + xuzhu + "</span><span class=\"czimg\">" + czico + "</span><span class=\"jzfimg\">" + jzfimg + "</span><span class='totime'>" + totime + "</span></p><br /><span class='zuofu'>" + Names + "</span><span class='youfu'>" + Convert.ToDecimal(drs["Rn_price"].ToString()).ToString("0.##") + "</span><span class=\"yue1\"></span><span class=\"stime\"></span><span class=\"shengyu\"></span></a><span class=\"yudao\">" + yudao + "</span></span>" + yudaoDay + "</li></ul></li>"); czico = ""; bs = false; } sbhtml.Append("</ul>"); } } DivContent.InnerHtml = sbhtml.ToString(); }