//判断yydh是否等于本地yydh public static bool Isyydh(string yydh) { bool f = false; BLL.Xqyxx B_Yxydw = new Hotel_app.BLL.Xqyxx(); Model.Xqyxx M_Yxydw = new Hotel_app.Model.Xqyxx(); DataSet ds = B_Yxydw.GetList("yydh='" + yydh + "'"); if (ds.Tables[0].Rows.Count > 0) { f = true; } return(f); }
// //挂帐/记帐/算帐 public string Func_zwcl(string lsbh, string sktt, string xydw, string krly, string yydh, string czzt, string jzzt, string czy, string czy_bc, string cznr, string czsj, string syzd, string xxzs, string czy_GUID) { string s = common_app.get_failure; decimal fkje_temp = 0; //付款 decimal xfje_temp = 0; //消费 ds_temp = null; ds_xfxm_hz = null; this.xxzs = xxzs; krxm_lz = ""; fjbh_lz = ""; ddsj = ""; //20120611更新(新增加了krxm_lz,fjbh_lz,ddsj) common_zw.GetJZinfo(ref krxm_lz, ref fjbh_lz, ref ddsj, lsbh, yydh, sktt); BLL.Xqyxx B_xqyxx = new Hotel_app.BLL.Xqyxx(); qymc = B_xqyxx.GetList("id>=0 and yydh='" + yydh + "'").Tables[0].Rows[0]["qymc"].ToString(); string hhykh_temp = ""; //记录退房者的会员卡号 string phoneNo = ""; //当前退房者的电话 //查询是否是会员及输入了会员卡 if (sktt == "sk" && krly.Equals(common_krly.krly_hyuan)) { DataSet ds666 = B_common.GetList(" SELECT * from Qskyd_mainrecord ", " id>=0 and yydh='" + yydh + "' and lsbh='" + lsbh + "' "); if (ds666 != null && ds666.Tables[0].Rows.Count > 0) { if (!ds666.Tables[0].Rows[0]["hykh_bz"].Equals("")) { hhykh_temp = ds666.Tables[0].Rows[0]["hykh_bz"].ToString(); phoneNo = ds666.Tables[0].Rows[0]["krsj"].ToString(); } } } //生成jzbh(要判断jzzt,来确定标识符前串) if (czzt == common_file.common_jzzt.czzt_bfsz || czzt == common_file.common_jzzt.czzt_sz) //部分结帐和结帐 { jzbh = common_file.common_ddbh.ddbh("szcz", "jzdate", "jzcounter", 6); //算帐操作 } if (czzt == common_file.common_jzzt.czzt_gz) { jzbh = common_file.common_ddbh.ddbh("gzcz", "jzdate", "jzcounter", 6);//挂帐操作 } if (czzt == common_file.common_jzzt.czzt_jz) { jzbh = common_file.common_ddbh.ddbh("jzcz", "jzdate", "jzcounter", 6);//记帐操作 } if (jzbh.Trim() != "") { common_file.common_czjl.add_czjl(yydh, qymc, czy, "生成结账编号", jzbh, jzbh, DateTime.Now); //先从当前的Szw_temp中查询到当前的lsbh,czy查询出的记录 ds_temp = B_szw_temp.GetList("id>0 " + common_file.common_app.yydh_select + " and czy_temp='" + czy_GUID + "'"); if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0) //有消费记录 { common_file.common_czjl.add_czjl(yydh, qymc, czy, "进行账务处理", lsbh, jzbh, DateTime.Now); //更新Szw_temp里面的对应记录的jzbh StringBuilder sb = new StringBuilder(); sb.Append("update Szw_temp set jzbh='" + jzbh + "' where id>0 " + common_file.common_app.yydh_select + " and czy_temp='" + czy_GUID + "'"); if (B_common.ExecuteSql(sb.ToString()) > 0)//修改成功 { common_file.common_czjl.add_czjl(yydh, qymc, czy, "更新Szw_temp中的结账编号为" + jzbh, lsbh, jzbh, DateTime.Now); ds_temp = B_szw_temp.GetList("id>0 " + common_file.common_app.yydh_select + " and czy_temp='" + czy_GUID + "'"); //计算出xfje和fkje if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds_temp.Tables[0].Rows.Count; i++) { if (ds_temp.Tables[0].Rows[i]["xfxm"].ToString() == common_app.dj_ysk || ds_temp.Tables[0].Rows[i]["xfxm"].ToString() == common_app.dj_pzsk) { fkje_temp += decimal.Parse(ds_temp.Tables[0].Rows[i]["sjxfje"].ToString()); } else { xfje_temp += decimal.Parse(ds_temp.Tables[0].Rows[i]["sjxfje"].ToString()); } } } //fkje //fkje = Math.Abs(fkje_temp).ToString();//最终的付款金额(用绝对值存储) fkje = (-fkje_temp).ToString(); //xfje xfje = xfje_temp.ToString(); //帐务操作处理 if (Pladd(lsbh, qymc, sktt, jzbh, xydw, krly, yydh, czsj, syzd, czy, czy_bc, czzt, jzzt, cznr, bz, fkje, xfje, xxzs, ds_temp, hhykh_temp, phoneNo, czy_GUID) == common_app.get_suc) { s = common_file.common_app.get_suc; } } } else //没有消费记录(空结) { if (Pladd(lsbh, qymc, sktt, jzbh, xydw, krly, yydh, czsj, syzd, czy, czy_bc, czzt, jzzt, cznr, bz, "0", "0", xxzs, null, hhykh_temp, phoneNo, czy_GUID) == common_app.get_suc) { s = common_file.common_app.get_suc; } } } common_file.common_czjl.add_czjl(yydh, "", czy, "当前对帐务:" + lsbh + "进行" + czzt, czzt, czzt + "结果为" + s, Convert.ToDateTime(czsj)); return(s); }