コード例 #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string  account = Request.QueryString["accounts"];
            decimal pri     = Convert.ToDecimal(price.Value);

            Model.goods_account modelag = new Model.goods_account();
            modelag.ga_name    = "预收款";
            modelag.Ga_Account = account;
            modelag.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue);
            modelag.ga_date    = DateTime.Now;
            modelag.ga_people  = UserNow.UserID;
            modelag.ga_remker  = "预收款";
            modelag.ga_Type    = 201;
            if (tvalue.Value == "0")
            {
                modelag.ga_price = pri;
            }
            else
            {
                modelag.ga_price = pri * -1;
            }
            if (bllga.Add(modelag) > 0)
            {
                ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('入帐成功');parent.window.location.href='account_goods.aspx?readValue=201&accounts=" + account + "';</script>");
            }
        }
コード例 #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Model.goods_account modelgs = new Model.goods_account();
            modelgs.Ga_Account = CardNo.Value;
            modelgs.ga_date    = DateTime.Now;
            modelgs.ga_isjz    = 0;
            modelgs.ga_isys    = 0;
            modelgs.ga_name    = "佣金结账";
            modelgs.ga_Type    = 205;
            modelgs.ga_people  = UserNow.UserID;
            modelgs.ga_price   = Convert.ToDecimal(Amount.Value);
            modelgs.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue);
            bllga.Add(modelgs);

            List <Model.Commission> listcomm = bllcomm.GetModelList("ID  in(" + idshid.Value + ")");

            if (listcomm.Count > 0)
            {
                foreach (Model.Commission item in listcomm)
                {
                    item.IsBack = true;
                    bllcomm.Update(item);
                }
            }
            ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('结算成功');parent.window.location.reload();</script>");
        }
コード例 #3
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");
            }
        }
コード例 #4
0
 private void BC(decimal dce, string str, string paymath, int type)
 {
     Model.goods_account modelga = new Model.goods_account();
     modelga.ga_name    = str;
     modelga.ga_price   = dce;
     modelga.ga_zffs_id = Convert.ToInt32(paymath);
     modelga.ga_date    = DateTime.Now;
     modelga.ga_people  = UserNow.UserID;
     modelga.ga_Type    = type;
     modelga.ga_isjz    = 0;
     modelga.ga_isys    = 0;
     bllga.Add(modelga);
 }
コード例 #5
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Model.goods_account modelga = new Model.goods_account();
     modelga.ga_name    = "退订金";
     modelga.ga_number  = lbbookno.Text;
     modelga.ga_price   = Convert.ToDecimal(tdeposit.Value) * -1;
     modelga.ga_zffs_id = Convert.ToInt32(meth_payDdl.SelectedValue);
     modelga.ga_date    = DateTime.Now;
     modelga.ga_people  = UserNow.UserID;
     modelga.ga_remker  = txtremark.Value;
     modelga.ga_isjz    = 0;
     if (bllga.Add(modelga) > 0)
     {
         ClientScript.RegisterStartupScript(GetType(), "message", "<script language=\"javascript\">if(confirm('取消预定成功!是否打印退款单?')){ ShowDivs(this,'" + modelga.ga_number + "') }else{ ShowTabs('预定管理');}</script>");
     }
 }
コード例 #6
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     Model.goods_account modelag = new Model.goods_account();
     modelag.ga_name    = "冲帐";
     modelag.Ga_Account = hidaccount.Value;
     //modelag.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue);
     modelag.ga_date      = DateTime.Now;
     modelag.ga_people    = UserNow.UserID;
     modelag.ga_remker    = "冲帐";
     modelag.ga_Type      = 204;
     modelag.Ga_goodNo    = "CZ" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("-", "").Replace(":", "").Replace(" ", "").Replace("/", "");
     modelag.ga_sum_price = Convert.ToDecimal(price.Value) * -1;
     modelag.ga_occuid    = orderid.Value;
     if (bllga.Add(modelag) > 0)
     {
         ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('冲帐成功');parent.window.location.reload();</script>");
     }
 }
