/*统计NOshow*/
        void NOshow()
        {
            BLL.book_room          bllbr    = new BLL.book_room();
            Model.SysParamter      modelsys = bllsys.GetModel(1);
            DateTime               dtnow    = DateTime.Now;
            DateTime               dtstart  = Convert.ToDateTime(dtnow.ToString("yyyy-MM-dd")).AddHours(modelsys.YsTime.Hours).AddMinutes(modelsys.YsTime.Minutes).AddSeconds(modelsys.YsTime.Seconds);
            List <Model.book_room> listbr   = bllbr.GetModelList("Accounts!='' and state_id=1");

            if (listbr.Count > 0)
            {
                foreach (Model.book_room item in listbr)
                {
                    TimeSpan tso = Convert.ToDateTime(item.time_to) - Convert.ToDateTime(dtstart);
                    if (tso.TotalSeconds < 0)
                    {
                        Model.customer modelcus = bllcuns.GetAccounts(item.Accounts);
                        if (modelcus != null)
                        {
                            modelcus.NoShow += 1;
                            bllcuns.Update(modelcus);
                        }
                    }
                    item.state_id = 4;
                    bllbr.Update(item);
                }
            }
        }
Exemple #2
0
        //取消按钮不做物理删除,改变状态
        protected void Button1_Click(object sender, EventArgs e)
        {
            //改变状态,先写死,到时候再具体看。

            brModel              = brBll.GetModel(Convert.ToInt32(id));
            brModel.state_id     = 5;
            brModel.back_deposit = Convert.ToDecimal(this.txtdeposit.Value);
            //判断退订金不能大于可退订金
            if (Convert.ToDecimal(txtdeposit.Value) > brModel.deposit)
            {
                MessageBox.Show(this, "退订金" + txtdeposit.Value + "不能大于" + brModel.deposit + "可退订金");
                return;
            }
            brModel.meth_pay_id = Convert.ToInt16(meth_payDdl.SelectedValue);
            brModel.remark      = this.txtremark.Value;
            if (brModel.Accounts != "")//如果是单位被取消  增加取消次数
            {
                BLL.customer   bllcuns  = new BLL.customer();
                Model.customer modelcus = bllcuns.GetAccounts(brModel.Accounts);
                if (modelcus != null)
                {
                    modelcus.xqBook += 1;
                    bllcuns.Update(modelcus);
                }
            }
            else
            {
            }
            //写入入账表
            Model.goods_account gaModel = new Model.goods_account();
            gaModel.ga_name = "退订金";
            //gaModel.ga_roomNumber = Convert.ToInt32(brModel.room_number);
            gaModel.ga_zffs_id = Convert.ToInt16(meth_payDdl.SelectedValue);
            gaModel.ga_number  = brModel.book_no;
            gaModel.ga_date    = System.DateTime.Now;
            gaModel.ga_price   = Convert.ToDecimal(txtdeposit.Value) * -1;
            gaModel.ga_people  = UserNow.UserID;
            //gaModel.ga_people = Session["UserId"].ToString();
            gabll.Add(gaModel);

            bool Result = brBll.Update(brModel);
            List <Model.Book_Rdetail> listbr = bllbr.GetListModel("book_no='" + brModel.book_no + "'");

            foreach (Model.Book_Rdetail item in listbr)
            {
                item.RoomTypeID = 5;
                bllbr.Update(item);
            }
            if (Result == true)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "info", "<script language=\"javascript\">if(confirm('取消预定成功!是否打印退款单?')){ ShowDivs(this,'" + brModel.book_no + "') }else{ ShowTabs('预定管理');}</script>");
                //Response.Redirect("BookList.aspx");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "info", "<script>alert('取消失败!');parent.Window_Close();</script>");
                //Response.Redirect("BookList.aspx");
            }
        }
Exemple #3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            brModel = brBll.GetModel(Convert.ToInt32(id));
            //判断退订金不能大于可退订金
            if (Convert.ToDecimal(adddeposit.Value) < 0)
            {
                MessageBox.Show(this, "补交订金请输入大于0的数字");
                return;
            }
            brModel.meth_pay_id = Convert.ToInt16(meth_payDdl.SelectedValue);
            brModel.remark      = this.txtremark.Value;
            brModel.deposit     = brModel.deposit + Convert.ToDecimal(this.adddeposit.Value);


            //写入入账表
            Model.goods_account gaModel = new Model.goods_account();
            gaModel.ga_name = "补交订金";
            //gaModel.ga_roomNumber = Convert.ToInt32(brModel.room_number);
            gaModel.ga_zffs_id   = Convert.ToInt16(meth_payDdl.SelectedValue);
            gaModel.ga_date      = System.DateTime.Now;
            gaModel.ga_sum_price = brModel.deposit;
            //gaModel.ga_people = Session["UserId"].ToString();
            gabll.Add(gaModel);

            bool Result = brBll.Update(brModel);

            if (Result == true)
            {
                //Page.ClientScript.RegisterStartupScript(GetType(), "info", "<script>(\"补订金成功\", \"info\",'../','');</script>");
                // Response.Redirect("BookList.aspx");
                //待修改
                ClientScript.RegisterStartupScript(GetType(), "message", "<script language=\"javascript\">if(confirm('补交定金成功!是否打印收款单?')){ ShowDivs('" + brModel.book_no + "') }else{ ShowTabs('预定管理');}</script>");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "info", "<script>(\"系统繁忙,请稍后再试!\", \"info\",'../','');</script>");
                Response.Redirect("BookList.aspx");
            }
        }