protected void btnAdd_Click(object sender, EventArgs e) { string id = Request.QueryString["id"].ToString(); string a = this.txt_Flooer.Value; Model.floor_manage fm = new Model.floor_manage(); fm.floor_name = a; if (id == "") { int b = fmBll.Add(fm); if (b > 0) { Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", ""); } } else { fm.floor_id = Convert.ToInt32(id); if (fmBll.Update(fm)) { Maticsoft.Common.MessageBox.ShowAndRedirect(this, "更新成功!", ""); } } }
protected void btnAdd_Click(object sender, EventArgs e) { string id = Request.QueryString["id"].ToString(); string a = this.txt_Flooer.Value; Model.floor_manage fm = new Model.floor_manage(); fm.floor_name = a; fm.floor_sorting = DDlLD.SelectedValue; if (id == "") { int b = fmBll.Add(fm); if (b > 0) { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('保存成功');parent.Window_Close();</script>"); } } else { fm.floor_id = Convert.ToInt32(id); if (fmBll.Update(fm)) { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('更新成功');parent.Window_Close();</script>"); } } }
//获得楼层 public string GetRealTypelcmname(int id) { BLL.floor_manage rtbll = new BLL.floor_manage(); Model.floor_manage model = rtbll.GetModel(Convert.ToInt32(id.ToString())); string a = rtbll.GetModel(Convert.ToInt32(id.ToString())).floor_name; return(model.floor_name); }
/// <summary> /// 删除语句 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btndelete_Click(object sender, EventArgs e) { Model.floor_manage fm = new Model.floor_manage(); int id = Convert.ToInt32(txt_id.Value); if (fmBll.Delete(id)) { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('删除成功');</script>"); BindLC(); } }
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(); }