コード例 #7
0
 /// <summary>
 /// 确定
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnAdds_Click(object sender, EventArgs e)
 {
     Model.goods_account model = new Model.goods_account();
     model.ga_people   = UserNow.UserID;
     model.ga_zffs_id  = Convert.ToInt32(DDlZffs.SelectedValue);
     model.ga_price    = 0;
     model.ga_sfacount = "是";
     model.ga_name     = "退款";
     model.ga_occuid   = fmrzo.GetModel(ids).order_id;
     model.Ga_goodNo   = fmrzo.GetModel(ids).occ_no;
     model.ga_price    = Convert.ToDecimal(txt_tkMoney.Value) * -1;
     model.ga_Type     = 5;
     //fmrz.GetMaxId();
     model.ga_number     = "TK" + System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "");
     model.ga_date       = System.DateTime.Now;
     model.ga_roomNumber = txt_fh.Value.ToString();
     if (fmrz.Add(model) > 0)
     {
         ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>if(confirm('退款成功,是否打印退款单?')){XZintRZ(this,'" + model.ga_occuid + "')} else{ }</script>");
     }
 }
コード例 #8
0
        protected void btnOk_Click(object sender, EventArgs e)
        {
            if (btnok.Text == "确定")
            {
                Model.goods_account gamodel = new Model.goods_account();
                gamodel           = bllga.GetModels1(Convert.ToInt32(txtid.Value));
                gamodel.ga_remker = yying.Value;
                bllga.Update(gamodel);
                Response.Write("<script>parent.Window_Close();</script>");
            }
            else
            {
                Model.goods_account gamodel = new Model.goods_account();
                gamodel = bllga.GetModels1(Convert.ToInt32(txtid.Value));
                if (gamodel.ga_price != 0)
                {
                    gamodel.ga_price     = Convert.ToDecimal(czprice.Value) * -1;
                    gamodel.ga_sum_price = 0;
                    gamodel.ga_Type      = 12;
                    gamodel.ga_remker    = "冲减入帐日期为" + gamodel.ga_date + "的" + gamodel.ga_name + "" + gamodel.ga_price + "元!/n原因为:" + yying.Value;
                }
                if (gamodel.ga_sum_price != 0)
                {
                    gamodel.ga_price     = Convert.ToDecimal(czprice.Value) * -1;
                    gamodel.ga_sum_price = 0;
                    gamodel.ga_Type      = 12;
                    gamodel.ga_remker    = "冲减入帐日期为" + gamodel.ga_date + "的" + gamodel.ga_name + "" + gamodel.ga_sum_price + "元!/n原因为:" + yying.Value;
                }
                gamodel.ga_name = "冲减";
                gamodel.ga_isys = 0;

                gamodel.ga_date = DateTime.Now;

                if (bllga.Add(gamodel) > 0)
                {
                    Response.Write("<script>alert('冲减成功');parent.Window_Close();</script>");
                }
                Helper.AddRoom(gamodel.ga_roomNumber);
            }
        }
コード例 #9
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");
            }
        }
コード例 #10
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string  account = Request.QueryString["accounts"];
            decimal pri     = Convert.ToDecimal(price.Value);

            Model.goods_account modelag = new Model.goods_account();
            modelag.ga_name    = "结账收款";
            modelag.Ga_Account = account;
            modelag.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue);
            modelag.ga_date    = DateTime.Now;
            modelag.ga_people  = UserNow.UserID;
            modelag.ga_remker  = "收款结算";
            modelag.ga_Type    = 202;
            modelag.ga_price   = pri;
            if (rad1.Checked)
            {
                modelag.ga_jsfs = 0;
            }
            else
            {
                modelag.ga_jsfs = 1;
                bllga.Add(modelag);
            }



            List <Model.goods_account> listag = bllga.GetModelList1("ga_goodNo in (" + idss.Value + ")");

            if (listag.Count > 0)
            {
                foreach (Model.goods_account item in listag)
                {
                    item.ga_Type = 203;
                    bllga.Update(item);
                }
            }
            ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('结帐成功');parent.window.location.reload();</script>");
        }
