//结帐,记帐,挂帐处理过程 public string GetJzResult(string lsbh, string jzbh, string czzt, string sk_tt, string czy, string czsj, string hykh, string xfje, string phoneNo, string yydh) { string s = common_app.get_failure; //记帐,挂帐,结帐的处理节 if (czzt == common_file.common_jzzt.czzt_sz)//算帐 { strSql = new StringBuilder(); strSql.Append("delete from Syjcz where id>0 " + common_app.yydh_select + " and lsbh='" + lsbh + "'"); B_common.ExecuteSql(strSql.ToString()); strSql = new StringBuilder(); strSql.Append("delete from Szwmx where id>0 " + common_file.common_app.yydh_select + " and lsbh='" + lsbh + "'"); B_common.ExecuteSql(strSql.ToString()); } //更新Ssyxfmx里的Jzbh B_common.ExecuteSql("update Ssyxfmx set jzbh='" + jzbh + "' where lsbh='" + lsbh + "'"); if (czzt == common_jzzt.czzt_gz || czzt == common_jzzt.czzt_jz || czzt == common_file.common_jzzt.czzt_sz) { //清除Szw_temp strSql = new StringBuilder(); strSql.Append("delete from Szw_temp where id>0 " + common_app.yydh_select + " and lsbh='" + lsbh + "'"); if (B_common.ExecuteSql(strSql.ToString()) >= 0) //清除Szw_temp里面的数据了 { //调用修改房态的方法(第五步) if (sk_tt == "sk") { M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id>0 " + common_app.yydh_select + " and lsbh='" + lsbh + "'")[0]; id = M_Qskyd_mainrecord.id.ToString(); //删除主单记录(这里有包含主单记录删除时的备份) if (Qyddj_add_edit_delete_new.delete_sz_xgft(id, "jz", common_file.common_jzzt.czzt_sz, "", jzbh, czy, czsj, xxzs) == common_app.get_suc) { s = common_app.get_suc; } } else//是团体 { M_Qttyd_mainrecord = B_Qttyd_mainrecord.GetModelList("ID>0 " + common_app.yydh_select + " AND lsbh='" + lsbh + "'")[0]; string tt_id = M_Qttyd_mainrecord.id.ToString(); //要成批更新团体所有成员的房态,并删除成员主单 string ddbh_temp = M_Qttyd_mainrecord.ddbh; if (Qttyd_add_edit_delete_new.delete_sz_ttyd(tt_id, "jz", common_file.common_jzzt.czzt_sz, "", jzbh, czy, czsj, xxzs) == common_file.common_app.get_suc) { s = common_file.common_app.get_suc; } } //结帐成功后,更新会员的积分(挂-结,记-结,部分结,结帐都要加积分 //会员卡号,当前记录的lsbh, if ((czzt == common_jzzt.czzt_sz) || (czzt == common_jzzt.czzt_jz) || (czzt == common_jzzt.czzt_gz) || (czzt == common_jzzt.czzt_bfsz)) { string zjf = "0"; bool shsj = false; string hyrx_now = "";//银卡 string dfjf = "0"; string lsbh_df = common_file.common_ddbh.ddbh("df", "lsbhdfdate", "lsbhdfcounter", 6); string qymc = ""; if (!yydh.Equals("")) { DataSet ds000 = B_common.GetList(" select * from Xqyxx ", " id>=0 and yydh='" + yydh + "' "); if (ds000 != null && ds000.Tables[0].Rows.Count > 0) { qymc = ds000.Tables[0].Rows[0]["qymc"].ToString(); } } IncHYScore(jzbh, lsbh, sk_tt, hykh, xfje, ref zjf, ref shsj); //发送会员消费短信 Hhygl.Hhygl_verifyCode Hhygl_verifyCode_new = new Hotel_app.Server.Hhygl.Hhygl_verifyCode(); Hhygl_verifyCode_new.Hhygl_SendMsm(phoneNo, zjf, yydh, qymc, common_hyAction.hy_Action_hytf, czsj, "", "", "", hykh, xfje, xxzs); BLL.Hhygl B_Hhygl_new = new Hotel_app.BLL.Hhygl(); DataSet ds111 = B_Hhygl_new.GetList(" hykh_bz='" + hykh + "' and id>=0 and hykh_bz!='' "); if (ds111 != null && ds111.Tables[0].Rows.Count > 0) { hyrx_now = ds111.Tables[0].Rows[0]["hykh_bz"].ToString(); } //升级需要的积分数 BLL.Hhyjb B_Hhyjb_new = new Hotel_app.BLL.Hhyjb(); DataSet ds222 = B_Hhyjb_new.GetList(" hyrx='" + common_app.hykh_rx + "' and id>=0 and qymc='" + qymc + "' "); if (ds222 != null && ds222.Tables[0].Rows.Count > 0) { dfjf = ds222.Tables[0].Rows[0]["hykh_bz"].ToString(); } if (!hyrx_now.Equals("") && hyrx_now.Equals(common_app.hykh_rx)) { //发送短信(判断当前的会员类型),是银卡才自动升级 if (shsj)//自动发送升级短信 { Hhygl_verifyCode_new.Hhygl_SendMsm(phoneNo, zjf, yydh, qymc, common_hyAction.hy_Action_hytf, czsj, "", "", "", hykh, xfje, xxzs); //调用升级会员的方法,扣除升级积分 Hhygl.Hhyjf_df Hhyjf_dr_new = new Hotel_app.Server.Hhygl.Hhyjf_df(); Hhyjf_dr_new.Hhyjfdf_add_edit("", yydh, qymc, "", hykh, "", dfjf, "升级金卡", "1", lsbh_df, hykh, common_app.chinese_add, xxzs); } } } } } return(s); }
//结帐,记帐,挂帐处理过程 public string GetJzResult(string lsbh, string jzbh, string yydh, string jzzt, string syzd, string czy_bc, string czzt, string sk_tt, string czy, string czsj, string hhykh_bz, string phoneNo, string czy_GUID) { string s = common_app.get_failure; //记帐,挂帐,结帐的处理节 if (czzt == common_file.common_jzzt.czzt_sz)//算帐 { strSql = new StringBuilder(); strSql.Append(" insert into Sfkfssz(yydh,qymc,is_top,is_select,jzbh,jzzt,lsbh,fjbh,krxm,fkfs,xfdr,xfrb,xfxm,xfje,sjxfje,xfrq,xfsj,czrq,czsj,czy,czy_bc,syzd,id_app)"); strSql.Append(" select yydh,qymc,0,0,jzbh,'" + jzzt + "',lsbh,fjbh,krxm,fkfs,xfdr,xfrb,xfxm,-xfje,-sjxfje,xfrq,xfsj,'" + DateTime.Parse(czsj).ToShortDateString() + "','" + czsj + "','" + czy + "','" + czy_bc + "','" + syzd + "',id_app from Szw_temp where jzbh='" + jzbh + "' and xfdr='" + common_app.fkdr + "'"); B_common.ExecuteSql(strSql.ToString()); strSql = new StringBuilder(); strSql.Append("delete from Syjcz where id>0 " + common_app.yydh_select + " and id_app in (select id_app from Szw_temp where czy_temp='" + czy_GUID + "')"); B_common.ExecuteSql(strSql.ToString()); strSql = new StringBuilder(); strSql.Append("delete from Szwmx where id>=0 " + common_file.common_app.yydh_select + " and jzbh<>'' and jzbh='" + jzbh + "'"); B_common.ExecuteSql(strSql.ToString()); } if (czzt == common_jzzt.czzt_gz || czzt == common_jzzt.czzt_jz || czzt == common_file.common_jzzt.czzt_sz) { //调用修改房态的方法(第五步) if (sk_tt == "sk") { //DataSet ds_temp0 = B_common.GetList(" select distinct lsbh from Szw_temp", " czy='" + czy + "' and yydh='" + yydh + "'"); DataSet ds_temp0 = B_common.GetList(" select * from Flfsz ", " id>=0 and yydh='" + common_file.common_app.yydh + "' and lfbh in (select lfbh from Flfsz where lsbh='" + lsbh + "' and yydh='" + common_file.common_app.yydh + "' and shlz='1' ) and shlz=1 "); // B_common.GetList("select distinct lsbh from Flfsz", " lfbh in (select lfbh From Flfsz where lsbh='" + lsbh + "' ) and shlz=1 and yydh='" + yydh + "'"); if (ds_temp0 != null && ds_temp0.Tables[0].Rows.Count > 0) { } else { ds_temp0 = B_common.GetList("select distinct lsbh from Qskyd_mainrecord", " lsbh='" + lsbh + "' and yydh='" + yydh + "'"); } if (ds_temp0 != null && ds_temp0.Tables[0].Rows.Count > 0) { s = common_app.get_failure; for (int j = 0; j < ds_temp0.Tables[0].Rows.Count; j++) { string lsbh_0 = ds_temp0.Tables[0].Rows[j]["lsbh"].ToString(); M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id>0 " + common_app.yydh_select + " and lsbh='" + lsbh_0 + "'")[0]; id = M_Qskyd_mainrecord.id.ToString(); //删除主单记录(这里有包含主单记录删除时的备份) // if (Qyddj_add_edit_delete_new.delete_sz_xgft(id, "jz", common_file.common_jzzt.czzt_sz, "", jzbh, czy, czsj, xxzs) == common_app.get_suc) if (Qyddj_add_edit_delete_new.delete_sz_xgft(id, "jz", czzt, "", jzbh, czy, czsj, xxzs) == common_app.get_suc) { s = common_app.get_suc; } } } else { //M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id>0 " + common_app.yydh_select + " and lsbh='" + lsbh + "'")[0]; DataSet ds_1 = B_common.GetList(" select * from Qskyd_mainrecord ", "id>0 " + common_app.yydh_select + " and lsbh='" + lsbh + "' and main_sec='" + common_file.common_app.main_sec_main + "'"); //M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id>0 " + common_app.yydh_select + " and lsbh='" + lsbh + "'")[0]; if (ds_1 != null && ds_1.Tables[0].Rows.Count > 0) {//M_Qskyd_mainrecord.id.ToString(); //删除主单记录(这里有包含主单记录删除时的备份 id = ds_1.Tables[0].Rows[0]["id"].ToString(); // if (Qyddj_add_edit_delete_new.delete_sz_xgft(id, "jz", common_file.common_jzzt.czzt_sz, "", jzbh, czy, czsj, xxzs) == common_app.get_suc) if (Qyddj_add_edit_delete_new.delete_sz_xgft(id, "jz", czzt, "", jzbh, czy, czsj, xxzs) == common_app.get_suc) { s = common_app.get_suc; } } } } else//是团体 { DataSet ds_1 = B_common.GetList(" select * from Qttyd_mainrecord ", "id>0 " + common_app.yydh_select + " and lsbh='" + lsbh + "' "); if (ds_1 != null && ds_1.Tables[0].Rows.Count > 0) { //M_Qttyd_mainrecord = B_Qttyd_mainrecord.GetModelList("ID>0 " + common_app.yydh_select + " AND LSBH='" + lsbh + "'")[0]; string tt_id = ds_1.Tables[0].Rows[0]["id"].ToString();// M_Qttyd_mainrecord.id.ToString(); //要成批更新团体所有成员的房态,并删除成员主单 //string ddbh_temp = M_Qttyd_mainrecord.ddbh; // if (Qttyd_add_edit_delete_new.delete_sz_ttyd(tt_id, "jz", common_file.common_jzzt.czzt_sz, "", jzbh, czy, czsj, xxzs) == common_file.common_app.get_suc) if (Qttyd_add_edit_delete_new.delete_sz_ttyd(tt_id, "jz", czzt, "", jzbh, czy, czsj, xxzs) == common_file.common_app.get_suc) { s = common_file.common_app.get_suc; } } } if (s == common_app.get_suc) { //备份到Szw_temp_bak,清除Szw_temp,并且更新bak表里面的tfsj为当前的操作时间 strSql = new StringBuilder(); strSql.Append(" insert into Szw_temp_bak(yydh,qymc,is_top,is_select,id_app,jzbh,lsbh,krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,fkfs,jjje,xfje,yh,sjxfje,xfsl,shsc,mxbh,czsj,czy_temp)"); strSql.Append(" select yydh,qymc,is_top,is_select,id_app,jzbh,lsbh,krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,fkfs,jjje,xfje,yh,sjxfje,xfsl,shsc,mxbh,czsj,czy_temp from Szw_temp"); strSql.Append(" where czy_temp='" + czy_GUID + "' and xfxm!='" + common_app.dj_pzsk + "'"); B_common.ExecuteSql(strSql.ToString()); strSql = new StringBuilder(); strSql.Append("delete from Szw_temp where id>0 and czy_temp='" + czy_GUID + "'"); if (B_common.ExecuteSql(strSql.ToString()) >= 0) //清除Szw_temp里面的数据了 //修改备份表的tfsj { if (sk_tt == "sk") { B_common.ExecuteSql(" update Qskyd_mainrecord_bak set czsj='" + czsj + "' where jzbh='" + jzbh + "'"); B_common.ExecuteSql(" update Qskyd_mainrecord_lskr set czsj='" + czsj + "' where jzbh='" + jzbh + "'"); //B_common.ExecuteSql(" update Qskyd_mainrecord_temp set lksj='" + czsj + "' where lsbh='" + lsbh + "'"); } } if (sk_tt == "tt") { string bak_ddbh_temp = DbHelperSQL.GetSingle(" Select ddbh from Qttyd_mainrecord_bak where lsbh='" + lsbh + "' and jzbh='" + jzbh + "'").ToString(); string bak_jzbh_temp = DbHelperSQL.GetSingle(" select jzbh from Qttyd_mainrecord_bak where lsbh='" + lsbh + "' and jzbh='" + jzbh + "'").ToString(); B_common.ExecuteSql(" update Qttyd_mainrecord_bak set czsj='" + czsj + "' where lsbh='" + lsbh + "' and jzbh='" + jzbh + "'"); B_common.ExecuteSql(" update Qskyd_mainrecord_bak set czsj='" + czsj + "' where ddbh='" + bak_ddbh_temp + "' and jzbh='" + bak_jzbh_temp + "'"); B_common.ExecuteSql(" update Qskyd_mainrecord_lskr set czsj='" + czsj + "' where ddbh='" + bak_ddbh_temp + "' and jzbh='" + bak_jzbh_temp + "'"); B_common.ExecuteSql(" update Qskyd_mainrecord_temp set czsj='" + czsj + "' where ddbh='" + bak_ddbh_temp + "'"); } } //结帐成功后,更新会员的积分(挂-结,记-结,部分结,结帐都要加积分 DataSet ds_temp_2; if (sk_tt == "sk") { ds_temp_2 = B_common.GetList("select jzbh,lsbh,hykh,hykh_bz,krsj,xyh,xydw from Qskyd_mainrecord_bak", " id>=0 and jzbh='" + jzbh + "'"); if (ds_temp_2 != null && ds_temp_2.Tables[0].Rows.Count > 0) { for (int i_0 = 0; i_0 < ds_temp_2.Tables[0].Rows.Count; i_0++) { //有用到的时候才启用 //IncHYScore(ds_temp_2.Tables[0].Rows[i_0]["jzbh"].ToString(), ds_temp_2.Tables[0].Rows[i_0]["lsbh"].ToString(), sk_tt, ds_temp_2.Tables[0].Rows[i_0]["hykh_bz"].ToString(), yydh, qymc,ds_temp_2.Tables[0].Rows[i_0]["krsj"].ToString() , czsj); } } } else if (sk_tt == "tt") { } } return(s); }