Example #1
0
        //获得房型名称
        public string GetRealTypeName(int id)
        {
            BLL.room_type   rtbll = new BLL.room_type();
            Model.room_type model = rtbll.GetModel(Convert.ToInt32(id.ToString()));
            string          a     = rtbll.GetModel(Convert.ToInt32(id.ToString())).room_name;

            return(model.room_name);
        }
Example #2
0
 protected string GetFxName(string fxid)
 {
     BLL.room_type   bllrt   = new BLL.room_type();
     Model.room_type modelrt = bllrt.GetModel(Convert.ToInt32(fxid));
     if (modelrt != null)
     {
         return(modelrt.room_name.ToString());
     }
     return("");
 }
Example #3
0
 protected string GetFxPrice(string fxid)
 {
     BLL.room_type   bllrt   = new BLL.room_type();
     Model.room_type modelrt = bllrt.GetModel(Convert.ToInt32(fxid));
     if (modelrt != null)
     {
         return(Convert.ToDecimal(modelrt.room_listedmoney).ToString("0.##"));
     }
     return("");
 }
Example #4
0
        public override void SonLoad()
        {
            if (!IsPostBack)
            {
                string accounts = Request.QueryString["accounts"];
                term.Value      = DateTime.Now.ToString();
                accountst.Value = accounts;
                Bind(accounts);
                BindPtype();
                BLL.room_type bllrt = new BLL.room_type();
                if (Request.QueryString["type"] == "edit")//编辑
                {
                    int id = Convert.ToInt32(Request.QueryString["id"]);
                    BindInfo(id);
                    BLL.cprotocolPrice bllcprice = new BLL.cprotocolPrice();
                    rep1.DataSource = bllcprice.GetModelList("Accounts='" + accounts + "' and cpID=" + id);
                    rep1.DataBind();
                }
                else   //添加
                {
                    List <Model.room_type> listrt1 = bllrt.GetModelList("");
                    foreach (Model.room_type item in listrt1)
                    {
                        sbPrice.Append("<tr>");
                        sbPrice.Append("<td width=\"15%\" typeid='" + item.id + "' class=\"roomType\">" + item.room_name + "</td>");
                        sbPrice.Append("<td width=\"15%\" class=\"Price\">" + Convert.ToDecimal(item.room_listedmoney).ToString("0.##") + "</td>");
                        sbPrice.Append("<td width=\"15%\" class=\"zdPrice\">1</td>");
                        sbPrice.Append("<td width=\"15%\" class=\"protoPrice\">" + Convert.ToDecimal(item.room_listedmoney).ToString("0.##") + "</td>");
                        sbPrice.Append("<td width=\"15%\" class=\"mothPrice\">" + Convert.ToDecimal(item.Room_Moth_price).ToString("0.##") + "</td>");
                        sbPrice.Append("<td width=\"15%\" class=\"commission\">0</td>");
                        sbPrice.Append("<td width=\"16%\" ><a href=\"#\" onclick=\"RowEdit(this)\"><img src=\"../images/037.gif\" width=\"10\" height=\"10\" ></a><a href=\"#\"onclick=\"RowDelete(this)\"><img src=\"../images/010.gif\" width=\"10\" height=\"10\" ></a></td>");
                        sbPrice.Append("</tr>");
                    }
                }


                List <Model.room_type> listrt = bllrt.GetModelList("");
                foreach (Model.room_type item in listrt)
                {
                    sbtext.Append("<option value='" + item.id + "'>" + item.room_name + "</option>");


                    //Model.mtPrice modelmt = new Model.mtPrice();
                    //modelmt.RoomType = item.id;
                    //modelmt.zdPrice = 1;
                    //modelmt.Price = Convert.ToInt32(item.room_listedmoney);
                    //modelmt.Dayprice = Convert.ToInt32(item.room_listedmoney);
                    //modelmt.lcPrice = Convert.ToInt32(item.room_listedmoney);
                    //BLL.mtPrice bllm = new BLL.mtPrice();
                    //bllm.Add(modelmt);
                }
            }
        }