コード例 #11
0
        /// <summary>
        /// 确认
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdds_Click(object sender, EventArgs e)
        {
            string strSQL = "";
            string sql    = "";
            string Strsql = "";
            int    count  = 0;

            for (int i = 0; i < GrdCostRoom.Rows.Count; i++)
            {
                CheckBox cbxCheck = GrdCostRoom.Rows[i].FindControl("cbxCheck") as CheckBox;
                if (cbxCheck.Checked)
                {
                    if (cbxCheck.Enabled == true)
                    {
                        HiddenField hidNewsId = GrdCostRoom.Rows[i].FindControl("hidId") as HiddenField;
                        if (occid == "")
                        {
                            occid = hidNewsId.Value;
                        }
                        else
                        {
                            occid += "," + hidNewsId.Value;
                        }

                        sql = " update room_number set Rn_state=4 where Rn_roomNum='" + fmOc.GetModel(Convert.ToInt32(hidNewsId.Value)).room_number + "' ";
                        Helper.AddRoom(fmOc.GetModel(Convert.ToInt32(hidNewsId.Value)).room_number);
                        fmroom.Updates(sql);
                    }
                    count++;
                }
            }

            strSQL = "update occu_infor set state_id=3 where occ_id in (" + occid + ")";
            fmOc.Updates(strSQL);

            if (GrdCostRoom.Rows.Count == count)
            {
                Strsql = "update goods_account set ga_sfacount='是' where ga_occuid ='" + fmOc.GetModel(ids).order_id + "' ";
                if (!Helper.IsJz(fmOc.GetModel(ids).order_id))
                {
                    string[] txtzffs = txt_zhfsMoney.Value.Split('|');
                    if (hidcs.Value == "0")
                    {
                        Model.goods_account model = new Model.goods_account();
                        model.ga_people = UserNow.UserID;
                        // model.ga_zffs_id = 1;
                        // model.ga_price = Convert.ToInt32( txt_bcysMoneys.Value);
                        model.ga_price     = Convert.ToDecimal("-" + txt_bcysMoneys.Value);
                        model.ga_sfacount  = "是";
                        model.ga_name      = "结账退款";
                        model.ga_occuid    = fmOc.GetModel(ids).order_id;
                        model.ga_sum_price = 0;
                        model.ga_Type      = 6;
                        //fmrz.GetMaxId();
                        model.ga_number     = System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "");
                        model.ga_date       = System.DateTime.Now;
                        model.ga_roomNumber = fmOc.GetModel(ids).room_number.ToString();
                        fmrz.Add(model);
                    }
                    else if (hidcs.Value == "1")

                    {
                        for (int j = 0; j < txtzffs.Length - 1; j++)
                        {
                            Model.goods_account model = new Model.goods_account();
                            model.ga_people    = UserNow.UserID;
                            model.ga_zffs_id   = Convert.ToInt32(txtzffs[j].Split('#')[0]);
                            model.ga_price     = Convert.ToDecimal(txtzffs[j].Split('#')[1]);
                            model.ga_sfacount  = "是";
                            model.ga_name      = "结账收款";
                            model.ga_occuid    = fmOc.GetModel(ids).order_id;
                            model.ga_sum_price = 0;
                            model.ga_Type      = 4;

                            //fmrz.GetMaxId();
                            model.ga_number     = System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "");
                            model.ga_date       = System.DateTime.Now;
                            model.ga_roomNumber = fmOc.GetModel(ids).room_number.ToString();
                            fmrz.Add(model);
                        }
                    }

                    if (fmrz.Updates(Strsql))
                    {
                        // Maticsoft.Common.MessageBox.ShowAndRedirect(this, "!", "");
                        string strqwl = "update occu_infor set tuifaId=2 where occ_id in (" + occid + ")";
                        fmOc.Updates(strqwl);
                        Helper.AddRoom(fmOc.GetModel(ids).room_number);
                        ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>if(confirm('结账成功,是否打结账单')){ PrintJz(this," + orderid + ");}else{ShowTabs('房态图');}</script>");
                    }
                }
                else
                {
                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>Erroc();</script>");
                }
            }
            else
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "退房成功!", "");
                string strqwl = "update occu_infor set tuifaId=1,continuelive=1 where occ_id in (" + ids + ")";
                fmOc.Updates(strqwl);
                //ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('退房成功');parent.Window_Close();</script>");
            }
        }
