コード例 #1
0
        /// <summary>
        /// 通过房型与和协议获得价格
        /// </summary>
        private void GetPrice()
        {
            int cpid   = Convert.ToInt32(context.Request.QueryString["cpid"]);
            int typeid = Convert.ToInt32(context.Request.QueryString["typeid"]);

            Model.cprotocol modelcp = bllcp.GetModel(cpid);
            if (!modelcp.Isdiscount)
            { //如果没有使用固定折扣值
                List <Model.cprotocolPrice> listap = bllcprice.GetModelList("cpID=" + cpid + " and RoomType=" + typeid);
                if (listap.Count > 0)
                {
                    string str = js1.Serialize(listap);
                    Common.AjaxMsgHelper.AjaxMsg1("ok", "", str, "");
                }
                else
                {
                    decimal dc  = Convert.ToDecimal(bllrt.GetModel(typeid).room_listedmoney);
                    decimal zkz = Convert.ToDecimal(modelcp.discount);
                    var     obj = new { Price = dc, protoPrice = (dc * zkz).ToString() };
                    string  str = js1.Serialize(obj);
                    Common.AjaxMsgHelper.AjaxMsg1("err", "", str, "");
                }
            }
            else   //如果使用固定折扣值
            {
                decimal dc  = Convert.ToDecimal(bllrt.GetModel(typeid).room_listedmoney);
                decimal zkz = Convert.ToDecimal(modelcp.discount);
                var     obj = new { Price = dc, protoPrice = (dc * zkz).ToString() };
                string  str = js1.Serialize(obj);
                Common.AjaxMsgHelper.AjaxMsg1("err", "", str, "");
            }
        }
コード例 #2
0
 private void BindInfo(int id)
 {
     Model.cprotocol modelcp = bllcp.GetModel(id);
     Ptheme.Value           = modelcp.Ptheme;
     pType.SelectedValue    = modelcp.pType.ToString();
     PNumber.Value          = modelcp.PNumber;
     term.Value             = modelcp.term.ToString();
     period.Value           = modelcp.period.ToString();
     breakfast.Value        = modelcp.breakfast.ToString();
     Commission.Value       = modelcp.Commission.ToString();
     signatory.Value        = modelcp.signatory;
     companysignatory.Value = modelcp.companysignatory;
     roomNumber.Value       = modelcp.roomNumber;
     discount.Value         = modelcp.discount.ToString();
     Remark.Value           = modelcp.Remark;
     ishire.Checked         = modelcp.ishire;
     Dayhire.Checked        = modelcp.Dayhire;
     prohire.Checked        = modelcp.prohire;
     Isdiscount.Checked     = modelcp.Isdiscount;
     Details.Value          = modelcp.Details;
 }
コード例 #3
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());
        }
コード例 #4
0
 /// <summary>
 /// 协议入住费用转
 /// </summary>
 private void XieYi()
 {
     if (accounts.Value != "")   //如果是协议单位入住,更新入住天数    并要把设置计算佣金
     {
         Model.occu_infor modelocc = fmOc.GetModel(ids);
         TimeSpan         ts       = Convert.ToDateTime(modelocc.depar_time) - Convert.ToDateTime(modelocc.occ_time);
         int mydays = ts.Days;
         if (mydays <= 0)
         {
             mydays = 1;
         }
         Model.customer modelcus = bllcus.GetAccounts(accounts.Value);
         modelcus.occNum += mydays;
         bllcus.Update(modelcus);
         /*计算佣金*/
         string accou = account.Value;
         if (modelocc.CpID != null)
         {
             Model.cprotocol modelcp = bllcp.GetModel(Convert.ToInt32(modelocc.CpID));
             if (modelcp != null)
             {
                 bool dayhire    = modelcp.Dayhire;                     //是否每日计佣
                 int  Commission = Convert.ToInt32(modelcp.Commission); //佣金
                 bool ishire     = modelcp.ishire;                      //是否按房类计佣
                 int  day        = ts.Days;
                 int  sum        = 0;                                   //总佣金
                 if (ishire)                                            //如果 是按房类记算佣金
                 {
                     BLL.cprotocolPrice          bllcpp  = new BLL.cprotocolPrice();
                     List <Model.cprotocolPrice> listcpp = bllcpp.GetModelList("cpID=" + modelcp.ID + " and RoomType=" + modelocc.real_type_id);
                     if (listcpp.Count > 0)
                     {
                         Commission = Convert.ToInt32(listcpp[0].commission);
                     }
                 }
                 if (dayhire)
                 {
                     sum = Commission * day;
                 }
                 else
                 {
                     sum = Commission;
                 }
                 BLL.Commission   bllcomm   = new BLL.Commission();
                 Model.Commission modelcomm = new Model.Commission();
                 modelcomm.Accounts   = accounts.Value;
                 modelcomm.CommDesp   = "";
                 modelcomm.CommDate   = DateTime.Now;
                 modelcomm.CommSum    = sum;
                 modelcomm.IsBack     = false;
                 modelcomm.GoodNumber = modelocc.occ_no;
                 modelcomm.IsEveryDay = modelcp.Dayhire;
                 modelcomm.DayComm    = modelcp.Commission;
                 modelcomm.CommRemark = "";
                 bllcomm.Add(modelcomm);
             }
         }
     }
     if (idids.Value != "")   //如果是协议单位
     {
         List <Model.goods_account> listga = bllga.GetModelList1("ID in (" + idids.Value + ")");
         if (listga.Count > 0)
         {
             foreach (Model.goods_account item in listga)
             {
                 item.Ga_Account = account.Value;
                 item.ga_Type    = 204;
                 bllga.Update(item);
             }
         }
     }
 }