Example #5
0
        private void Bind()
        {
            BLL.room_type          bllrt  = new BLL.room_type();
            List <Model.room_type> listrt = bllrt.GetModelList("");

            foreach (Model.room_type item in listrt)
            {
                sbtext.Append("<option value='" + item.id + "'>" + item.room_name + "</option>");
            }

            if (Request.QueryString["mtid"] != null)
            {
                int mtid = Convert.ToInt32(Request.QueryString["mtid"]);
                memtypeid.Value = mtid.ToString();
                List <Model.mtPrice> listmt = bllmt.GetModelList("MTID=" + mtid);
                rep1.DataSource = listmt;
                rep1.DataBind();
            }
        }
Example #6
0
        /// <summary>
        /// 所有价格列表
        /// </summary>
        private void Getpice()
        {
            System.Text.StringBuilder sbtext = new System.Text.StringBuilder();
            int id = Convert.ToInt32(context.Request.QueryString["id"]);

            //判断是不是使用固定折扣值
            BLL.cprotocol   bllcp   = new BLL.cprotocol();
            Model.cprotocol modelcp = bllcp.GetModel(id);
            if (!modelcp.Isdiscount)
            { //如果使用自定义折扣
                BLL.cprotocolPrice          bllcpp  = new BLL.cprotocolPrice();
                List <Model.cprotocolPrice> listcpp = bllcpp.GetModelList("cpID=" + id);
                BLL.room_type          bllty        = new BLL.room_type();
                List <Model.room_type> listrt       = bllty.GetModelList("");
                foreach (Model.room_type item in listrt)
                {
                    List <Model.cprotocolPrice> newcpp = listcpp.Where(d => d.RoomType == item.id).ToList();
                    if (newcpp.Count > 0)
                    {
                        sbtext.Append("<tr><td>" + GetFxName(Convert.ToInt32(newcpp[0].RoomType)) + "</td><td>" + Convert.ToDecimal(newcpp[0].Price).ToString("0.##") + "</td><td>" + Convert.ToDecimal(newcpp[0].protoPrice).ToString("0.##") + "</td><td>" + Convert.ToDecimal(newcpp[0].mothPrice).ToString("0.##") + "</td></tr>");
                    }
                    else
                    {
                        sbtext.Append("<tr><td>" + GetFxName(item.id) + "</td><td>" + Convert.ToDecimal(item.room_listedmoney).ToString("0.##") + "</td><td>" + Convert.ToDecimal(item.room_listedmoney).ToString("0.##") + "</td><td>" + Convert.ToDecimal(item.Room_Moth_price).ToString("0.##") + "</td></tr>");
                    }
                }
            }
            else
            {
                decimal                duding = Convert.ToDecimal(modelcp.discount);
                BLL.room_type          bllty  = new BLL.room_type();
                List <Model.room_type> listrt = bllty.GetModelList("");
                foreach (Model.room_type item in listrt)
                {
                    sbtext.Append("<tr><td>" + GetFxName(item.id) + "</td><td>" + Convert.ToDecimal(item.room_listedmoney).ToString("0.##") + "</td><td>" + Convert.ToDecimal(item.room_listedmoney * duding).ToString("0.##") + "</td><td>" + Convert.ToDecimal(item.Room_Moth_price * duding).ToString("0.##") + "</td></tr>");
                }
            }

            context.Response.Write(sbtext.ToString());
        }
        //获得房型名称
        public string GetRealTypeName(object id)
        {
            if (id.ToString() == "")
            {
                return("");
            }
            BLL.room_type rtbll = new BLL.room_type();

            Model.room_type model = rtbll.GetModel(Convert.ToInt32(id.ToString()));

            if (model != null)
            {
                if (model.room_name != null)
                {
                    if (model.room_name == "")
                    {
                        return("");
                    }
                }

                return(model.room_name);
            }
            return("");
        }
 //获得房型名称
 public string GetRealTypeNamePrice(int id)
 {
     BLL.room_type   rtbll = new BLL.room_type();
     Model.room_type model = rtbll.GetModel(Convert.ToInt32(id.ToString()));
     return(Convert.ToDecimal(model.room_listedmoney).ToString("0.##"));
 }
Example #9
0
 protected string Getyuan(int id)
 {
     BLL.room_type bllrt = new BLL.room_type();
     return(bllrt.GetModel(id).room_name);
 }