コード例 #12
0
        /// <summary>
        /// 确认
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdds_Click(object sender, EventArgs e)
        {
            string strSQL = "";
            string sql    = "";
            string Strsql = "";
            int    count  = 0;

            for (int i = 0; i < GrdCostRoom.Rows.Count; i++)
            {
                CheckBox cbxCheck = GrdCostRoom.Rows[i].FindControl("cbxCheck") as CheckBox;
                if (cbxCheck.Checked)
                {
                    if (cbxCheck.Enabled == true)
                    {
                        HiddenField hidNewsId = GrdCostRoom.Rows[i].FindControl("hidId") as HiddenField;
                        if (occid == "")
                        {
                            occid = hidNewsId.Value;
                        }
                        else
                        {
                            occid += "," + hidNewsId.Value;
                        }

                        sql = " update room_number set Rn_state=4 where Rn_roomNum='" + fmOc.GetModel(Convert.ToInt32(hidNewsId.Value)).room_number + "' ";
                        Helper.AddRoom(fmOc.GetModel(Convert.ToInt32(hidNewsId.Value)).room_number);
                        fmroom.Updates(sql);
                    }
                    count++;
                }
            }

            strSQL = "update occu_infor set state_id=3,occ_TfTime='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' where occ_id in (" + occid + ")";
            fmOc.Updates(strSQL);

            if (GrdCostRoom.Rows.Count == count)
            {
                Strsql = "update goods_account set ga_sfacount='是' where ga_occuid ='" + fmOc.GetModel(ids).order_id + "' ";
                if (!Helper.IsJz(fmOc.GetModel(ids).order_id))
                {
                    string[] txtzffs  = txt_zhfsMoney.Value.Split('|');
                    decimal  sumprice = 0;
                    for (int j = 0; j < txtzffs.Length - 1; j++)
                    {
                        Model.goods_account model = new Model.goods_account();
                        model.ga_people = UserNow.UserID;
                        if (txtzffs[j].Split('#')[0] == "10")
                        {
                            MemberAddPrice(Convert.ToInt32(txtzffs[j].Split('#')[1]));
                        }
                        model.ga_zffs_id    = Convert.ToInt32(txtzffs[j].Split('#')[0]);
                        model.ga_price      = Convert.ToDecimal(txtzffs[j].Split('#')[1]);
                        sumprice           += Convert.ToDecimal(model.ga_price);
                        model.ga_sfacount   = "是";
                        model.ga_name       = "结账收款";
                        model.ga_occuid     = fmOc.GetModel(ids).order_id;
                        model.ga_sum_price  = 0;
                        model.ga_Type       = 4;
                        model.ga_number     = System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "");
                        model.ga_date       = System.DateTime.Now;
                        model.ga_roomNumber = fmOc.GetModel(ids).room_number.ToString();
                        fmrz.Add(model);
                    }
                    if (Convert.ToDecimal(xfprice.Value) < sumprice + Convert.ToDecimal(skPrice.Value))
                    {
                        Model.goods_account model = new Model.goods_account();
                        model.ga_people     = UserNow.UserID;
                        model.ga_price      = (sumprice + Convert.ToDecimal(skPrice.Value) - Convert.ToDecimal(xfprice.Value)) * -1;
                        model.ga_sfacount   = "是";
                        model.ga_name       = "结账退款";
                        model.ga_occuid     = fmOc.GetModel(ids).order_id;
                        model.ga_sum_price  = 0;
                        model.ga_Type       = 6;
                        model.ga_zffs_id    = 2;
                        model.ga_number     = System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "");
                        model.ga_date       = System.DateTime.Now;
                        model.ga_roomNumber = fmOc.GetModel(ids).room_number.ToString();
                        if (fmrz.Add(model) > 0)
                        {
                            Model.mRecords modelmr = new Model.mRecords();
                            modelmr.mmid   = fmOc.GetModel(ids).mem_cardno;
                            modelmr.Price  = Convert.ToInt32(model.ga_price);
                            modelmr.Type   = 1;
                            modelmr.Remark = "";
                            bllmr.Add(modelmr);
                        }
                    }
                    if (fmrz.Updates(Strsql))
                    {
                        XieYi();
                        // Maticsoft.Common.MessageBox.ShowAndRedirect(this, "!", "");
                        string strqwl = "update occu_infor set tuifaId=2 where occ_id in (" + occid + ")";
                        fmOc.Updates(strqwl);
                        Helper.AddRoom(fmOc.GetModel(ids).room_number);
                        AddJf();
                        ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'> MarkCard(" + orderid + ");</script>");
                    }
                }
                else
                {
                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>Erroc();</script>");
                }
            }
            else
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "退房成功!", "");
                string strqwl = "update occu_infor set tuifaId=1,continuelive=1 where occ_id in (" + ids + ")";
                fmOc.Updates(strqwl);
                //ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('退房成功');parent.Window_Close();</script>");
            }
        }
コード例 #13
0
        /// <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 { }
        }