コード例 #1
0
        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);
        }
コード例 #2
0
        private string CheckFjStatus(string fjbh, string fjrb, out string Result)
        {
            string fjCanUse = common_file.common_app.get_failure; BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt();

            Result = "";
            DataSet Ds_temp = B_Ffjzt.GetList("id>=0 and yydh='" + common_file.common_app.yydh + "'  and fjbh='" + fjbh + "'  and fjrb='" + fjrb + "'");

            if (Ds_temp != null && Ds_temp.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < Ds_temp.Tables[0].Rows.Count; i++)
                {
                    fjCanUse = common_file.common_app.get_failure;
                    string zyzt = Ds_temp.Tables[0].Rows[i]["zyzt"].ToString();
                    if (zyzt == common_file.common_fjzt.gjf || zyzt == common_file.common_fjzt.zf)//为赃房或者干净房的时候是可以撤销的
                    {
                        fjCanUse = common_file.common_app.get_suc; continue;
                    }
                    else
                    {
                        Result += "[" + Ds_temp.Tables[0].Rows[i]["fjrb"].ToString() + "-" + Ds_temp.Tables[0].Rows[i]["fjbh"].ToString() + "当前的占用状态为:" + Ds_temp.Tables[0].Rows[i]["zyzt"].ToString() + "]  ";
                    }
                }
            }
            else
            {
                Result += "[" + fjrb + "-" + fjbh + "-" + "没有找到此房间,系统无法撤销 ]";
            }
            result_all += Result;
            return(fjCanUse);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        //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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        /// <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);
        }
コード例 #7
0
        /// <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);
        }
