Beispiel #1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdds_Click(object sender, EventArgs e)
        {
            try
            {
                CdHotelManage.Model.goods_account model = new CdHotelManage.Model.goods_account();
                CdHotelManage.BLL.goods_account   bll   = new CdHotelManage.BLL.goods_account();
                Model.occu_infor Ocmodels = new Model.occu_infor();
                Ocmodels.state_id     = 1;
                Ocmodels.continuelive = ids;
                Ocmodels.brithday     = Convert.ToDateTime(fmrzInfo.GetModel(ids).brithday).ToString();
                Ocmodels.occ_time     = System.DateTime.Now;
                Ocmodels.depar_time   = Convert.ToDateTime(txt_ydDate.Value);
                Ocmodels.pha_sched    = Convert.ToDateTime(txt_xdDate.Value);
                Ocmodels.deposit      = Convert.ToDecimal(txt_yjMoney.Value);
                Ocmodels.stay_day     = Convert.ToInt32(txt_liveDay.Value);
                Ocmodels.meth_pay_id  = Convert.ToInt32(DDlZffs.SelectedValue);
                model.ga_number       = ids.ToString();
                model.ga_Type         = 3;
                model.ga_name         = "续住收款";
                model.ga_number       = ids.ToString();
                model.ga_price        = Convert.ToDecimal(txt_yjMoney.Value);
                model.ga_sum_price    = 0;
                model.ga_date         = Convert.ToDateTime(System.DateTime.Now);
                model.ga_occuid       = fmrzInfo.GetModel(ids).order_id;
                model.ga_people       = UserNow.UserID;
                model.ga_sfacount     = "否";
                model.ga_remker       = txt_Remaker.Value;
                model.Ga_goodNo       = fmrzInfo.GetModel(ids).occ_no;
                model.ga_zffs_id      = Convert.ToInt32(DDlZffs.SelectedValue);
                model.ga_roomNumber   = fmrzInfo.GetModel(ids).room_number;
                int Result = bll.Add(model);
                int day    = Convert.ToInt32(fmrzInfo.GetModel(ids).stay_day) + Convert.ToInt32(txt_liveDay.Value);

                string sql = "update occu_infor set stay_day='" + day + "',depar_time='" + txt_xdDate.Value + "' where occ_id=" + fmrzInfo.GetModel(ids).occ_id + " ";
                fmrzInfo.Updates(sql);
                if (Result > 0 && fmrzInfo.Add(Ocmodels) > 0)
                {
                    Helper.AddRoom(model.ga_roomNumber);
                    //  Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "");
                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>if(confirm('续住成功,是否打印收款单?')){XZintRZ(this," + fmrzInfo.GetModel(ids).order_id + ") }else{Close('房态图'); }; parent.Window_Close();</script>");
                }
                else
                {
                    Maticsoft.Common.MessageBox.ShowAndRedirect(this, "续住失败!", "");
                }
            }
            catch { }
        }