Example #10
0
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            Model.memberType modelty = new Model.memberType();
            modelty.TypeName  = Name.Value;
            modelty.typePrice = Convert.ToInt32(CardFee.Value);
            modelty.Limit     = Limitcke.Checked;
            if (Expire.Value == "")
            {
                modelty.LimitValue = null;
            }
            else
            {
                modelty.LimitValue = Convert.ToInt32(Expire.Value);
            }
            modelty.IntegraIs = ScoreChk.Checked;
            modelty.IsConsump = SEnable2.Checked;
            modelty.IsFz      = Score_1.Checked;
            modelty.IsXf      = Score_2.Checked;
            if (Rule_x.Value == "")
            {
                modelty.XfPrice = null;
            }
            else
            {
                modelty.XfPrice = Convert.ToInt32(Rule_x.Value);
            }
            if (Rule_y.Value == "")
            {
                modelty.XfConsump = null;
            }
            else
            {
                modelty.XfConsump = Convert.ToInt32(Rule_y.Value);
            }
            modelty.IsLive = SEnable1.Checked;
            if (ScoreType_x.Value == "")
            {
                modelty.LiveNum = null;
            }
            else
            {
                modelty.LiveNum = Convert.ToInt32(ScoreType_x.Value);
            }
            if (ScoreType_y.Value == "")
            {
                modelty.LiveConsump = null;
            }
            else
            {
                modelty.LiveConsump = Convert.ToInt32(ScoreType_y.Value);
            }

            if (machJf.Value == "")
            {
                modelty.MachJf = null;
            }
            else
            {
                modelty.MachJf = Convert.ToInt32(machJf.Value);
            }

            modelty.UpLive    = Convert.ToInt32(MCategory.SelectedValue);
            modelty.IsTx      = IsAddScore.Checked;
            modelty.IsDeaflut = defaultPrice.Checked;
            //差一个金额
            modelty.IsUpgrade = UpEnable.Checked;
            if (UpScore.Value == "")
            {
                modelty.ConsumpSum = null;
            }
            else
            {
                modelty.ConsumpSum = Convert.ToInt32(UpScore.Value);
            }
            if (ThePrice.Value == "")
            {
                modelty.StaPrice = null;
            }
            else
            {
                modelty.StaPrice = Convert.ToInt32(ThePrice.Value);
            }
            modelty.IsDeduction = IsReduceScore.Checked;
            modelty.Isout       = RoomMin.Checked;
            if (DayRoomHour.Value == "")
            {
                modelty.OutHour = null;
            }
            else
            {
                modelty.OutHour = Convert.ToInt32(DayRoomHour.Value);
            }
            if (HourRoomMin.Value == "")
            {
                modelty.OutZD = null;
            }
            else
            {
                modelty.OutZD = Convert.ToInt32(HourRoomMin.Value);
            }
            if (FirstPrice.Value == "")
            {
                modelty.FirstPrice = null;
            }
            else
            {
                modelty.FirstPrice = Convert.ToInt32(FirstPrice.Value);
            }
            modelty.XqTime = Convert.ToDateTime(XqTime.Value);
            if (Request.QueryString["type"] == "add")
            {
                int res = bllmt.Add(modelty);
                if (res > 0)
                {
                    BLL.room_type          bllrt  = new BLL.room_type();
                    List <Model.room_type> listrt = bllrt.GetModelList("");
                    if (listrt.Count > 0)
                    {
                        foreach (Model.room_type item in listrt)
                        {
                            Model.mtPrice modelmt = new Model.mtPrice();
                            modelmt.RoomType = item.id;
                            modelmt.zdPrice  = 1;
                            modelmt.Price    = Convert.ToInt32(item.room_listedmoney);
                            modelmt.Dayprice = Convert.ToInt32(item.room_listedmoney);
                            modelmt.lcPrice  = Convert.ToInt32(item.room_listedmoney);
                            modelmt.MTID     = res;
                            BLL.mtPrice bllm = new BLL.mtPrice();
                            bllm.Add(modelmt);
                        }
                    }

                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('保存成功');parent.window.location.reload();</script>");
                }
            }
            else
            {
                modelty.MtID = Convert.ToInt32(Request.QueryString["id"]);
                if (bllmt.Update(modelty))
                {
                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('修改成功');parent.window.location.reload();</script>");
                }
            }
        }
Example #11
0
 private string GetFxName(int id)
 {
     BLL.room_type bllrt = new BLL.room_type();
     return(bllrt.GetModel(id).room_name);
 }