コード例 #8
0
        /// <summary>获得可用房
        ///
        /// </summary>
        /// <param name="DS_fjzt"></param>
        /// <param name="yd_dj"></param>
        /// <param name="ddsj_temp"></param>
        /// <param name="lksj_temp"></param>
        /// <param name="fjrb_temp"></param>
        /// <param name="is_lksj"></param>//是否包含离开时间包含true就不要排除当日预离房,如果不包含false就排除当日预离房
        ///<param name="is_contain_wx"></param>//是否包含维修(就是说维修时还可排给预订房,但在维修房绝对不能排给登记)TRUE维修房可用,FALSE维修房不能用

        public static void get_dataset_fjzt_canused(out DataSet DS_fjzt, string yd_dj, DateTime ddsj_temp, DateTime lksj_temp, string fjrb_temp, bool is_lksj, bool is_contain_wx)
        {
            BLL.Ffjzt B_Ffjzt = new Hotel_app.BLL.Ffjzt();
            string    select_strwhere = "(1=1)  ";
            string    ddsj_temp_0 = ddsj_temp.ToShortDateString();
            string    lksj_temp_0 = lksj_temp.ToShortDateString() + " " + "23:59:59";
            string    fjrb_fjbh_select = ""; string fjrb_fjbh_select_qtf = ""; string fjrb_fjbh = "";

            if (fjrb_temp.Trim() != "")
            {
                fjrb_fjbh            = " and (fjrb='" + fjrb_temp + "')";
                fjrb_fjbh_select     = " and (fjrb='" + fjrb_temp + "'  and  Zyzt ='" + common_file.common_fjzt.wxf + " ')"; //用于维修房
                fjrb_fjbh_select_qtf = "  and (fjrb='" + fjrb_temp + "' and  Zyzt='" + common_file.common_fjzt.qtf + "')";   //用于其它房(其它房不管是在预订还是在登记的时候都要排除掉)
            }
            string wx_select_condition = " and ((ddsj between '" + ddsj_temp_0 + "' and '" + lksj_temp_0 + "') or (ddsj<'" + ddsj_temp_0 + "' and lksj>'" + lksj_temp_0 + "')or (lksj between '" + ddsj_temp_0 + "' and '" + lksj_temp_0 + "'))";

            if (is_lksj == false)           //false 时离开时间也是不可用,但TRUE时离开那一天可用
            {
                if (is_contain_wx == false) //不可用的时候都加上这一条件
                {
                    select_strwhere  = " (fjbh not in(select fjbh  from Fwx_other where (id>=0" + common_app.yydh_select + ")" + wx_select_condition + fjrb_fjbh_select + " ))  and   ";
                    select_strwhere += "(fjbh not in(select fjbh from Qskyd_fjrb where (id>=0" + common_app.yydh_select + ")" + wx_select_condition + fjrb_fjbh + " ))";
                    if (yd_dj == common_file.common_yddj.yddj_dj)
                    {
                        select_strwhere += "and (zyzt!='" + common_file.common_fjzt.zzf + "')";
                    }
                }
                else
                {
                    if (yd_dj == common_file.common_yddj.yddj_dj)
                    {
                        select_strwhere  = " (fjbh not in(select fjbh  from Fwx_other where (id>=0" + common_app.yydh_select + ")" + wx_select_condition + fjrb_fjbh_select + " ))  and   ";
                        select_strwhere += "(fjbh not in(select fjbh from Qskyd_fjrb where (id>=0" + common_app.yydh_select + ")" + wx_select_condition + fjrb_fjbh + " ))";
                        select_strwhere += "and (zyzt<>'" + common_file.common_fjzt.zzf + "' and zyzt<>'" + common_file.common_fjzt.wxf + "' and zyzt<>'" + common_file.common_fjzt.qtf + "' and zybz<>'" + common_file.common_fjzt.lszy + "')";
                    }
                    else
                    {
                        select_strwhere += "  and  (fjbh not in(select fjbh from Qskyd_fjrb where (id>=0" + common_app.yydh_select + ")" + wx_select_condition + fjrb_fjbh + " ))";
                    }
                }
                select_strwhere += "  and   (fjbh not in(select fjbh from Fwx_other  Where (id>=0" + common_app.yydh_select + ")" + wx_select_condition + fjrb_fjbh_select_qtf + "))";
                if (fjrb_temp != "")
                {
                    select_strwhere += "  and  (fjrb='" + fjrb_temp + "')";
                }
                select_strwhere += "  order by zyzt , fjrb,fjbh";
                DS_fjzt          = B_Ffjzt.GetList(select_strwhere);
                return;
            }
            else//if (is_lksj == false)//false 时离开时间也是不可用,但TRUE时离开那一天可用
            {
                string dj_select_condition = "";
                //
                //dj_select_condition = " and ((CONVERT(varchar(10),ddsj, 120)  between '" + ddsj_temp_0 + "' and '" + lksj_temp_0 + "') or (CONVERT(varchar(10),ddsj, 120) <'" + ddsj_temp_0 + "' and  CONVERT(varchar(10),lksj, 120)>'" + lksj_temp_0 + "') or (CONVERT(varchar(10),lksj, 120) between '" + ddsj_temp_0 + "' and '" + lksj_temp_0 + "'))";
                string ddsj_cs = ddsj_temp.ToShortDateString();
                string ddsj_js = ddsj_temp.ToShortDateString() + " " + "23:59:59";
                string lksj_cs = lksj_temp.ToShortDateString();
                string lksj_js = lksj_temp.ToShortDateString() + " " + "23:59:59";
                if (ddsj_temp.ToShortDateString() != lksj_temp.ToShortDateString())
                {
                    dj_select_condition = " and (((ddsj between '" + ddsj_temp_0 + "' and '" + lksj_temp_0 + "') or (ddsj<'" + ddsj_temp_0 + "' and lksj>'" + lksj_temp_0 + "') or (lksj between '" + ddsj_temp_0 + "' and '" + lksj_temp_0 + "')) and             (lsbh not in (select lsbh from VIEW_Qfjrb_fs_tj where (ddsj between '" + lksj_cs + "' and '" + lksj_js + "' and lksj>='" + lksj_cs + "') or (lksj between '" + ddsj_cs + "' and '" + ddsj_js + "' and ddsj<='" + ddsj_js + "') ))         )";
                }
                else
                {
                    //dj_select_condition = " and (((ddsj between '" + ddsj_temp_0 + "' and '" + lksj_temp_0 + "') or (ddsj<'" + ddsj_temp_0 + "' and lksj>'" + lksj_temp_0 + "') or (lksj between '" + ddsj_temp_0 + "' and '" + lksj_temp_0 + "')) and             (lsbh not in (select lsbh from VIEW_Qfjrb_fs_tj where ((ddsj between '" + lksj_cs + "' and '" + lksj_js + "' and lksj>='" + lksj_cs + "') or (lksj between '" + ddsj_cs + "' and '" + ddsj_js + "' and ddsj<='" + ddsj_js + "'))   and  (CONVERT(varchar(10),ddsj, 120)=CONVERT(varchar(10),lksj, 120))  ))       )";
                    dj_select_condition = " and (((ddsj between '" + ddsj_temp_0 + "' and '" + lksj_temp_0 + "') or (ddsj<'" + ddsj_temp_0 + "' and lksj>'" + lksj_temp_0 + "') or (lksj between '" + ddsj_temp_0 + "' and '" + lksj_temp_0 + "')) and             (lsbh not in (select lsbh from VIEW_Qfjrb_fs_tj where ((ddsj between '" + lksj_cs + "' and '" + lksj_js + "' and lksj>='" + lksj_cs + "') or (lksj between '" + ddsj_cs + "' and '" + ddsj_js + "' and ddsj<='" + ddsj_js + "'))     ))       )";
                }
                //是否排除维修房
                if (is_contain_wx == false) //维修房不可用
                {
                    select_strwhere  = " (fjbh not in(select fjbh  from Fwx_other where (id>=0" + common_app.yydh_select + ")" + wx_select_condition + fjrb_fjbh_select + " ))";
                    select_strwhere += "  and (fjbh not in(select fjbh from Qskyd_fjrb where (id>=0" + common_app.yydh_select + ")" + dj_select_condition + fjrb_fjbh + " ))";
                    if (yd_dj == common_file.common_yddj.yddj_dj)
                    {
                        select_strwhere += "and (zyzt<>'" + common_file.common_fjzt.zzf + "')";
                    }
                }
                else
                {
                    if (yd_dj == common_file.common_yddj.yddj_dj)
                    {
                        select_strwhere  = " (fjbh not in(select fjbh  from Fwx_other where (id>=0" + common_app.yydh_select + ")" + wx_select_condition + fjrb_fjbh_select + " ))";
                        select_strwhere += "  and (fjbh not in(select fjbh from Qskyd_fjrb where (id>=0" + common_app.yydh_select + ")" + dj_select_condition + fjrb_fjbh + " ))";
                        select_strwhere += "and (zyzt<>'" + common_file.common_fjzt.zzf + "' and zyzt<>'" + common_file.common_fjzt.wxf + "' and zyzt<>'" + common_file.common_fjzt.qtf + "' and zybz<>'" + common_file.common_fjzt.lszy + "')";
                    }
                    else
                    {
                        select_strwhere += "  and (fjbh not in(select fjbh from Qskyd_fjrb where (id>=0" + common_app.yydh_select + ")" + dj_select_condition + fjrb_fjbh + " ))";
                    }
                }
                select_strwhere += "  and   (fjbh not in(select fjbh from Fwx_other  Where (id>=0" + common_app.yydh_select + ")" + wx_select_condition + fjrb_fjbh_select_qtf + "))";
                if (fjrb_temp != "")
                {
                    select_strwhere += "  and  (fjrb='" + fjrb_temp + "')";
                }
                select_strwhere += "  order by  zyzt, fjrb,fjbh";
                DS_fjzt          = B_Ffjzt.GetList(select_strwhere);
                return;
            }
        }