Beispiel #2
0
        /// <summary>
        /// 换房
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdds_Click(object sender, EventArgs e)
        {
            Model.occu_infor mode = new Model.occu_infor();
            string           SQl  = "update room_number set Rn_state=4 where Rn_roomNum='" + labfh.Text + "';update room_number set Rn_state=2 where Rn_roomNum='" + txt_RoomNum.Value + "'";;

            Model.occu_infor Ocmodels = new Model.occu_infor();
            Ocmodels.state_id        = 2;
            Ocmodels.continuelive    = ids;
            Ocmodels.occ_time        = System.DateTime.Now;
            Ocmodels.room_number     = (txt_RoomNum.Value).ToString();
            Ocmodels.real_price      = Convert.ToDecimal(txt_Money.Value);
            Ocmodels.remark          = txt_Remaker.Value;
            Ocmodels.state_id        = 0;
            Ocmodels.occ_no          = fmrzInfo.GetModel(ids).occ_no;
            Ocmodels.occ_name        = fmrzInfo.GetModel(ids).occ_name;
            Ocmodels.occ_with        = "否";
            Ocmodels.stay_day        = fmrzInfo.GetModel(ids).stay_day;
            Ocmodels.depar_time      = fmrzInfo.GetModel(ids).depar_time;
            Ocmodels.sex             = fmrzInfo.GetModel(ids).sex;
            Ocmodels.card_id         = fmrzInfo.GetModel(ids).card_id;
            Ocmodels.brithday        = fmrzInfo.GetModel(ids).brithday;
            Ocmodels.family_name     = fmrzInfo.GetModel(ids).family_name;
            Ocmodels.address         = fmrzInfo.GetModel(ids).address;
            Ocmodels.meth_pay_id     = fmrzInfo.GetModel(ids).meth_pay_id;
            Ocmodels.deposit         = fmrzInfo.GetModel(ids).deposit;
            Ocmodels.remark          = fmrzInfo.GetModel(ids).remark;
            Ocmodels.lordRoomid      = (txt_RoomNum.Value).ToString();
            Ocmodels.phonenum        = fmrzInfo.GetModel(ids).phonenum;
            Ocmodels.Room_type_model = fmrzInfo.GetModel(ids).Room_type_model;
            Ocmodels.source_id       = fmrzInfo.GetModel(ids).source_id;
            Ocmodels.real_mode_id    = fmrzInfo.GetModel(ids).real_mode_id;
            Ocmodels.real_scheme_id  = fmrzInfo.GetModel(ids).real_scheme_id;
            Ocmodels.real_type_id    = fmrzInfo.GetModel(ids).real_type_id;
            Ocmodels.order_id        = fmrzInfo.GetModel(ids).order_id;
            Ocmodels.tuifaId         = "0";
            string noces  = System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "");
            string strsql = "";

            if (fmrzInfo.GetRecordCount("where order_id='" + Ocmodels.order_id + "'") == 1)
            {
                strsql = "update occu_infor set state_id=2,tuifaId=2,continuelive=1 ,order_id='" + noces + "' where occ_id='" + ids + "'";
            }
            else
            {
                //  strsql = "update occu_infor set state_id=3,tuifaId=2,continuelive=1 where order_id=" + Ocmodels.order_id + "";
                strsql = "update occu_infor set state_id=2,tuifaId=2,continuelive=1 where occ_id=" + ids + "";
            }
            fmrzInfo.Updates(strsql);
            CdHotelManage.Model.goods_account model = new CdHotelManage.Model.goods_account();
            CdHotelManage.BLL.goods_account   bll   = new CdHotelManage.BLL.goods_account();
            double money = double.Parse(txt_Money.Value) - double.Parse(labSymoney.Text);

            if (money > 0)
            {
                money = double.Parse(labSymoney.Text) - double.Parse(txt_Money.Value);
            }
            else
            {
                money = double.Parse(labSymoney.Text);
            }
            string Remaker = labname.Text + "从" + labfh.Text + "换到" + txt_RoomNum.Value + " 从" + labkffs.Text + "(" + labSymoney.Text + ")调整为天房(" + txt_Money.Value + ") 操作时间:" + System.DateTime.Now;
            string beizhu  = fmGoods.GetModels(" where ga_Type=8 order by ga_date ").ga_remker + Remaker + ",";
            string Date    = fmGoods.GetModels(" where ga_Type=8 order by ga_date ").ga_date.ToString();
            string upsql   = "update goods_account set ga_sum_price='" + money + "',ga_remker='" + beizhu + "' where ga_Type=8 and  datediff(SS,ga_date,'" + Date + "')=0 and ga_occuid='" + Ocmodels.order_id + "'";

            fmGoods.Updates(upsql);
            if (fhBll.Updates(SQl) && fmrzInfo.Add(Ocmodels) > 0)
            {
                Helper.AddRoom(Ocmodels.room_number);
                Helper.AddRoom(Ocmodels.lordRoomid);
                //Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "");
                ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>if(confirm('换房成功,是否打换房单')){Show(" + ids + ");}else{ parent.location.reload(); };</script>");
            }
            else
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存失败!", "");
            }
        }