protected void bus_add_Click(object sender, EventArgs e) { string order = orderid.Value; List <Model.goods_account> listga = bllga.GetModelList1("ga_occuid='" + order + "'"); if (listga.Count > 0) { Model.goods_account gamodel = listga[0]; string Amount = Request["Amount"]; gamodel.ga_price = Convert.ToDecimal(Amount) * -1; gamodel.ga_sum_price = 0; gamodel.ga_Type = 12; gamodel.ga_name = "积分优惠"; gamodel.ga_isys = 0; gamodel.ga_date = DateTime.Now; gamodel.ga_remker = "积分抵换" + Amount; if (bllga.Add(gamodel) > 0) { Model.mRecords modelmr = new Model.mRecords(); string mid = Request["CardNo"]; modelmr.mmid = mid; modelmr.Price = Convert.ToInt32(Amount); modelmr.Type = 4; bllmr.Add(modelmr); } Response.Write("<script>alert('兑换成功');parent.Window_Close();</script>"); } }
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>"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["id"] != null) { txtid.Value = Request.QueryString["id"].ToString(); Model.goods_account gamodel = new Model.goods_account(); gamodel = bllga.GetModels1(Convert.ToInt32(Request.QueryString["id"])); txtorderid.Value = gamodel.Ga_goodNo; if (Request.QueryString["type"] == "edit") { if (gamodel.ga_sum_price != 0) { czprice.Value = gamodel.ga_sum_price.ToString(); } else { czprice.Value = gamodel.ga_price.ToString(); } czprice.Attributes.Add("disabled", "disabled"); //yying.Attributes.Add("disabled", "disabled"); yying.Value = gamodel.ga_remker; btnok.Text = "确定"; } } } }
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>"); } }
//取消按钮不做物理删除,改变状态 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"); } }
protected void okClick(object sender, EventArgs e) { try { if (Request.QueryString["type"] == "edit") { } else { Model.goods_account modelga = new Model.goods_account(); modelga.ga_name = "非住客帐"; modelga.ga_number = "J" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("-", "").Replace(":", "").Replace(" ", "").Replace("/", ""); modelga.ga_num = Convert.ToInt32(inputxt.Value); modelga.ga_price = Convert.ToDecimal(Hidden1.Value); modelga.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue); modelga.ga_date = Convert.ToDateTime(DateTime.Now); modelga.ga_people = UserNow.UserID; modelga.ga_sum_price = 0; modelga.ga_Type = 110; modelga.ga_sfacount = "是"; modelga.ga_isys = 0; modelga.ga_remker = Remark.Value; int occid = gabll.Add(modelga); if (occid > 0) { string str = xq.Value; string[] strlist = str.Split(','); foreach (string item in strlist) { Model.goods_account modelga1 = new Model.goods_account(); modelga1.ga_name = item.Split('#')[1]; modelga1.ga_number = item.Split('#')[0]; modelga1.ga_unit = item.Split('#')[2]; modelga1.ga_num = Convert.ToInt32(item.Split('#')[4]); modelga1.ga_price = Convert.ToDecimal(item.Split('#')[3]); modelga1.ga_sum_price = Convert.ToDecimal(item.Split('#')[5]); modelga1.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue); modelga1.ga_date = Convert.ToDateTime(DateTime.Now); modelga1.ga_people = UserNow.UserID; modelga1.ga_Type = 111; modelga1.ga_sfacount = "是"; modelga1.ga_isys = 0; modelga1.ga_remker = Remark.Value; modelga1.ga_occuid = occid.ToString(); gabll.Add(modelga1); } } Response.Write("<script>alert('入账成功!!');parent.window.location.reload();</script>"); } } catch (Exception ex) { throw; } }
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); }
private void BC(decimal dce) { Model.goods_account modelga = new Model.goods_account(); modelga.ga_name = "会员收款"; modelga.ga_price = dce; modelga.ga_zffs_id = Convert.ToInt32(PayMethod.SelectedValue); modelga.ga_date = DateTime.Now; modelga.ga_people = UserNow.UserID; modelga.ga_Type = 21; modelga.ga_isjz = 0; modelga.ga_isys = 0; bllga.Add(modelga); }
private void Delga() { int id = Convert.ToInt32(context.Request.QueryString["id"]); Model.goods_account modelga = bllga.GetModel(id); if (modelga.ga_isjz == 1 || modelga.ga_isys == 1) { context.Response.Write("err"); context.Response.End(); } if (bllga.Delete(id)) { context.Response.Write("ok"); context.Response.End(); } }
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>"); } }
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>"); } }
/// <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>"); } }
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); } }
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"); } }
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>"); }
/// <summary> /// 获得数据列表 /// </summary> public List <Model.goods_account> GetListByWhere(string strWhere) { StringBuilder strSql = new StringBuilder(); strSql.Append("select id,ga_name,ga_number,ga_roomNumber,ga_unit,ga_num,ga_price,ga_zffs_id,ga_date,ga_people,ga_Type,ga_sum_price,ga_remker,ga_sfacount,ga_occuid,ga_isjz,ga_goodNo,ga_isys,ga_Account,ga_jsfs "); strSql.Append(" FROM goods_account "); if (strWhere.Trim() != "") { strSql.Append(" where " + strWhere); } DataSet ds = DbHelperSQL.Query(strSql.ToString()); List <Model.goods_account> list = null; if (ds != null) { list = new List <Model.goods_account>(); foreach (DataRow dr in ds.Tables[0].Rows) { Model.goods_account model = DataRowToModel1(dr); list.Add(model); } } return(list); }
/// <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> private void AddBook() { try { bool isb = true; System.Text.StringBuilder sbText = new System.Text.StringBuilder(); string book_no = string.Empty; string isUpdate = context.Request.Form["isUpdate"].ToString(); if (isUpdate == "true") { book_no = context.Request.Form["book_no"].ToString(); List <Model.Book_Rdetail> listbr = bllrd.GetListModel("Book_no='" + book_no + "'"); if (listbr.Count > 0) { Model.room_number modelrt = new Model.room_number(); foreach (Model.Book_Rdetail item in listbr) { if (item.Room_number != null) { if (item.Room_number.Trim() != "") { modelrt = bllrn.GetModelList("Rn_roomNum='" + item.Room_number + "'")[0]; modelrt.Rn_Tobe = 0; Helper.AddRoom(item.Room_number); bllrn.Update(modelrt); } } } } bool rels = bllrd.DeletebyWhere("Book_no='" + book_no + "'"); if (rels) { bllbr.DeletebyWhere("Book_no='" + book_no + "'"); } } else { book_no = "Y" + System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", ""); } string txtname = context.Request.Form["txtname"].ToString(); string txtPhone = context.Request.Form["txtPhone"].ToString(); string txtDh = context.Request.Form["txtDh"].ToString(); string txtrz = context.Request.Form["txtrz"].ToString(); string txttf = context.Request.Form["txttf"].ToString(); string txtyd = context.Request.Form["txtyd"].ToString(); string txtmCard = context.Request.Form["txtmCard"].ToString(); string guarWayDll = context.Request.Form["guarWayDll"].ToString(); string guestSourceDdl = context.Request.Form["guestSourceDdl"].ToString(); string methPayDdl = context.Request.Form["methPayDdl"].ToString(); string txtdj = context.Request.Form["txtdj"].ToString(); string textRemaker = context.Request.Form["textRemaker"].ToString(); string accounts = context.Request.Form["accounts"].ToString(); string CpId = context.Request.Form["CpId"].ToString(); string strs = context.Request.Form["sjs"].ToString(); int? cid = null; if (CpId != "") { cid = Convert.ToInt32(CpId); } strs = strs.Remove(strs.Length - 1, 1); Model.book_room model = new Model.book_room() { book_no = book_no, book_Name = txtname, tele_no = txtPhone, onli_no = txtDh, guar_way = guarWayDll, mem_cardno = txtmCard, time_to = Convert.ToDateTime(txtrz), time_from = Convert.ToDateTime(txttf), real_time = Convert.ToDateTime(txtyd), source_id = Convert.ToInt32(guestSourceDdl), meth_pay_id = Convert.ToInt32(methPayDdl), deposit = Convert.ToDecimal(txtdj), remark = textRemaker, Userid = UserNow.UserID, Accounts = accounts, CpID = cid }; if (Math.Floor(Convert.ToDouble(txtdj)) == 0) { model.state_id = 6; } else { model.state_id = 1; } int rel = bllbr.Add(model); if (rel > 0) { string[] strlist = strs.Split(new char[1] { '*' }, StringSplitOptions.RemoveEmptyEntries); Dictionary <string, string> dic = new Dictionary <string, string>(); foreach (string str in strlist) { dic.Clear(); string[] strdelt = str.Split(new char[1] { ',' }); foreach (string s in strdelt) { string[] strval = s.Split(new char[1] { ':' }); dic.Add(strval[0], strval[1]); } Model.Book_Rdetail modelbr = new Model.Book_Rdetail() { Book_no = model.book_no, Real_type_Id = Convert.ToInt32(dic["typeid"]), Room_number = dic["roomnumber"], Real_num = Convert.ToInt32(dic["number"]), Ok_num = 0, Real_Price = Convert.ToDecimal(dic["price"]), Real_Scheme_Id = Convert.ToInt32(dic["fangan"]), RoomTypeID = Convert.ToInt32(model.state_id) }; if (!IsBook(modelbr.Room_number)) { isb = false; List <Model.room_number> list = bllrn.GetModelList("Rn_roomNum='" + modelbr.Room_number + "'"); if (list.Count > 0) { Model.room_number modelrn = list[0]; modelrn.Rn_Tobe = 1; bllrn.Update(modelrn); } if (modelbr.Room_number.Trim() != "") { Helper.AddRoom(modelbr.Room_number); } bllrd.Add(modelbr); } else { sbText.Append(modelbr.Room_number + ","); } } } if (isUpdate == "true") { context.Response.Write("更新成功!,' '"); } else { if (isb) { bllbr.Delete(rel); context.Response.Write("房间已被预定!," + book_no + ""); } else { string finalStr = "{book_no:" + book_no + "}"; Model.goods_account modelga = new Model.goods_account() { ga_name = "预定收款", ga_number = model.book_no, ga_price = Convert.ToDecimal(model.deposit), ga_zffs_id = Convert.ToInt32(methPayDdl), ga_date = DateTime.Now, ga_people = UserNow.UserID, ga_Type = 8, ga_occuid = "", ga_remker = "", ga_sum_price = Convert.ToDecimal("0.0000"), ga_sfacount = "是", ga_isjz = 0, ga_roomNumber = "0", ga_num = 0, ga_unit = "" }; bllga.Add(modelga); if (sbText.ToString() != "") { context.Response.Write("新增成功" + sbText.ToString() + "已被预定!," + book_no + ""); } else { context.Response.Write("新增成功!," + book_no + ""); } } } context.Response.End(); } catch (Exception ex) { context.Response.End(); } }
/// <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 { } }