コード例 #9
0
        public string set_wx_other(int id, string yydh, string qymc, string lsbh, string fjrb, string fjbh, DateTime ddsj, DateTime lksj, string bz, string zyzt, string czy, string czsj, bool is_top, bool is_select, string add_edit_delete, string xxzs)
        {
            string   s        = common_file.common_app.get_failure;
            DateTime yd_ddsj0 = DateTime.Parse(common_file.common_app.cssj);
            DateTime yd_lksj0 = DateTime.Parse(common_file.common_app.cssj);

            BLL.Fwx_other  B_Fwx_other  = new Hotel_app.BLL.Fwx_other();
            BLL.Qskyd_fjrb B_Qskyd_fjrb = new Hotel_app.BLL.Qskyd_fjrb();
            BLL.Ffjzt      B_Ffjzt      = new Hotel_app.BLL.Ffjzt();

            Model.Fwx_other      M_Fwx_other        = new Hotel_app.Model.Fwx_other();
            Ffjzt.Ffjzt_add_edit Ffjzt_add_edit_new = new Hotel_app.Server.Ffjzt.Ffjzt_add_edit();
            if (add_edit_delete == common_file.common_app.get_add)
            {
                s = common_file.common_app.get_failure;
                M_Fwx_other.yydh      = yydh; M_Fwx_other.qymc = qymc; M_Fwx_other.lsbh = lsbh;
                M_Fwx_other.fjrb      = fjrb; M_Fwx_other.fjbh = fjbh; M_Fwx_other.ddsj = ddsj;
                M_Fwx_other.lksj      = lksj; M_Fwx_other.bz = bz; M_Fwx_other.zyzt = zyzt;
                M_Fwx_other.czy       = czy; M_Fwx_other.czsj = DateTime.Now; M_Fwx_other.cznr = common_file.common_app.chinese_add;
                M_Fwx_other.is_top    = false;
                M_Fwx_other.is_select = false;
                if (B_Fwx_other.Add(M_Fwx_other) > 0)
                {
                    s = common_file.common_app.get_suc;

                    if (ddsj >= DateTime.Now.Date && ddsj < DateTime.Now.Date.AddDays(1))
                    //当天维修才去修改房态
                    {
                        s = common_file.common_app.get_failure;
                        s = Ffjzt_add_edit_new.set_yd_ft(zyzt, fjbh, ddsj, lksj, czsj, "修改房态成" + zyzt, czy, xxzs);
                        s = common_file.common_app.get_suc;
                    }
                }
            }
            else
            if (add_edit_delete == common_file.common_app.get_edit)
            {
                s           = common_file.common_app.get_failure;
                M_Fwx_other = B_Fwx_other.GetModel(id);
                //先修改原来如果有占用房态的房间要先清除掉
                DateTime ddsj_temp = M_Fwx_other.ddsj;
                DateTime lksj_temp = M_Fwx_other.lksj;
                DataSet  ds_temp0  = B_Ffjzt.GetList("zyzt='" + zyzt + "' and ddsj='" + ddsj_temp.ToString() + "' and lksj='" + lksj_temp.ToString() + "'");
                if ((ddsj < DateTime.Now.Date || ddsj >= DateTime.Now.Date.AddDays(1)) && (ds_temp0.Tables[0].Rows.Count > 0))
                {
                    s = Ffjzt_add_edit_new.set_yd_ft(common_file.common_fjzt.zf, fjbh, DateTime.Parse(common_file.common_app.cssj), DateTime.Parse(common_file.common_app.cssj), czsj, zyzt + "自动修改房态成" + common_file.common_fjzt.zf, czy, xxzs);
                }
                ds_temp0.Dispose();
                M_Fwx_other.ddsj = ddsj;
                M_Fwx_other.lksj = lksj; M_Fwx_other.bz = bz; M_Fwx_other.zyzt = zyzt;
                M_Fwx_other.czy  = czy; M_Fwx_other.czsj = DateTime.Now; M_Fwx_other.cznr = common_file.common_app.chinese_edit;
                if (B_Fwx_other.Update(M_Fwx_other) == true)
                {
                    s = common_file.common_app.get_suc;

                    if ((ddsj >= DateTime.Now.Date && ddsj < DateTime.Now.Date.AddDays(1)))
                    //不能限制当天维修才去修改房态,因为有可能离开时间延长或变短了!
                    {
                        s = common_file.common_app.get_failure;
                        s = Ffjzt_add_edit_new.set_yd_ft(zyzt, fjbh, ddsj, lksj, czsj, "修改房态成" + zyzt, czy, xxzs);
                        s = common_file.common_app.get_suc;
                    }
                }
            }
            else
            if (add_edit_delete == common_file.common_app.get_delete)
            {
                s           = common_file.common_app.get_failure;
                M_Fwx_other = B_Fwx_other.GetModel(id);
                //先修改原来如果有占用房态的房间要先清除掉
                DateTime ddsj_temp = M_Fwx_other.ddsj;
                DateTime lksj_temp = M_Fwx_other.lksj;
                DataSet  ds_temp0  = B_Ffjzt.GetList("zyzt='" + zyzt + "' and fjbh='" + fjbh + "' and ddsj='" + ddsj_temp.ToString() + "' and lksj='" + lksj_temp.ToString() + "'");
                if ((ds_temp0.Tables[0].Rows.Count > 0))
                {
                    s = Ffjzt_add_edit_new.set_yd_ft(common_file.common_fjzt.zf, fjbh, DateTime.Parse(common_file.common_app.cssj), DateTime.Parse(common_file.common_app.cssj), czsj, zyzt + "自动修改房态成" + common_file.common_fjzt.zf, czy, xxzs);
                }
                ds_temp0.Dispose();
                B_Fwx_other.Delete(id);
                s = common_file.common_app.get_suc;
            }

            return(s);
        }
