/// <summary> /// 撤销结账 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btncxSava_Click(object sender, EventArgs e) { if (ddlState.SelectedValue == "4") { string SQls = "update room_number set Rn_state=2 where Rn_roomNum='" + brBll.GetModel(Convert.ToInt32(txt_room.Value)).room_number + "'"; string strs = "update occu_infor set state_id='0', tuifaId='0',occ_TfTime=null where occ_id=" + txt_room.Value + ""; if (fmroom.Updates(SQls) && brBll.Updates(strs)) { Maticsoft.Common.MessageBox.ShowAndRedirect(this, "撤销挂单成功!", ""); } } else { List <Model.goods_account> listga = bllga.GetModelList1("ga_occuid='" + brBll.GetModel(Convert.ToInt32(txt_room.Value)).order_id + "' and ga_isjz=1"); if (listga != null && listga.Count > 0) { Maticsoft.Common.MessageBox.ShowAndRedirect(this, "已交班不能撤销结账!", ""); } else { string strsql = "update goods_account set ga_sfacount='否' where ga_occuid='" + brBll.GetModel(Convert.ToInt32(txt_room.Value)).order_id + "'"; string SQl = string.Empty; if (rooms.Value != "") { SQl = "update room_number set Rn_state=2 where Rn_roomNum in(" + rooms.Value + ")"; } string strs = "update occu_infor set state_id='0', tuifaId='0' where order_id=" + brBll.GetModel(Convert.ToInt32(txt_room.Value)).order_id + ""; string SQls = "delete from goods_account where ga_Type in(4,6) and ga_occuid='" + brBll.GetModel(Convert.ToInt32(txt_room.Value)).order_id + "'"; if (fmroom.Updates(SQl) && brBll.Updates(strs)) { fmgoods.Updates(strsql); fmgoods.Deletes(SQls); string up = rooms.Value.Replace("'", ""); Helper.AddRoom(brBll.GetModel(Convert.ToInt32(txt_room.Value)).room_number, up + ","); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "撤销结账成功!", ""); } else { Maticsoft.Common.MessageBox.ShowAndRedirect(this, "撤销结账失败!", ""); } } } }
/// <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 { } }
protected void btncx_Click(object sender, EventArgs e) { string a = txt_ids.Value; string orderby = fmmx.GetModel(Convert.ToInt32(a)).order_id; string Sql = "update goods_account set ga_sfacount='是' where ga_occuid='" + orderby + "'"; string str2 = "update room_number set Rn_state=3 where Rn_roomNum='" + fmmx.GetModel(Convert.ToInt32(a)).room_number + "'"; string STRSQL = " update occu_infor set state_id=10 where occ_id='" + a + "'"; if (fmnumber.Updates(str2) && fmmx.Updates(STRSQL) && fmgood.Updates(Sql)) { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('撤销入账成功');</script>"); AllBind(); } else { ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('撤销入账失败');</script>"); } }
/// <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>"); } }
/// <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>"); } }
/// <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, "保存失败!", ""); } }