public string clear_old_yd_fjzt(string old_fjbh, DateTime ddsj, DateTime lksj, DateTime czsj, string czy, string xxzs) { string s = common_file.common_app.get_failure; string krxm0 = ""; string sktt0 = ""; string lsbh0 = ""; bool shlf0 = false; bool shts0 = false; bool shvip0 = false; bool fjbm0 = false; BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt(); DataSet ds_temp = B_Ffjzt.GetList("fjbh='" + old_fjbh + "'");//选择旧房号 Model.Ffjzt M_Ffjzt; Ffjzt.Ffjzt_add_edit Ffjzt_add_edit_new = new Hotel_app.Server.Ffjzt.Ffjzt_add_edit(); if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0) { s = common_file.common_app.get_suc; M_Ffjzt = B_Ffjzt.GetModel(int.Parse(ds_temp.Tables[0].Rows[0]["id"].ToString())); ds_temp = B_Ffjzt.GetList("zyzt_second='" + common_file.common_fjzt.ydf + "' and fjbh='" + old_fjbh + "' and yd_ddsj='" + ddsj.ToString() + "' and yd_lksj='" + lksj.ToString() + "'"); if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)//原来如果有在房态里体现预订的话要先清除,但新的房号如果有排也要重新加载新房号的房态 { s = common_file.common_app.get_failure; //krxm0 = ""; sktt0 = ""; lsbh0 = ""; //shlf0 = false; shts0 = false; shvip0 = false; //为什么要下面这步,为了在没在住房时清除以下三个值. if (M_Ffjzt.zyzt == common_file.common_fjzt.zzf) { krxm0 = M_Ffjzt.krxm; lsbh0 = M_Ffjzt.lsbh; sktt0 = M_Ffjzt.sktt; shlf0 = M_Ffjzt.shlf; shts0 = M_Ffjzt.shts; shvip0 = M_Ffjzt.shvip; fjbm0 = M_Ffjzt.fjbm; } Ffjzt_add_edit_new.Ffjzt_xgft(M_Ffjzt.zyzt, "", M_Ffjzt.zybz, old_fjbh, krxm0, M_Ffjzt.ddsj, M_Ffjzt.lksj, DateTime.Parse(common_file.common_app.cssj), DateTime.Parse(common_file.common_app.cssj), shlf0, shts0, shvip0, fjbm0, sktt0, lsbh0, czsj, czy, "预订清除", xxzs); s = common_file.common_app.get_suc; } } return(s); }
//房间 public string Ffjzt_add_edit_delete(string id, string yydh, string qymc, string jdlh, string jdlh_name, string jdcs, string jdcs_name, string fjrb, string fjrb_code, string fjbh, string fjdh, string dhfj, string bz, string add_edit_delete, string xxzs) { string s = common_file.common_app.get_failure; BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt(); BLL.Ffjzt B_Ffjzt_new = new Hotel_app.BLL.Ffjzt(); Model.Ffjzt M_Ffjzt = new Hotel_app.Model.Ffjzt(); if (xxzs == common_file.common_app.xxzs_xxvalue) { } if (xxzs == common_file.common_app.xxzs_zsvalue) { } s = add_edit_delete; if (add_edit_delete == common_file.common_app.get_add) { M_Ffjzt.yydh = yydh; M_Ffjzt.qymc = qymc; M_Ffjzt.jdlh = jdlh; M_Ffjzt.jdlh_name = jdlh_name; M_Ffjzt.jdcs = jdcs; M_Ffjzt.jdcs_name = jdcs_name; M_Ffjzt.fjrb = fjrb; M_Ffjzt.fjrb_code = fjrb_code; M_Ffjzt.fjbh = fjbh; M_Ffjzt.fjdh = fjdh; M_Ffjzt.dhfj = dhfj; M_Ffjzt.bz = bz; M_Ffjzt.yd_ddsj = M_Ffjzt.yd_lksj = M_Ffjzt.ddsj = M_Ffjzt.lksj = DateTime.Parse(common_file.common_app.cssj); M_Ffjzt.czsj = DateTime.Now; M_Ffjzt.zyzt = common_file.common_fjzt.gjf; M_Ffjzt.zyzt_second = ""; if (B_Ffjzt_new.Add(M_Ffjzt) > 0)//调用自定义类初始化房间 { s = common_file.common_app.get_suc; } } else if (add_edit_delete == common_file.common_app.get_edit) { M_Ffjzt = B_Ffjzt.GetModel(Convert.ToInt32(id)); M_Ffjzt.jdlh = jdlh; M_Ffjzt.jdlh_name = jdlh_name; M_Ffjzt.jdcs = jdcs; M_Ffjzt.jdcs_name = jdcs_name; M_Ffjzt.fjrb = fjrb; M_Ffjzt.fjrb_code = fjrb_code; M_Ffjzt.fjdh = fjdh; M_Ffjzt.dhfj = dhfj; M_Ffjzt.bz = bz; M_Ffjzt.czsj = DateTime.Now; if (B_Ffjzt.Update(M_Ffjzt)) { s = common_file.common_app.get_suc; } } else if (add_edit_delete == common_file.common_app.get_delete) { if (id != null) { if (id != "") { if (B_Ffjzt.Delete(Convert.ToInt32(id))) { s = common_file.common_app.get_suc; } } } } return(s); }
public string add_fjbh_yd_fjzt(string lsbh, string fjbh, string sktt, DateTime czsj, string czy, string xxzs) //预订时变更去修改房态,返回成功或失败 { string s = common_file.common_app.get_failure; string krxm0 = ""; string sktt0 = ""; string lsbh0 = ""; bool shlf0 = false; bool shts0 = false; bool shvip0 = false; bool fjbm0 = false; BLL.Qskyd_fjrb B_Qskyd_fjrb = new Hotel_app.BLL.Qskyd_fjrb(); BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt(); Model.Ffjzt M_fjzt_temp; Ffjzt.Ffjzt_add_edit Ffjzt_add_edit_new = new Hotel_app.Server.Ffjzt.Ffjzt_add_edit(); DataSet ds_temp = B_Qskyd_fjrb.GetList("lsbh='" + lsbh + "'"); if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0) { s = common_file.common_app.get_failure; krxm0 = ds_temp.Tables[0].Rows[0]["krxm"].ToString(); sktt0 = ds_temp.Tables[0].Rows[0]["sktt"].ToString(); lsbh0 = ds_temp.Tables[0].Rows[0]["lsbh"].ToString(); DateTime yd_ddsj_0 = DateTime.Parse(ds_temp.Tables[0].Rows[0]["ddsj"].ToString()); DateTime yd_lksj_0 = DateTime.Parse(ds_temp.Tables[0].Rows[0]["lksj"].ToString()); s = common_file.common_app.get_suc; if (yd_ddsj_0 >= DateTime.Now.Date && yd_ddsj_0 < DateTime.Now.Date.AddDays(1)) //当天预订才去修改房态 { shlf0 = common_file.common_fjzt.Islf(lsbh0); //判断是否联房 shts0 = common_file.common_fjzt.Ists(lsbh0); //判断是否特殊 shvip0 = common_file.common_fjzt.IsVIP(lsbh0); //判断是否VIP或会员 fjbm0 = common_file.common_fjzt.Isbm(lsbh0); s = common_file.common_app.get_suc; ds_temp = B_Ffjzt.GetList("fjbh='" + fjbh + "'"); if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0) { s = common_file.common_app.get_failure; M_fjzt_temp = B_Ffjzt.GetModel(int.Parse(ds_temp.Tables[0].Rows[0]["id"].ToString())); if (M_fjzt_temp.zyzt == common_file.common_fjzt.zzf) { sktt0 = M_fjzt_temp.sktt; lsbh0 = M_fjzt_temp.lsbh; krxm0 = M_fjzt_temp.krxm; shlf0 = M_fjzt_temp.shlf; //common_file.common_fjzt.Islf(lsbh); //判断是否联房 shts0 = M_fjzt_temp.shts; //common_file.common_fjzt.Ists(lsbh);//判断是否特殊 shvip0 = M_fjzt_temp.shvip; //common_file.common_fjzt.IsVIP(lsbh);//判断是否VIP或会员 fjbm0 = M_fjzt_temp.fjbm; } //else //{ sktt0 = M_fjzt_temp.sktt; lsbh0 = M_fjzt_temp.lsbh; } //重新加载新房号的房态 Ffjzt_add_edit_new.Ffjzt_xgft(M_fjzt_temp.zyzt, common_file.common_fjzt.ydf, M_fjzt_temp.zybz, fjbh, krxm0, M_fjzt_temp.ddsj, M_fjzt_temp.lksj, yd_ddsj_0, yd_lksj_0, shlf0, shts0, shvip0, fjbm0, sktt0, lsbh0, czsj, czy, "加载预订", xxzs); s = common_file.common_app.get_suc; } } } return(s); }
//public string add_fjbh_dj_fjzt(string fjbh, Model.Qskyd_fjrb M_Qskyd_fjrb, DateTime czsj, string czy, string xxzs) ////登记时变更去修改房态,返回成功或失败 //{ // string s = common_file.common_app.get_failure; // string krxm0 = ""; string sktt0 = ""; string lsbh0 = ""; // bool shlf0 = false; bool shts0 = false; bool shvip0 = false; bool fjbm0 = false; // BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt(); // DataSet ds_temp = B_Ffjzt.GetList("fjbh='" + fjbh + "'"); // Model.Ffjzt M_Ffjzt; // Ffjzt.Ffjzt_add_edit Ffjzt_add_edit_new = new Hotel_app.Ffjzt.Ffjzt_add_edit(); // if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0) // { // M_Ffjzt = B_Ffjzt.GetModel(int.Parse(ds_temp.Tables[0].Rows[0]["id"].ToString())); // lsbh0 = M_Qskyd_fjrb.lsbh; // krxm0 = M_Qskyd_fjrb.krxm; // sktt0 = M_Qskyd_fjrb.sktt; // shlf0 = common_file.common_fjzt.Islf(lsbh0); //判断是否联房 // shts0 = common_file.common_fjzt.Ists(lsbh0);//判断是否特殊 // shvip0 = common_file.common_fjzt.IsVIP(lsbh0);//判断是否VIP或会员 // fjbm0 = common_file.common_fjzt.Isbm(lsbh0); // Ffjzt_add_edit_new.Ffjzt_xgft(common_file.common_fjzt.zzf, M_Ffjzt.zyzt_second, M_Ffjzt.zybz, fjbh, krxm0, M_Qskyd_fjrb.ddsj, M_Qskyd_fjrb.lksj, M_Ffjzt.yd_ddsj, M_Ffjzt.yd_lksj, shlf0, shts0, shvip0,fjbm0, sktt0, lsbh0, czsj, czy, common_file.common_fjzt.ff, xxzs); // s = common_file.common_app.get_suc; // } // return s; //} //登记时变更去修改房态,返回成功或失败 public string add_fjbh_dj_fjzt(string fjbh, Model.Qskyd_fjrb M_Qskyd_fjrb, DateTime czsj, string czy, string xxzs) { string s = common_file.common_app.get_failure; string krxm0 = ""; string sktt0 = ""; string lsbh0 = ""; bool shlf0 = false; bool shts0 = false; bool shvip0 = false; bool fjbm0 = false; BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt(); DataSet ds_temp = B_Ffjzt.GetList("fjbh='" + fjbh + "'"); Model.Ffjzt M_Ffjzt; Ffjzt.Ffjzt_add_edit Ffjzt_add_edit_new = new Hotel_app.Server.Ffjzt.Ffjzt_add_edit(); if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0) { M_Ffjzt = B_Ffjzt.GetModel(int.Parse(ds_temp.Tables[0].Rows[0]["id"].ToString())); lsbh0 = M_Qskyd_fjrb.lsbh; krxm0 = M_Qskyd_fjrb.krxm; sktt0 = M_Qskyd_fjrb.sktt; DateTime yd_ddsj_temp = M_Qskyd_fjrb.ddsj; DateTime yd_lksj_temp = M_Qskyd_fjrb.lksj; shlf0 = common_file.common_fjzt.Islf(lsbh0); //判断是否联房 shts0 = common_file.common_fjzt.Ists(lsbh0); //判断是否特殊 shvip0 = common_file.common_fjzt.IsVIP(lsbh0); //判断是否VIP或会员 fjbm0 = common_file.common_fjzt.Isbm(lsbh0); Ffjzt_add_edit_new.Ffjzt_xgft(common_file.common_fjzt.zzf, M_Ffjzt.zyzt_second, M_Ffjzt.zybz, fjbh, krxm0, M_Qskyd_fjrb.ddsj, M_Qskyd_fjrb.lksj, M_Ffjzt.yd_ddsj, M_Ffjzt.yd_lksj, shlf0, shts0, shvip0, fjbm0, sktt0, lsbh0, czsj, czy, common_file.common_fjzt.ff, xxzs); M_Ffjzt = B_Ffjzt.GetModel(int.Parse(ds_temp.Tables[0].Rows[0]["id"].ToString())); if (M_Ffjzt != null) { if (M_Ffjzt.yd_ddsj == yd_ddsj_temp && M_Ffjzt.yd_lksj == yd_lksj_temp) { M_Ffjzt.zyzt_second = ""; M_Ffjzt.yd_ddsj = DateTime.Parse(common_file.common_app.cssj); M_Ffjzt.yd_lksj = DateTime.Parse(common_file.common_app.cssj); B_Ffjzt.Update(M_Ffjzt); } } s = common_file.common_app.get_suc; } //s = common_file.common_app.get_suc; return(s); }
public void Ffjzt_xgft(string zyzt, string zyzt_second, string zybz, string fjbh, string krxm, DateTime ddsj, DateTime lksj, DateTime yd_ddsj, DateTime yd_lksj, bool shlf, bool shts, bool shvip, bool fjbm, string sktt, string lsbh, DateTime czsj, string czy, string cznr, string xxzs) { string s = common_file.common_app.get_failure; if (xxzs == common_file.common_app.xxzs_xxvalue) { } if (xxzs == common_file.common_app.xxzs_zsvalue) { } BLL.Common B_Common = new Hotel_app.BLL.Common(); BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt(); Model.Ffjzt M_Ffjzt = new Hotel_app.Model.Ffjzt(); DataSet ds_temp; ds_temp = B_Common.GetList("select id from Ffjzt", "fjbh='" + fjbh + "'"); int id = 0; if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0) { id = Convert.ToInt32(ds_temp.Tables[0].Rows[0]["id"].ToString()); M_Ffjzt = B_Ffjzt.GetModel(id); M_Ffjzt.zybz = zybz; if (zyzt == common_file.common_fjzt.zzf && M_Ffjzt.zyzt == common_file.common_fjzt.zf) { M_Ffjzt.zybz = common_file.common_fjzt.yjf; } M_Ffjzt.zyzt = zyzt; M_Ffjzt.zyzt_second = zyzt_second; M_Ffjzt.krxm = krxm; M_Ffjzt.ddsj = ddsj; M_Ffjzt.lksj = lksj; M_Ffjzt.yd_ddsj = yd_ddsj; M_Ffjzt.yd_lksj = yd_lksj; M_Ffjzt.shlf = shlf; M_Ffjzt.fjbm = fjbm; M_Ffjzt.shts = shts; M_Ffjzt.shvip = shvip; M_Ffjzt.sktt = sktt; M_Ffjzt.lsbh = lsbh; M_Ffjzt.czsj = DateTime.Now; M_Ffjzt.czy = czy; M_Ffjzt.cznr = cznr; if (B_Ffjzt.Update(M_Ffjzt)) { s = common_file.common_app.get_suc; } } ds_temp.Dispose(); }
public string clear_old_dj_fjzt(string old_fjbh, DateTime czsj, string czy, string xxzs) //登记换房时清除旧的房态清除 { string s = common_file.common_app.get_failure; string krxm0 = ""; string sktt0 = ""; string lsbh0 = ""; bool shlf0 = false; bool shts0 = false; bool shvip0 = false; bool fjbm0 = false; string zyzt_second0 = ""; BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt(); BLL.Qskyd_fjrb B_Qskyd_fjrb = new Hotel_app.BLL.Qskyd_fjrb(); Model.Ffjzt M_Ffjzt; Ffjzt.Ffjzt_add_edit Ffjzt_add_edit_new = new Hotel_app.Server.Ffjzt.Ffjzt_add_edit(); DataSet ds_temp = B_Ffjzt.GetList("fjbh='" + old_fjbh + "'"); if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0) { M_Ffjzt = B_Ffjzt.GetModel(int.Parse(ds_temp.Tables[0].Rows[0]["id"].ToString())); //在Qskyd_fjrb表里查询出预订客人的相关住房登记信息 DateTime yd_ddsj0 = DateTime.Parse(common_file.common_app.cssj); DateTime yd_lksj0 = DateTime.Parse(common_file.common_app.cssj); ds_temp = B_Qskyd_fjrb.GetList("yddj='" + common_file.common_yddj.yddj_yd + "' and fjbh='" + old_fjbh + "' and ddsj='" + M_Ffjzt.yd_ddsj.ToString() + "' and lksj='" + M_Ffjzt.yd_lksj.ToString() + "'"); if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0) { lsbh0 = ds_temp.Tables[0].Rows[0]["lsbh"].ToString(); shlf0 = common_file.common_fjzt.Islf(lsbh0); //判断是否联房 shts0 = common_file.common_fjzt.Ists(lsbh0); //判断是否特殊 shvip0 = common_file.common_fjzt.IsVIP(lsbh0); //判断是否VIP或会员 fjbm0 = common_file.common_fjzt.Isbm(lsbh0); krxm0 = ds_temp.Tables[0].Rows[0]["krxm"].ToString(); sktt0 = ds_temp.Tables[0].Rows[0]["sktt"].ToString(); lsbh0 = ds_temp.Tables[0].Rows[0]["lsbh"].ToString(); zyzt_second0 = common_file.common_fjzt.ydf; yd_ddsj0 = DateTime.Parse(ds_temp.Tables[0].Rows[0]["ddsj"].ToString()); yd_lksj0 = DateTime.Parse(ds_temp.Tables[0].Rows[0]["lksj"].ToString()); } Ffjzt_add_edit_new.Ffjzt_xgft(common_file.common_fjzt.zf, zyzt_second0, common_file.common_fjzt.ff, old_fjbh, krxm0, DateTime.Parse(common_file.common_app.cssj), DateTime.Parse(common_file.common_app.cssj), yd_ddsj0, yd_lksj0, shlf0, shts0, shvip0, fjbm0, sktt0, lsbh0, czsj, czy, common_file.common_fjzt.ff, xxzs); s = common_file.common_app.get_suc; } return(s); }
/// <summary> /// 改房态时修改预订的初始值 /// </summary> /// <param name="zyzt"></param> /// <param name="fjbh"></param> /// <param name="ddsj"></param> /// <param name="lksj"></param> /// <param name="czsj"></param> /// <param name="cznr"></param> /// <param name="czy"></param> /// <param name="xxzs"></param> /// <returns></returns> public string set_yd_ft(string zyzt, string fjbh, DateTime ddsj, DateTime lksj, string czsj, string cznr, string czy, string xxzs) { string s = common_file.common_app.get_failure; string krxm0 = ""; string sktt0 = ""; string lsbh0 = ""; string zyzt_second0 = ""; DateTime yd_ddsj0 = DateTime.Parse(common_file.common_app.cssj); DateTime yd_lksj0 = DateTime.Parse(common_file.common_app.cssj); bool shlf0 = false; bool shts0 = false; bool shvip0 = false; bool fjbm0 = false; BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt(); DataSet ds_temp = B_Ffjzt.GetList("fjbh='" + fjbh + "'"); if (ds_temp.Tables[0].Rows.Count > 0) { Model.Ffjzt M_Ffjzt = B_Ffjzt.GetModel(int.Parse(ds_temp.Tables[0].Rows[0]["id"].ToString())); //设置初始值 set_fj_value(out krxm0, out sktt0, out lsbh0, out zyzt_second0, out yd_ddsj0, out yd_lksj0, out shlf0, out shts0, out shvip0, out fjbm0, "fjbh='" + fjbh + "' and ddsj='" + M_Ffjzt.yd_ddsj + "' and lksj='" + M_Ffjzt.yd_lksj + "'"); Ffjzt_xgft(zyzt, M_Ffjzt.zyzt_second, M_Ffjzt.zybz, M_Ffjzt.fjbh, krxm0, ddsj, lksj, M_Ffjzt.yd_ddsj, M_Ffjzt.yd_lksj, shlf0, shts0, shvip0, fjbm0, sktt0, lsbh0, DateTime.Parse(czsj), czy, cznr, xxzs); s = common_file.common_app.get_suc; } ds_temp.Dispose(); return(s); }
/// <summary> /// 用来删除主单或退房时单据的删除和修改房态及备份相应记录 /// </summary> /// <param name="id"></param> /// <param name="czzt"></param>两个值,一个是删除“sc”,一个是结账"jz" /// <param name="czbz"></param>主要是两个值,一个是“取消”,一个“未到”到common_yddj里去找 /// <param name="qxyy"></param>取消原因 /// <param name="jzbh"></param> /// <param name="czy"></param> /// <param name="czsj"></param> /// <param name="xxzs"></param> /// <returns></returns> public string delete_sz_xgft(string id, string czzt, string czbz, string qxyy, string jzbh, string czy, string czsj, string xxzs) { int i_temp = 8;//用来M_Qskyd_mainrecord =NULL时判断 string s = common_file.common_app.get_failure; BLL.Qskyd_mainrecord B_Qskyd_mainrecord = new Hotel_app.BLL.Qskyd_mainrecord(); Model.Qskyd_mainrecord M_Qskyd_mainrecord = new Hotel_app.Model.Qskyd_mainrecord(); BLL.Qskyd_mainrecord_new B_Qskyd_mainrecord_new = new Hotel_app.BLL.Qskyd_mainrecord_new(); BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt(); Model.Ffjzt M_Ffjzt = new Hotel_app.Model.Ffjzt(); BLL.Qskyd_fjrb B_Qskyd_fjrb = new Hotel_app.BLL.Qskyd_fjrb(); Model.Qskyd_fjrb M_Qskyd_fjrb = new Hotel_app.Model.Qskyd_fjrb(); BLL.Common B_Common = new Hotel_app.BLL.Common(); if (id != "") { DataSet DS_temp; M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModel(int.Parse(id)); //判断预订的记录有两条房类时删除同一个主单避免出错 if (M_Qskyd_mainrecord == null) { i_temp = 9; } else { DS_temp = B_Qskyd_fjrb.GetList(" lsbh='" + M_Qskyd_mainrecord.lsbh + "'"); string fjbh_temp = ""; if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0) { //fjbh_temp = DS_temp.Tables[0].Rows[0]["fjbh"].ToString(); for (int k_0 = 0; k_0 < DS_temp.Tables[0].Rows.Count; k_0++) { if (DS_temp.Tables[0].Rows[k_0]["fjbh"].ToString() != "") { fjbh_temp = DS_temp.Tables[0].Rows[k_0]["fjbh"].ToString(); } } s = common_file.common_app.get_suc; if (fjbh_temp != "") { DS_temp = B_Ffjzt.GetList(" fjbh='" + fjbh_temp + "'"); if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0) { M_Ffjzt = B_Ffjzt.GetModel(int.Parse(DS_temp.Tables[0].Rows[0]["id"].ToString())); //修改房态,把在住房改成脏房后,再判断是否有两个主单共用一个房间如有再把它改成在住. if (M_Qskyd_mainrecord.yddj == common_file.common_yddj.yddj_dj) { s = common_file.common_app.get_failure; //改成脏房 Ffjzt.Fgj_z_yj_zzzf Fgj_z_yj_zzzf_new = new Hotel_app.Server.Ffjzt.Fgj_z_yj_zzzf(); s = Fgj_z_yj_zzzf_new.set_gj_zf_yj_zzzf_qxzz(M_Ffjzt.id.ToString(), M_Qskyd_mainrecord.yydh, M_Qskyd_mainrecord.qymc, M_Ffjzt.fjbh, "zf", czy, DateTime.Parse(czsj), xxzs); //是否有两个主单共用一个房间如有再把它改成在住. DS_temp = B_Qskyd_fjrb.GetList(" fjbh='" + fjbh_temp + "' and yddj='" + common_file.common_yddj.yddj_dj + "' and lsbh<>'" + M_Qskyd_mainrecord.lsbh + "'"); if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0) { s = common_file.common_app.get_failure; Qyddj.Qskyd_fjrb_add_edit_delete Qskyd_fjrb_add_edit_delete_new = new Qskyd_fjrb_add_edit_delete(); M_Qskyd_fjrb = B_Qskyd_fjrb.GetModel(int.Parse(DS_temp.Tables[0].Rows[0]["id"].ToString())); Qskyd_fjrb_add_edit_delete_new.add_fjbh_dj_fjzt(fjbh_temp, M_Qskyd_fjrb, DateTime.Parse(czsj), czy, xxzs); //把入住房数改成1 B_Common.ExecuteSql("update Qskyd_fjrb set lzfs=1,czsj='" + DateTime.Now.ToString() + "',shsc=0 where lsbh='" + DS_temp.Tables[0].Rows[0]["lsbh"].ToString() + "'"); s = common_file.common_app.get_suc; } } else if (M_Qskyd_mainrecord.yddj == common_file.common_yddj.yddj_yd) { s = common_file.common_app.get_failure; //清除预订 Qyddj.Qskyd_fjrb_add_edit_delete Qskyd_fjrb_add_edit_delete_new = new Qskyd_fjrb_add_edit_delete(); s = Qskyd_fjrb_add_edit_delete_new.clear_old_yd_fjzt(fjbh_temp, M_Qskyd_mainrecord.ddsj, M_Qskyd_mainrecord.lksj, DateTime.Parse(czsj), czy, xxzs); //是否有两个主单共用一个房间如有再把它改成预订. DS_temp = B_Qskyd_fjrb.GetList(" fjbh='" + fjbh_temp + "' and yddj='" + common_file.common_yddj.yddj_yd + "' and lsbh<>'" + M_Qskyd_mainrecord.lsbh + "' and ddsj>='" + DateTime.Now.Date.ToString() + "' and ddsj<'" + DateTime.Now.Date.AddDays(1) + "'"); if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0) { s = common_file.common_app.get_failure; Qskyd_fjrb_add_edit_delete_new.add_fjbh_yd_fjzt(M_Qskyd_fjrb.lsbh, fjbh_temp, M_Qskyd_fjrb.sktt, DateTime.Parse(czsj), czy, xxzs); //把入住房数改成1 B_Common.ExecuteSql("update Qskyd_fjrb set lzfs=1,czsj='" + DateTime.Now.ToString() + "',shsc=0 where lsbh='" + DS_temp.Tables[0].Rows[0]["lsbh"].ToString() + "'"); s = common_file.common_app.get_suc; } } } } } //DS_temp.Dispose(); if (s == common_file.common_app.get_suc) { s = common_file.common_app.get_failure; //清除入住记录 int strid = int.Parse(id); //common_file.common_Qskyd_mainrecord.PlInter(int.Parse(id), "删除"); B_Qskyd_mainrecord_new.Pladd(strid, czbz, qxyy, czy, czsj, czzt, jzbh);//删除前批量添加到备份表里 M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModel(strid); if (M_Qskyd_mainrecord != null) { //为了避免触发器成批删除时只触发最后一条,删除两次 B_Common.ExecuteSql("delete from Qskyd_mainrecord where lsbh='" + M_Qskyd_mainrecord.lsbh + "' and main_sec='" + common_file.common_app.main_sec_main + "'"); B_Common.ExecuteSql("delete from Qskyd_mainrecord where lsbh='" + M_Qskyd_mainrecord.lsbh + "' and main_sec<>'" + common_file.common_app.main_sec_main + "'"); } //if (B_Qskyd_mainrecord.Delete(strid) == true) //{ s = common_file.common_app.get_suc; //} } } if (i_temp == 9) { s = common_file.common_app.get_suc; } } return(s); }
/// <summary> /// 修改干净、脏房、已洁房、在住脏房、取消在住脏房 /// </summary> /// <param name="id"></param> /// <param name="yydh"></param> /// <param name="qymc"></param> /// <param name="fjbh"></param> /// <param name="xgzt"></param>"干净gj","脏zf","已洁yj","在住脏zzzf","取消在住脏qxzz" /// <param name="add_edit_delete"></param> /// <param name="xxzs"></param> /// <returns></returns> public string set_gj_zf_yj_zzzf_qxzz(string id, string yydh, string qymc, string fjbh, string xgzt, string czy, DateTime czsj, string xxzs) { string s = common_file.common_app.get_failure; BLL.Common B_Common = new Hotel_app.BLL.Common(); BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt(); //common_file.common_czjl common_czjl_new = new Hotel_app.common_file.common_czjl(); Model.Ffjzt M_Ffjzt = B_Ffjzt.GetModel(int.Parse(id)); string update_s = ""; switch (xgzt) { case "gj": if (M_Ffjzt.zyzt == common_file.common_fjzt.wxf || M_Ffjzt.zyzt == common_file.common_fjzt.qtf) { B_Common.ExecuteSql("delete from Fwx_other where fjbh='" + fjbh + "' and ddsj='" + M_Ffjzt.ddsj.ToString() + "' and lksj='" + M_Ffjzt.lksj.ToString() + "'"); } update_s = "update Ffjzt set zyzt='" + common_file.common_fjzt.gjf + "',lsbh='',krxm='',sktt='',zybz='',zyzt_second='',shlf=0,shts=0,shvip=0,fjbm=0,yd_ddsj='" + common_file.common_app.cssj + "',yd_lksj='" + common_file.common_app.cssj + "',ddsj='" + common_file.common_app.cssj + "',lksj='" + common_file.common_app.cssj + "',czy='" + czy + "',cznr='" + "修改房态-干净房" + "',czsj='" + DateTime.Now.ToString() + "' where id='" + id + "' and zyzt_second<>'" + common_file.common_fjzt.ydf + "'"; if (B_Common.ExecuteSql(update_s) > 0) { common_file.common_czjl.add_czjl(yydh, qymc, czy, "修改房间状态" + M_Ffjzt.zyzt + "-" + common_file.common_fjzt.gjf, fjbh, "", czsj); s = common_file.common_app.get_suc; } update_s = "update Ffjzt set zyzt='" + common_file.common_fjzt.gjf + "',ddsj='" + common_file.common_app.cssj + "',lksj='" + common_file.common_app.cssj + "',czy='" + czy + "',cznr='" + "修改房态-干净房" + "',czsj='" + DateTime.Now.ToString() + "' where id='" + id + "' and zyzt_second='" + common_file.common_fjzt.ydf + "'"; if (B_Common.ExecuteSql(update_s) > 0) { common_file.common_czjl.add_czjl(yydh, qymc, czy, "修改房间状态" + M_Ffjzt.zyzt + "-" + common_file.common_fjzt.gjf, fjbh, "", czsj); s = common_file.common_app.get_suc; } break; case "zf": if (M_Ffjzt.zyzt == common_file.common_fjzt.wxf || M_Ffjzt.zyzt == common_file.common_fjzt.qtf) { B_Common.ExecuteSql("delete from Fwx_other where fjbh='" + fjbh + "' and ddsj='" + M_Ffjzt.ddsj.ToString() + "' and lksj='" + M_Ffjzt.lksj.ToString() + "'"); } update_s = "update Ffjzt set zyzt='" + common_file.common_fjzt.zf + "',lsbh='',krxm='',sktt='',zybz='',zyzt_second='',shlf=0,shts=0,shvip=0,fjbm=0,yd_ddsj='" + common_file.common_app.cssj + "',yd_lksj='" + common_file.common_app.cssj + "',ddsj='" + common_file.common_app.cssj + "',lksj='" + common_file.common_app.cssj + "',czy='" + czy + "',cznr='" + "修改房态-脏房" + "',czsj='" + DateTime.Now.ToString() + "' where id='" + id + "' and zyzt_second<>'" + common_file.common_fjzt.ydf + "'"; if (B_Common.ExecuteSql(update_s) > 0) { common_file.common_czjl.add_czjl(yydh, qymc, czy, "修改房间状态" + M_Ffjzt.zyzt + "-" + common_file.common_fjzt.zf, fjbh, "", czsj); s = common_file.common_app.get_suc; } update_s = "update Ffjzt set zyzt='" + common_file.common_fjzt.zf + "',zybz='" + "" + "',ddsj='" + common_file.common_app.cssj + "',lksj='" + common_file.common_app.cssj + "',czy='" + czy + "',cznr='" + "修改房态-脏房" + "',czsj='" + DateTime.Now.ToString() + "' where id='" + id + "' and zyzt_second='" + common_file.common_fjzt.ydf + "'"; if (B_Common.ExecuteSql(update_s) > 0) { common_file.common_czjl.add_czjl(yydh, qymc, czy, "修改房间状态" + M_Ffjzt.zyzt + "-" + common_file.common_fjzt.zf, fjbh, "", czsj); s = common_file.common_app.get_suc; } break; case "yj": update_s = "update Ffjzt set zybz='" + common_file.common_fjzt.yjf + "',czy='" + czy + "',cznr='" + "修改房态-已洁房" + "',czsj='" + DateTime.Now.ToString() + "' where id='" + id + "'"; if (B_Common.ExecuteSql(update_s) > 0) { common_file.common_czjl.add_czjl(yydh, qymc, czy, "设置已洁房", fjbh, "", czsj); s = common_file.common_app.get_suc; } break; case "zzzf": update_s = "update Ffjzt set zybz='" + common_file.common_fjzt.yjf + "',czy='" + czy + "',cznr='" + "修改房态-在住脏房" + "',czsj='" + DateTime.Now.ToString() + "' where id='" + id + "'"; if (B_Common.ExecuteSql(update_s) > 0) { common_file.common_czjl.add_czjl(yydh, qymc, czy, "设置在住脏房", fjbh, "", czsj); s = common_file.common_app.get_suc; } break; case "qxzz": update_s = "update Ffjzt set zybz='" + "" + "',czy='" + czy + "',cznr='" + "修改房态-取消在住脏房" + "',czsj='" + DateTime.Now.ToString() + "' where id='" + id + "'"; if (B_Common.ExecuteSql(update_s) > 0) { common_file.common_czjl.add_czjl(yydh, qymc, czy, "取消在住脏房", fjbh, "", czsj); s = common_file.common_app.get_suc; } break; case "lszyf": update_s = "update Ffjzt set zybz='" + common_file.common_fjzt.lszy + "',czy='" + czy + "',cznr='" + "修改房态-临时占用房" + "',czsj='" + DateTime.Now.ToString() + "' where id='" + id + "'"; if (B_Common.ExecuteSql(update_s) > 0) { common_file.common_czjl.add_czjl(yydh, qymc, czy, "设置临时占用房", fjbh, "", czsj); s = common_file.common_app.get_suc; } break; case "qxlszyf": update_s = "update Ffjzt set zybz='" + "" + "',czy='" + czy + "',cznr='" + "修改房态-取消临时占用房" + "',czsj='" + DateTime.Now.ToString() + "' where id='" + id + "'"; if (B_Common.ExecuteSql(update_s) > 0) { common_file.common_czjl.add_czjl(yydh, qymc, czy, "取消临时占用房", fjbh, "", czsj); s = common_file.common_app.get_suc; } break; } return(s); }