コード例 #10
0
        private void b_save_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if ((dT_ddsj_date.Value < DateTime.Today) && (judge_add_edit == common_file.common_app.get_add))
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "初始时间不能小于当天!");
            }
            else
            {
                if (DateTime.Parse(dT_lksj_date.Value.ToShortDateString() + " " + dT_lksj_time.Value.ToLongTimeString()) < DateTime.Parse(dT_ddsj_date.Value.ToShortDateString() + " " + dT_ddsj_time.Value.ToLongTimeString()))
                {
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, "结束时间不能小于操作时间!");
                }
                else
                {
                    if (common_file.common_used_fjzt.get_dataset_usedfjzt(zyzt, Convert.ToDateTime(dT_ddsj_date.Value.ToShortDateString() + " 00:00:00"), Convert.ToDateTime(dT_lksj_date.Value.ToShortDateString() + " 23:59:59"), tB_fjrb.Text.Trim(), tB_fjbh.Text.Trim(), tB_fjbh.Text.Trim(), Fwx_other_id, common_file.common_app.is_contain_wx) == false)
                    {
                        string   url  = common_file.common_app.service_url + "Ffjzt/Ffjzt_app.asmx";
                        object[] args = new object[16];
                        if (Fwx_other_id == "")
                        {
                            args[0] = 0;
                        }
                        else
                        {
                            args[0] = int.Parse(Fwx_other_id);
                        }
                        args[1]  = common_file.common_app.yydh;
                        args[2]  = common_file.common_app.qymc;
                        args[3]  = common_file.common_ddbh.ddbh("wxqt", "lfdate", "lfcounter", 3);
                        args[4]  = tB_fjrb.Text.Trim().Replace("'", "//");
                        args[5]  = tB_fjbh.Text.Trim().Replace("'", "//");
                        args[6]  = DateTime.Parse(dT_ddsj_date.Value.ToShortDateString());
                        args[7]  = DateTime.Parse(dT_lksj_date.Value.ToShortDateString() + " 23:59:59");
                        args[8]  = tB_bz.Text.Trim().Replace("'", "//");
                        args[9]  = zyzt;
                        args[10] = common_file.common_app.czy;
                        args[11] = DateTime.Now.ToString();
                        args[12] = false;
                        args[13] = false;
                        args[14] = judge_add_edit;
                        args[15] = common_file.common_app.xxzs;

                        Hotel_app.Server.Ffjzt.Fwx_other Fwx_other_services = new Hotel_app.Server.Ffjzt.Fwx_other();
                        string result = Fwx_other_services.set_wx_other(int.Parse(args[0].ToString()), args[1].ToString(), args[2].ToString(), args[3].ToString(), args[4].ToString(), args[5].ToString(), DateTime.Parse(args[6].ToString()), DateTime.Parse(args[7].ToString()), args[8].ToString(), args[9].ToString(), args[10].ToString(), args[11].ToString(), bool.Parse(args[12].ToString()), bool.Parse(args[13].ToString()), args[14].ToString(), args[15].ToString());
                        //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "set_wx_other", args);
                        if (result == common_file.common_app.get_suc)
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "保存成功!");
                            if (Fwx_other_browse_temp_app != null)
                            {
                                Fwx_other_browse_temp_app.refresh_app();
                            }
                            BLL.Ffjzt B_Ffjzt   = new Hotel_app.BLL.Ffjzt();
                            DataSet   ds_temp_0 = B_Ffjzt.GetList("fjbh='" + tB_fjbh.Text + "'");
                            if (ds_temp_0 != null && ds_temp_0.Tables[0].Rows.Count > 0)
                            {
                                if (ds_temp_0.Tables[0].Rows[0]["zyzt"].ToString() == common_file.common_fjzt.wxf || ds_temp_0.Tables[0].Rows[0]["zyzt"].ToString() == common_file.common_fjzt.qtf)
                                {
                                    if (Ffjzt.common_form.Ffjzt_pic_big_new != null)
                                    {
                                        if (Ffjzt.common_form.Ffjzt_pic_big_new.UC_room_pic_0_select != null)
                                        {
                                            common_file.common_room_state.room_state(Ffjzt.common_form.Ffjzt_pic_big_new.UC_room_pic_0_select, ds_temp_0, 0);
                                        }
                                    }
                                }
                            }
                            ds_temp_0.Dispose();
                            this.Close();
                        }
                        else
                        if (result.ToString() == common_file.common_app.get_failure)
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败!");
                        }
                    }
                }
                Cursor.Current = Cursors.Default;
            }
        }
コード例 #11
0
        /// <param name="zyzt"></param>//有三种状态,一种预订、一种登记、一种预订转登记

        public string Qskyd_fjrb_add_edit_delete_app(string id, string yydh, string qymc, string lsbh, string krxm, string sktt, string yddj, string fjrb, string fjbh, DateTime ddsj, DateTime lksj, Decimal lzfs, string shqh, decimal fjjg, decimal sjfjjg, string yh, decimal yhbl, string bz, string czy, DateTime czsj, string cznr, string zyzt, string add_edit_delete, string xxzs, string fjbm, decimal jcje)
        {
            string s = common_file.common_app.get_failure;

            BLL.Qskyd_fjrb   B_Qskyd_fjrb = new Hotel_app.BLL.Qskyd_fjrb();
            BLL.Common       B_Common = new Hotel_app.BLL.Common();
            BLL.Ffjzt        B_Ffjzt = new Hotel_app.BLL.Ffjzt();
            Model.Qskyd_fjrb M_Qskyd_fjrb = new Hotel_app.Model.Qskyd_fjrb();
            Model.Ffjzt      M_Ffjzt = new Hotel_app.Model.Ffjzt();
            string           old_fjbh = "";
            string           old_fjbm = "";
            DataSet          ds_temp = B_Ffjzt.GetList("fjbh='" + fjbh + "'");
            string           krxm0 = ""; string sktt0 = ""; string lsbh0 = "";
            bool             shlf0 = false; bool shts0 = false; bool shvip0 = false;

            if (add_edit_delete == common_file.common_app.get_add)
            {
                M_Qskyd_fjrb.bz     = bz;
                M_Qskyd_fjrb.cznr   = cznr;
                M_Qskyd_fjrb.czsj   = czsj;
                M_Qskyd_fjrb.czy    = czy;
                M_Qskyd_fjrb.ddsj   = ddsj;
                M_Qskyd_fjrb.fjbh   = fjbh;
                M_Qskyd_fjrb.fjjg   = fjjg;
                M_Qskyd_fjrb.fjrb   = fjrb;
                M_Qskyd_fjrb.krxm   = krxm;
                M_Qskyd_fjrb.lksj   = lksj;
                M_Qskyd_fjrb.lsbh   = lsbh;
                M_Qskyd_fjrb.lzfs   = lzfs;
                M_Qskyd_fjrb.qymc   = qymc;
                M_Qskyd_fjrb.shqh   = shqh;
                M_Qskyd_fjrb.sjfjjg = sjfjjg;
                M_Qskyd_fjrb.sktt   = sktt;
                M_Qskyd_fjrb.yddj   = yddj;
                M_Qskyd_fjrb.yh     = yh;
                M_Qskyd_fjrb.yhbl   = yhbl;
                M_Qskyd_fjrb.yydh   = yydh;
                M_Qskyd_fjrb.fjbm   = fjbm;
                M_Qskyd_fjrb.jcje   = jcje;
                int IsSuc = B_Qskyd_fjrb.Add(M_Qskyd_fjrb);
                if (IsSuc > 0)
                {
                    s = common_file.common_app.get_suc;
                    if (zyzt == common_file.common_yddj.yddj_dj)
                    {
                        if (fjbh != "")
                        {
                            s = add_fjbh_dj_fjzt(fjbh, M_Qskyd_fjrb, czsj, czy, xxzs);
                        }
                    }
                    else
                    if (zyzt == common_file.common_yddj.yddj_yd)
                    {
                        if (fjbh != "")
                        {
                            s = add_fjbh_yd_fjzt(lsbh, fjbh, sktt, czsj, czy, xxzs);
                        }
                    }
                }
            }
            else
            if (add_edit_delete == common_file.common_app.get_edit)
            {
                M_Qskyd_fjrb = B_Qskyd_fjrb.GetModel(int.Parse(id));
                if (M_Qskyd_fjrb != null)
                {
                    old_fjbh = M_Qskyd_fjrb.fjbh;      //根据Id读取旧的房间编号old_fjbh
                    string   old_fjjg   = M_Qskyd_fjrb.fjjg.ToString();
                    string   old_sjfjjg = M_Qskyd_fjrb.sjfjjg.ToString();
                    DateTime old_ddsj   = M_Qskyd_fjrb.ddsj;
                    DateTime old_lksj   = M_Qskyd_fjrb.lksj;
                    M_Qskyd_fjrb.fjrb   = fjrb;
                    M_Qskyd_fjrb.fjbh   = fjbh;
                    M_Qskyd_fjrb.lzfs   = lzfs;
                    M_Qskyd_fjrb.shqh   = shqh;
                    M_Qskyd_fjrb.fjjg   = fjjg;
                    M_Qskyd_fjrb.sjfjjg = sjfjjg;
                    M_Qskyd_fjrb.yh     = yh;
                    M_Qskyd_fjrb.yhbl   = yhbl;
                    M_Qskyd_fjrb.bz     = bz;
                    M_Qskyd_fjrb.czy    = czy;
                    M_Qskyd_fjrb.czsj   = czsj;
                    M_Qskyd_fjrb.cznr   = cznr;
                    M_Qskyd_fjrb.fjbm   = fjbm;
                    M_Qskyd_fjrb.jcje   = jcje;
                    if (B_Qskyd_fjrb.Update(M_Qskyd_fjrb))
                    {
                        if (zyzt == common_file.common_yddj.yddj_dj) //如果yddj等于登记
                        {
                            if (old_fjbh != fjbh)                    //如果旧房间编号不等于新的房间编号说明换房了
                            {
                                s = common_file.common_app.get_failure;

                                if (fjbh != "")    //先把新的房号的房态先修改进去
                                {
                                    s = add_fjbh_dj_fjzt(fjbh, M_Qskyd_fjrb, czsj, czy, xxzs);
                                }

                                if (old_fjbh != "")    //如果原来房间编号不为空读出相关客人信息,然后把这间房间改为脏房
                                {
                                    s = clear_old_dj_fjzt(old_fjbh, czsj, czy, xxzs);
                                }

                                if (old_fjbh != "")
                                {
                                    common_file.common_czjl.add_czjl(yydh, qymc, czy, "换房", "原来房号:" + old_fjbh, "换后房号:" + fjbh, czsj);
                                }
                            }
                            if (fjbm == common_file.common_app.fjbm_bm && fjbh != "")    //修改房价保密的判断
                            {
                                B_Common.ExecuteSql("update Ffjzt set fjbm=1,czsj='" + DateTime.Now.ToString() + "' where fjbh='" + fjbh + "' and fjbm=0");
                            }
                            else
                            if (fjbm != common_file.common_app.fjbm_bm && fjbh != "")
                            {
                                B_Common.ExecuteSql("update Ffjzt set fjbm=0,czsj='" + DateTime.Now.ToString() + "' where fjbh='" + fjbh + "' and fjbm=1");
                            }
                        }
                        else
                        if (zyzt == common_file.common_yddj.yddj_yd) //如果yddj等于预订
                        {
                            if (old_fjbh != fjbh)                    //如果旧房间编号不等于新的房间编号说明换房了
                            {
                                if (old_fjbh != "")                  //如果原来房间编号不为空读出相关客人信息,然后把这间房间改为原来的状态
                                {
                                    s = clear_old_yd_fjzt(old_fjbh, old_ddsj, old_lksj, czsj, czy, xxzs);
                                }
                                if (fjbh != "")        //现在的房号不为空--预订
                                {
                                    s = add_fjbh_yd_fjzt(lsbh, fjbh, sktt, czsj, czy, xxzs);
                                }
                            }
                            if (fjbm == common_file.common_app.fjbm_bm && fjbh != "")        //修改房价保密的判断
                            {
                                B_Common.ExecuteSql("update Ffjzt set fjbm=1,czsj='" + DateTime.Now.ToString() + "' where fjbh='" + fjbh + "' and fjbm=0 and zyzt<>'" + common_file.common_fjzt.zzf + "' and yd_ddsj='" + M_Qskyd_fjrb.ddsj.ToString() + "' and yd_lksj='" + M_Qskyd_fjrb.lksj.ToString() + "'");
                            }
                            else
                            if (fjbm != common_file.common_app.fjbm_bm && fjbh != "")
                            {
                                B_Common.ExecuteSql("update Ffjzt set fjbm=0,czsj='" + DateTime.Now.ToString() + "' where fjbh='" + fjbh + "' and fjbm=1 and zyzt<>'" + common_file.common_fjzt.zzf + "' and yd_ddsj='" + M_Qskyd_fjrb.ddsj.ToString() + "' and yd_lksj='" + M_Qskyd_fjrb.lksj.ToString() + "'");
                            }
                        }
                        else
                        if (zyzt == common_file.common_yddj.yddj_ydzdj)
                        {
                            DataSet DS_temp_1 = B_Common.GetList("select * from Ffjzt", "fjbh='" + fjbh + "' and zyzt_second='" + common_file.common_fjzt.ydf + "' and yd_ddsj='" + M_Qskyd_fjrb.ddsj + "' and yd_lksj='" + M_Qskyd_fjrb.lksj + "'");
                            if (DS_temp_1 != null && DS_temp_1.Tables[0].Rows.Count >= 0)
                            {
                                clear_old_yd_fjzt(M_Qskyd_fjrb.fjbh, old_ddsj, old_lksj, czsj, czy, xxzs);
                                if (old_ddsj.ToShortDateString() != czsj.ToShortDateString())
                                {
                                    if (DateTime.Parse(old_ddsj.ToShortDateString()) > DateTime.Parse(czsj.ToShortDateString()))
                                    {
                                        common_file.common_czjl.add_czjl(yydh, qymc, czy, zyzt, krxm + "_" + fjrb + "_" + fjbh + "_" + lsbh, "由" + old_ddsj.ToShortDateString() + "提前至" + czsj.ToShortDateString(), czsj);
                                    }
                                    else
                                    if (DateTime.Parse(old_ddsj.ToShortDateString()) < DateTime.Parse(czsj.ToShortDateString()))
                                    {
                                        common_file.common_czjl.add_czjl(yydh, qymc, czy, zyzt, krxm + "_" + fjrb + "_" + fjbh + "_" + lsbh, "由" + old_ddsj.ToShortDateString() + "推迟至" + czsj.ToShortDateString(), czsj);
                                    }
                                }
                            }
                            if (add_fjbh_dj_fjzt(fjbh, M_Qskyd_fjrb, czsj, czy, xxzs) == common_file.common_app.get_suc)
                            {
                                B_Common.ExecuteSql("update Ffjzt set ddsj='" + ddsj.ToString() + "' where fjbh='" + fjbh + "'");
                            }
                        }
                        if (M_Qskyd_fjrb.fjbh == "")
                        {
                            string s_0 = "update Qskyd_fjrb set fjjg='" + M_Qskyd_fjrb.fjjg.ToString() + "',sjfjjg='" + M_Qskyd_fjrb.sjfjjg.ToString() + "' , yh='" + M_Qskyd_fjrb.yh + "' , yhbl='" + M_Qskyd_fjrb.yhbl.ToString() + "',fjbm='" + M_Qskyd_fjrb.fjbm + "' where (fjrb='" + M_Qskyd_fjrb.fjrb + "' and fjbh<>'') and (fjjg='" + old_fjjg + "' and sjfjjg='" + old_sjfjjg + "') and (lsbh in(select lsbh from Qskyd_mainrecord where ddbh in(select ddbh from Qttyd_mainrecord where lsbh='" + M_Qskyd_fjrb.lsbh + "')))";
                            B_Common.ExecuteSql(s_0);
                        }
                        s = common_file.common_app.get_suc;
                        //以下对房态进行再次修改以保证房态会自动刷新
                        if (M_Qskyd_fjrb.yddj == common_file.common_yddj.yddj_dj)
                        {
                            B_Common.ExecuteSql("update Ffjzt set czsj='" + DateTime.Now.ToString() + "'");
                        }
                        else
                        if (M_Qskyd_fjrb.yddj == common_file.common_yddj.yddj_yd)
                        {
                            if (M_Qskyd_fjrb.ddsj > DateTime.Parse(DateTime.Now.ToShortDateString()) && M_Qskyd_fjrb.ddsj < DateTime.Parse(DateTime.Now.AddDays(1).ToShortDateString()))
                            {
                                B_Common.ExecuteSql("update Ffjzt set czsj='" + DateTime.Now.ToString() + "'");
                            }
                        }
                    }
                }
            }
            else
            if (add_edit_delete == common_file.common_app.get_delete)
            {
                if (id != "")
                {
                    String s_0 = "insert into Qskyd_fjrb_temp(yydh,qymc,lsbh,krxm,sktt,yddj,fjrb,fjbh,ddsj,lksj,lzfs,shqh,fjjg,sjfjjg,yh,yhbl,bz,is_top,is_select,shsc,czy,czsj,cznr,sdcz,fjbm,jcje)";
                    s_0 = s_0 + "select yydh,qymc,lsbh,krxm,sktt,yddj,fjrb,fjbh,ddsj,lksj,lzfs,shqh,fjjg,sjfjjg,yh,yhbl,bz,is_top,is_select,shsc,'" + czy + "','" + czsj + "','" + cznr + "',sdcz,fjbm,jcje from Qskyd_fjrb where id='" + id + "'";
                    if (B_Common.ExecuteSql(s_0) > 0)
                    {
                        if (B_Qskyd_fjrb.Delete(int.Parse(id)) == true)
                        {
                            common_file.common_czjl.add_czjl(yydh, qymc, czy, "强制删除多排" + lzfs + fjrb, krxm, lsbh, czsj);
                            s = common_file.common_app.get_suc;
                        }
                    }
                }
            }
            ds_temp.Dispose();
            return(s);
        }