예제 #1
0
        //房态修改时要判断这些值是否要重新加载
        public void set_fj_value(out string krxm0, out string sktt0, out string lsbh0, out string zyzt_second0, out DateTime yd_ddsj0, out DateTime yd_lksj0, out bool shlf0, out bool shts0, out bool shvip0, out bool fjbm0, string sel_condition)
        {
            DataSet ds_temp;

            BLL.Qskyd_fjrb B_Qskyd_fjrb = new Hotel_app.BLL.Qskyd_fjrb();
            krxm0        = ""; sktt0 = ""; lsbh0 = "";
            zyzt_second0 = "";
            yd_ddsj0     = DateTime.Parse(common_file.common_app.cssj);
            yd_lksj0     = DateTime.Parse(common_file.common_app.cssj);
            shlf0        = false; shts0 = false; shvip0 = false; fjbm0 = false;
            ds_temp      = B_Qskyd_fjrb.GetList(sel_condition);
            if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
            {
                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();
                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);
                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());
            }
            ds_temp.Dispose();
        }
예제 #2
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);
        }
예제 #3
0
        public static bool Isbm(string lsbh)//房价是否保密
        {
            bool sflf = false;

            BLL.Qskyd_fjrb B_Qskyd_fjrb = new Hotel_app.BLL.Qskyd_fjrb();
            DataSet        ds           = B_Qskyd_fjrb.GetList("lsbh='" + lsbh + "' and fjbm='" + common_app.fjbm_bm + "'");

            if (ds.Tables[0].Rows.Count > 0)
            {
                sflf = true;
            }
            else
            {
                sflf = false;
            }

            return(sflf);
        }
예제 #4
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);
        }
예제 #5
0
 private void BindData()
 {
     if (this.lsbh != "" && sk_tt == "sk")
     {
         //登记,散客
         string temp = "lsbh in (select  lsbh from Flfsz  where  shlz=1  and   lfbh in (select lfbh from Flfsz where lsbh='" + lsbh + "' and yydh='" + common_file.common_app.yydh;
         ds_temp = B_common.GetList("  select  * from  Qskyd_fjrb ", " lsbh in (select  lsbh from Flfsz  where lfbh in (select lfbh from Flfsz where lsbh='" + lsbh + "' and yydh='" + common_file.common_app.yydh + "'   and  shlz='1'     )  and  shlz='1')");
         if (ds_temp.Tables[0].Rows.Count == 0)
         {
             ds_temp = B_Qskyd_fjrb.GetList("id>=0   " + common_file.common_app.yydh_select + "  and  lsbh='" + this.lsbh + "'");
         }
     }
     if (this.lsbh != "" && sk_tt == "tt")
     {
         // ds_temp = B_Qttyd_mainrecord.GetList("id>=0 " + common_file.common_app.yydh_select + "  and lsbh='" + lsbh + "'");
         BLL.Common B_common = new Hotel_app.BLL.Common();
         ds_temp = B_common.GetList("  select  *   from  View_Qskzd ", "  id>=0  and  yydh='" + common_file.common_app.yydh + "'  and  ddbh  in (select ddbh from Qttyd_mainrecord   where  yydh='" + common_file.common_app.yydh + "'  and lsbh='" + lsbh + "')");
     }
     if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
     {
         ds_jzgl.DataSource = ds_temp.Tables[0];
         dg_jzgl.DataSource = ds_jzgl;
     }
 }
예제 #6
0
        public string Qskyd_fjrb_add_edit_delete_app_1(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_temp             = new Hotel_app.BLL.Qskyd_fjrb();
            Model.Qskyd_fjrb     M_Qskyd_fjrb       = new Hotel_app.Model.Qskyd_fjrb();
            Ffjzt.Flfsz_add_edit Flfsz_add_edit_new = new Hotel_app.Server.Ffjzt.Flfsz_add_edit();
            BLL.Common           B_Common           = new Hotel_app.BLL.Common();
            DataSet ds = new DataSet();
            int     id_temp = 0; int id_temp2 = 0;
            int     j_temp = 1;
            string  lsbh_News = "";
            string  ddbh_News = "";
            string  lfbh_News = ""; int i_1 = 0;
            string  old_fjbh = "";

            BLL.Flfsz   B_flfsz = new Hotel_app.BLL.Flfsz();
            Model.Flfsz M_flfsz = new Hotel_app.Model.Flfsz();
            //if (sktt == common_file.common_sktt.sktt_sk || sktt == common_file.common_sktt.sktt_cz)
            {
                #region 预订新增房间类型
                //1.新增有房号的主单
                //2.修改新增主单里的房类信息把fjbh加进去并把lzfs设为1.
                //3.设置联房,要先去查看原来的临时编号有没有存在联房,有就不再重新生成联房编号,直接修改。
                //4.修改fjrb表,把没有房号的LZFS扣除1同时加到联房里,再修改现有主单里的房类信息

                if (add_edit_delete == common_file.common_app.get_add)
                {
                    if (yddj == common_file.common_yddj.yddj_yd)
                    {
                        if (lzfs > 1 && fjbh != "")
                        {
                            //新增客人主单
                            ds = B_Qskyd_mainrecord.GetList("lsbh='" + lsbh + "'");
                            if (ds != null && ds.Tables[0].Rows.Count > 0)
                            {
                                M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModel(Convert.ToInt32(ds.Tables[0].Rows[0]["id"].ToString()));

                                lsbh_News = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                                ddbh_News = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                                s         = common_file_server.Common_pl_Qskyd_mainRecord_add.Pladd(yydh, qymc, lsbh, lsbh_News, ddbh_News, czy, czsj.ToString(), "", "");//根据lsbh读起主单信息,添加一条有房号的记录。

                                if (s == common_file.common_app.get_suc)
                                {
                                    s = common_file.common_app.get_failure;
                                    //修改新增主单里的房类信息把fjbh加进去并把lzfs设为1.

                                    ds = B_temp.GetList("lsbh='" + lsbh_News + "'");
                                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                                    {
                                        Model.Qskyd_fjrb M_temp = B_temp.GetModel(Convert.ToInt32(ds.Tables[0].Rows[0]["id"]));
                                        M_temp.fjbh   = fjbh;
                                        M_temp.fjrb   = fjrb;
                                        M_temp.fjjg   = fjjg;
                                        M_temp.sjfjjg = sjfjjg;
                                        M_temp.yh     = yh;
                                        M_temp.yhbl   = yhbl;
                                        M_temp.shqh   = shqh;
                                        M_temp.bz     = bz;
                                        M_temp.lzfs   = 1;
                                        M_temp.fjbm   = fjbm;
                                        M_temp.jcje   = jcje;
                                        if (B_temp.Update(M_temp))
                                        {
                                            Qskyd_fjrb_add_edit_delete_new.add_fjbh_yd_fjzt(M_temp.lsbh, M_temp.fjbh, M_temp.sktt, czsj, czy, xxzs);



                                            #region 当前主单以前没有联房过()
                                            if (B_flfsz.GetModelList("lsbh='" + lsbh + "'").Count == 0)
                                            {
                                                //生成新的联房编号
                                                lfbh_News = common_file.common_ddbh.ddbh("lf", "lfdate", "lfcounter", 6);

                                                s = Flfsz_add_edit_new.Flfsz_add_edit_delete("", yydh, qymc, lfbh_News, lsbh_News, fjbh, krxm, sktt, yddj, czy, czsj.ToString(), common_file.common_app.shlz, common_file.common_app.get_add, xxzs);


                                                if (s == common_file.common_app.get_suc)
                                                {
                                                    //主单增加到联房,增加新的一条无房号的记录到fjrb表
                                                    lzfs = lzfs - 1;
                                                    if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id.ToString(), yydh, qymc, lsbh, krxm, sktt, yddj, fjrb, "", ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, DateTime.Now, cznr, zyzt, common_file.common_app.get_add, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                                    {
                                                        //新增临时编号到联房里面

                                                        string  fjbh_0  = "";
                                                        DataSet DS_temp = B_Common.GetList("select fjbh from Qskyd_fjrb", "lsbh='" + lsbh + "' and fjbh<>''");
                                                        if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
                                                        {
                                                            fjbh_0 = DS_temp.Tables[0].Rows[0]["fjbh"].ToString();
                                                        }

                                                        s = Flfsz_add_edit_new.Flfsz_add_edit_delete("", yydh, qymc, lfbh_News, lsbh, fjbh_0, krxm, sktt, yddj, czy, czsj.ToString(), common_file.common_app.shlz, common_file.common_app.get_add, xxzs);


                                                        //M_flfsz.yydh = yydh;
                                                        //M_flfsz.qymc = qymc;
                                                        //M_flfsz.lsbh = lsbh;
                                                        //M_flfsz.fjbh = "";
                                                        //M_flfsz.lfbh = lfbh_News;
                                                        //M_flfsz.krxm = krxm;
                                                        //M_flfsz.sktt = sktt;
                                                        //M_flfsz.yddj = yddj;
                                                        //M_flfsz.czy = czy;
                                                        //M_flfsz.czsj = czsj;
                                                        //if (B_flfsz.Add(M_flfsz) > 0)
                                                        //{
                                                        //    s = common_file.common_app.get_suc;
                                                        //}
                                                        //else
                                                        //{
                                                        //    return s;
                                                        //}
                                                    }
                                                    else
                                                    {
                                                        return(s);
                                                    }
                                                }
                                                else
                                                {
                                                    return(s);
                                                }
                                            }
                                            #endregion

                                            #region 当前主单有联房过
                                            else
                                            {
                                                //直接把新增的一条加到联房表,fjbh不存在的一条不管
                                                lfbh_News = B_flfsz.GetModelList("lsbh='" + lsbh + "'")[0].lfbh;

                                                s = Flfsz_add_edit_new.Flfsz_add_edit_delete("", yydh, qymc, lfbh_News, lsbh_News, fjbh, krxm, sktt, yddj, czy, czsj.ToString(), common_file.common_app.shlz, common_file.common_app.get_add, xxzs);
                                                if (s == common_file.common_app.get_suc)
                                                {
                                                    //主单增加到联房,增加新的一条无房号的记录到fjrb表
                                                    lzfs = lzfs - 1;
                                                    if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id.ToString(), yydh, qymc, lsbh, krxm, sktt, yddj, fjrb, "", ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, DateTime.Now, cznr, zyzt, common_file.common_app.get_add, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                                    {
                                                        s = common_file.common_app.get_suc;
                                                    }
                                                    else
                                                    {
                                                        return(s);
                                                    }
                                                }
                                                else
                                                {
                                                    return(s);
                                                }
                                            }
                                            #endregion
                                        }
                                        else
                                        {
                                            return(s);
                                        }
                                    }
                                }
                                else
                                {
                                    return(s);
                                }
                            }
                        }//if (lzfs > 1 && fjbh != "")
                        else
                        {
                            j_temp = 1;
                            //如果原来已经有等一条已经排房的记录,新的(增加修改记录)房型一样且如果仍为1时的情况
                            if (B_temp.GetModelList("lsbh='" + lsbh + "' and fjrb='" + fjrb + "' and fjbh<>'' ").Count > 0)
                            {
                                j_temp = 3;
                            }
                            if (j_temp != 3)
                            {
                                //如果原来已经有等一条已经排房的记录,新的(增加修改记录)房型如果不一样且如果仍为1时的情况
                                #region 判断当前的临时编号对应的lzfs是否为1,并在fjrb表有多条记录的时候
                                if (B_temp.GetModelList("lsbh='" + lsbh + "' and fjrb<>'" + fjrb + "' and fjrb<>'' ").Count > 0)
                                {
                                    j_temp = 3;
                                }
                                #endregion

                                #region 只有一条记录的时候,直接修改fjrb,并加到联房表
                                else
                                {
                                    if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id.ToString(), yydh, qymc, lsbh, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, cznr, zyzt, add_edit_delete, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                    {
                                        s = common_file.common_app.get_suc;
                                    }
                                    else
                                    {
                                        return(s);
                                    }
                                }
                            }
                            if (j_temp == 3)//输入房数为1时的判断,且原来有记录的情况
                            {
                                if (fjbh != "")
                                {
                                    //找到当前房间类型为1,而且还没有排房号的那条记录
                                    //M_Qskyd_fjrb = B_temp.GetModelList("lsbh='" + lsbh + "' and  fjrb='" + fjrb + "'  and  lzfs=1  and fjbh=''")[0];
                                    //得到主单的信息:
                                    lsbh_News = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                                    ddbh_News = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                                    //通过当前的主单信息新增一条新的记录
                                    if (common_file_server.Common_pl_Qskyd_mainRecord_add.Pladd(yydh, qymc, lsbh, lsbh_News, ddbh_News, czy, czsj.ToString(), "", "") == common_file.common_app.get_suc)
                                    {
                                        #region //修改fjrb表里当前生成这条记录的房间信息
                                        id_temp2 = GetModel("", lsbh_News).id;
                                        if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id_temp2.ToString(), yydh, qymc, lsbh_News, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, "自动新增", zyzt, common_file.common_app.get_edit, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                        {
                                            if (lf_GetResult(lsbh, qymc, lsbh_News, yydh, fjbh, krxm, sktt, yddj, czy, czsj, xxzs))
                                            {
                                                s = common_file.common_app.get_suc;
                                            }
                                        }
                                        #endregion
                                    }
                                }
                                else
                                {
                                    if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id.ToString(), yydh, qymc, lsbh, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, cznr, zyzt, add_edit_delete, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                    {
                                        s = common_file.common_app.get_suc;
                                    }
                                    else
                                    {
                                        return(s);
                                    }
                                }
                            }



                            #endregion
                        }
                    }
                }
                #endregion
                #region 预订修改房间类型
                else
                if (add_edit_delete == common_file.common_app.get_edit)
                {
                    if (yddj == common_file.common_yddj.yddj_yd)
                    {
                        #region  新增主单lzfs > 1 && fjbh != ""

                        if (lzfs > 1 && fjbh != "")
                        {
                            //新增主单
                            //修改新增主单里的房类信息
                            //设置联房,要先去查看原来的临时编号有没有存在联房,有就不再重新生成联房编号

                            //把没有房号的LZFS扣除1同里加到联房里,再修改现有主单里的房类信息

                            ds = B_Qskyd_mainrecord.GetList("lsbh='" + lsbh + "'");
                            if (ds != null && ds.Tables[0].Rows.Count > 0)
                            {
                                M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModel(Convert.ToInt32(ds.Tables[0].Rows[0]["id"].ToString()));

                                lsbh_News = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                                ddbh_News = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);

                                s = common_file_server.Common_pl_Qskyd_mainRecord_add.Pladd(yydh, qymc, lsbh, lsbh_News, ddbh_News, czy, czsj.ToString(), "", "");

                                if (s == common_file.common_app.get_suc)
                                {
                                    s = common_file.common_app.get_failure;
                                    //修改新增主单里的房类信息把fjbh加进去
                                    ds = B_temp.GetList("lsbh='" + lsbh_News + "'");
                                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                                    {
                                        //修改新增主单的Qskyd_fjrb表的fjbh并加到联房
                                        Model.Qskyd_fjrb M_temp = B_temp.GetModel(Convert.ToInt32(ds.Tables[0].Rows[0]["id"]));
                                        M_temp.fjbh   = fjbh;
                                        M_temp.fjrb   = fjrb;
                                        M_temp.fjjg   = fjjg;
                                        M_temp.sjfjjg = sjfjjg;
                                        M_temp.yh     = yh;
                                        M_temp.yhbl   = yhbl;
                                        M_temp.shqh   = shqh;
                                        M_temp.bz     = bz;
                                        M_temp.lzfs   = 1;
                                        M_temp.fjbm   = fjbm;
                                        M_temp.jcje   = jcje;
                                        //M_temp.id=Convert.ToInt32(ds.Tables[0].Rows[0]["id"]);
                                        #region                                                                       //以前没有联房的处理节
                                        if (B_flfsz.GetModelList("lsbh='" + lsbh + "'").Count == 0)                   //以前没有联房
                                        {
                                            lfbh_News = common_file.common_ddbh.ddbh("lf", "lfdate", "lfcounter", 6); //

                                            s = Flfsz_add_edit_new.Flfsz_add_edit_delete("", yydh, qymc, lfbh_News, lsbh_News, fjbh, krxm, sktt, yddj, czy, czsj.ToString(), common_file.common_app.shlz, common_file.common_app.get_add, xxzs);



                                            //增加到联房,修改新增的主单fjrb表里的fjbh并把lzfs-1;并增加到联房)

                                            if (B_temp.Update(M_temp) && s == common_file.common_app.get_suc)
                                            {
                                                Qskyd_fjrb_add_edit_delete_new.add_fjbh_yd_fjzt(M_temp.lsbh, M_temp.fjbh, M_temp.sktt, czsj, czy, xxzs);



                                                ds  = B_temp.GetList("lsbh='" + lsbh + "'  and  fjrb='' and id='" + id.ToString() + "'");
                                                i_1 = 5;
                                                if (ds != null && ds.Tables[0].Rows.Count > 0)
                                                {
                                                    i_1 = 6;
                                                }
                                                else
                                                {
                                                    i_1 = 5;
                                                    ds  = B_temp.GetList("lsbh='" + lsbh + "'  and  fjrb<>''  and id='" + id.ToString() + "'");
                                                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                                                    {
                                                        if (ds.Tables[0].Rows[0]["fjrb"].ToString() == fjrb)
                                                        {
                                                            i_1 = 5;
                                                        }
                                                        else
                                                        {
                                                            i_1 = 7;
                                                        }
                                                    }
                                                }


                                                if (ds != null && ds.Tables[0].Rows.Count > 0)
                                                {
                                                    id_temp      = Convert.ToInt32(ds.Tables[0].Rows[0]["id"]);
                                                    M_Qskyd_fjrb = B_temp.GetModel(id_temp);
                                                }

                                                if (i_1 == 5 || i_1 == 6 || i_1 == 7)
                                                {
                                                    M_Qskyd_fjrb.lzfs = lzfs - 1;
                                                    M_Qskyd_fjrb.czy  = czy;
                                                    M_Qskyd_fjrb.czsj = DateTime.Now;
                                                    M_Qskyd_fjrb.cznr = common_file.common_app.get_edit;
                                                    if (i_1 == 6 || i_1 == 7)
                                                    {
                                                        M_Qskyd_fjrb.fjrb = fjrb;
                                                        if (i_1 == 6)
                                                        {
                                                            M_Qskyd_fjrb.shqh   = shqh;
                                                            M_Qskyd_fjrb.fjjg   = fjjg;  //decimal.Parse(common_file.common_get_fjjg.get_fjjg(fjrb));
                                                            M_Qskyd_fjrb.sjfjjg = sjfjjg;
                                                            M_Qskyd_fjrb.yh     = yh;
                                                            M_Qskyd_fjrb.yhbl   = yhbl;
                                                            M_Qskyd_fjrb.bz     = bz;
                                                            M_Qskyd_fjrb.fjbm   = fjbm;
                                                            M_Qskyd_fjrb.bz     = bz;
                                                        }
                                                    }
                                                }
                                                if (B_temp.Update(M_Qskyd_fjrb))     //无房间编号的房类主单也加到联房表里面
                                                {
                                                    s = Flfsz_add_edit_new.Flfsz_add_edit_delete("", yydh, qymc, lfbh_News, lsbh, "", krxm, sktt, yddj, czy, czsj.ToString(), common_file.common_app.shlz, common_file.common_app.get_add, xxzs);
                                                }
                                                else
                                                {
                                                    return(s);
                                                }
                                            }
                                            else
                                            {
                                                return(s);
                                            }
                                        }

                                        #endregion

                                        #region 以前有联房
                                        else
                                        {
                                            //读出联房信息
                                            lfbh_News = B_flfsz.GetModelList("lsbh='" + lsbh + "'")[0].lfbh;
                                            //将新增主单加到联房表里面  同时  修改新增的一条fjrb表里面的信息
                                            M_Qskyd_fjrb = B_temp.GetModelList("lsbh='" + lsbh_News + "'")[0];
                                            //相同信息
                                            M_Qskyd_fjrb.fjrb = fjrb;
                                            M_Qskyd_fjrb.fjbh = fjbh;
                                            M_Qskyd_fjrb.cznr = common_file.common_app.get_edit;
                                            M_Qskyd_fjrb.czsj = DateTime.Now;
                                            M_Qskyd_fjrb.lzfs = 1;
                                            M_Qskyd_fjrb.fjjg = fjjg;
                                            M_Qskyd_fjrb.yh   = yh;
                                            M_Qskyd_fjrb.yhbl = yhbl;
                                            M_Qskyd_fjrb.shqh = shqh;
                                            M_Qskyd_fjrb.bz   = bz;
                                            M_Qskyd_fjrb.fjbm = fjbm;
                                            M_Qskyd_fjrb.jcje = jcje;


                                            s = Flfsz_add_edit_new.Flfsz_add_edit_delete("", yydh, qymc, lfbh_News, lsbh_News, fjbh, krxm, sktt, yddj, czy, czsj.ToString(), common_file.common_app.shlz, common_file.common_app.get_add, xxzs);



                                            if (s == common_file.common_app.get_suc && B_temp.Update(M_Qskyd_fjrb))
                                            {
                                                Qskyd_fjrb_add_edit_delete_new.add_fjbh_yd_fjzt(M_Qskyd_fjrb.lsbh, M_Qskyd_fjrb.fjbh, M_Qskyd_fjrb.sktt, czsj, czy, xxzs);


                                                //修改原来的fjrb表的信息

                                                //M_Qskyd_fjrb = B_temp.GetModelList("lsbh='" + lsbh + "' and fjrb='" + fjrb + "'")[0];

                                                M_Qskyd_fjrb        = B_temp.GetModel(int.Parse(id));
                                                M_Qskyd_fjrb.id     = int.Parse(id);
                                                M_Qskyd_fjrb.lzfs   = lzfs - 1;
                                                M_Qskyd_fjrb.fjrb   = fjrb;
                                                M_Qskyd_fjrb.fjjg   = fjjg;
                                                M_Qskyd_fjrb.sjfjjg = sjfjjg;
                                                M_Qskyd_fjrb.yh     = yh;
                                                M_Qskyd_fjrb.yhbl   = yhbl;
                                                M_Qskyd_fjrb.shqh   = shqh;
                                                M_Qskyd_fjrb.bz     = bz;
                                                M_Qskyd_fjrb.fjbm   = fjbm;
                                                M_Qskyd_fjrb.jcje   = jcje;
                                                if (B_temp.Update(M_Qskyd_fjrb))
                                                {
                                                    s = common_file.common_app.get_suc;
                                                }
                                                else
                                                {
                                                    return(s);
                                                }
                                            }
                                            else
                                            {
                                                return(s);
                                            }
                                        }
                                        #endregion
                                    }
                                }
                                else
                                {
                                    return(s);
                                }
                            }
                        }
                        #endregion


                        else
                        {
                            #region 判断当前的临时编号对应的lzfs是否为1,并在fjrb表有多条记录的时候

                            DataSet DS_temp_1;
                            DS_temp_1 = B_temp.GetList("id='" + id + "'");
                            if (DS_temp_1 != null && DS_temp_1.Tables[0].Rows.Count > 0)
                            {
                                old_fjbh = DS_temp_1.Tables[0].Rows[0]["fjbh"].ToString();
                            }
                            j_temp = 1;
                            //如果原来已经有等一条已经排房的记录,新的(增加修改记录)房型一样且如果仍为1时的情况
                            if (B_temp.GetModelList("lsbh='" + lsbh + "' and fjrb='" + fjrb + "' and fjbh<>'' ").Count > 0)
                            {
                                j_temp = 3;
                            }
                            if (j_temp != 3)
                            {
                                if (B_temp.GetModelList("lsbh='" + lsbh + "' and fjrb<>'" + fjrb + "' and fjrb<>'' ").Count > 0)
                                {
                                    j_temp = 3;

                                    if (old_fjbh == "" && fjbh != "")
                                    {
                                        if (B_temp.GetModelList("lsbh='" + lsbh + "' and fjrb<>'" + fjrb + "' and fjrb<>'' and fjbh='' ").Count > 0)
                                        {
                                            j_temp = 1;
                                        }
                                    }
                                }
                                #endregion
                                #region 只有一条记录的时候,直接修改fjrb,并加到联房表
                                else
                                {
                                    if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id.ToString(), yydh, qymc, lsbh, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, cznr, zyzt, add_edit_delete, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                    {
                                        s = common_file.common_app.get_suc;
                                    }
                                    else
                                    {
                                        return(s);
                                    }
                                }
                                #endregion
                            }

                            if (old_fjbh != "")
                            {
                                j_temp = 1;
                            }
                            if (j_temp == 3)
                            {
                                if (fjbh != "")
                                {
                                    //找到当前房间类型为1,而且还没有排房号的那条记录
                                    //M_Qskyd_fjrb = B_temp.GetModelList("lsbh='" + lsbh + "' and  fjrb='" + fjrb + "'  and  lzfs=1  and fjbh=''")[0];
                                    //得到主单的信息:
                                    lsbh_News = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                                    ddbh_News = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                                    //通过当前的主单信息新增一条新的记录
                                    if (common_file_server.Common_pl_Qskyd_mainRecord_add.Pladd(yydh, qymc, lsbh, lsbh_News, ddbh_News, czy, czsj.ToString(), "", "") == common_file.common_app.get_suc)
                                    {
                                        #region     //修改fjrb表里当前生成这条记录的房间信息
                                        id_temp2 = GetModel("", lsbh_News).id;
                                        if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id_temp2.ToString(), yydh, qymc, lsbh_News, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, "自动新增", zyzt, common_file.common_app.get_edit, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                        {
                                            //修改成功后,把当前原来fjrb表里面对应的那条记录删除
                                            if (GetModel(fjrb, lsbh) != null)
                                            {
                                                id_temp2 = int.Parse(id);
                                                if (B_temp.Delete(id_temp2))
                                                {
                                                    //删除对应记录成功后,把新生成的记录加到联房里
                                                    #region 判断当前的lsbh在不在在联房表里面,然后做相应处理
                                                    if (lf_GetResult(lsbh, qymc, lsbh_News, yydh, fjbh, krxm, sktt, yddj, czy, czsj, xxzs))
                                                    {
                                                        s = common_file.common_app.get_suc;
                                                    }
                                                    #endregion
                                                }
                                            }
                                        }
                                        #endregion
                                    }
                                }
                                else
                                {
                                    if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id.ToString(), yydh, qymc, lsbh, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, cznr, zyzt, add_edit_delete, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                    {
                                        s = common_file.common_app.get_suc;
                                    }
                                    else
                                    {
                                        return(s);
                                    }
                                }
                            }
                            else
                            {
                                if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id.ToString(), yydh, qymc, lsbh, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, cznr, zyzt, add_edit_delete, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                {
                                    s = common_file.common_app.get_suc;
                                }
                            }
                        }
                    }    //if (yddj == common_file.common_yddj.yddj_yd)
                    else
                    if (yddj == common_file.common_yddj.yddj_dj)
                    {
                        if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id.ToString(), yydh, qymc, lsbh, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, cznr, zyzt, add_edit_delete, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                        {
                            s = common_file.common_app.get_suc;
                        }
                        else
                        {
                            return(s);
                        }
                    }        //if (yddj == common_file.common_yddj.yddj_dj)
                }
                #endregion
                #region hy类型的时候
                else
                if (sktt == common_file.common_sktt.sktt_tt || sktt == common_file.common_sktt.sktt_hy)
                {
                    if (add_edit_delete == common_file.common_app.get_add)
                    {
                        if (yddj == common_file.common_yddj.yddj_yd)
                        {
                            //1.新增主单
                            //2.修改房类Qskyd_Fjrb表,把fjbh写进,lzfs设为1.
                            //3.修改没有带房号的临时编号lzfs减1
                        }
                    }
                    else
                    if (add_edit_delete == common_file.common_app.get_edit)
                    {
                    }
                }
                #endregion
            }
            ds.Dispose();
            return(s);
        }
예제 #7
0
        public string Qskdj_add_edit_delete(string id, string yydh,
                                            string qymc, string lsbh,
                                            string ddbh, string hykh,
                                            string hyrx, string krxm, string tlkr, string krgj,
                                            string krmz, string yxzj, string zjhm, string krxb,
                                            string krsr, string krdh, string krsj, string krEmail,
                                            string krdz, string krjg, string krdw, string krzy,
                                            string cxmd, string qzrx, string qzhm, string zjyxq,
                                            string tlyxq, string tjrq, string lzka, string krly,
                                            string xyh, string xydw, string xsy, string ddrx,
                                            string ddwz, string zyzt, string krrx, string kr_children,
                                            string ddsj, string lzts, string lksj, string qtyq, string czy,
                                            string czsj, string cznr, string sktt, string yddj,
                                            string main_sec, string yddj_rx,
                                            string syzd, string vip_type, string tsyq, string add_edit_delete, string xxzs, string ddly, string hykh_bz)
        {
            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 (add_edit_delete == common_file.common_app.get_add)
            {
                if (main_sec == common_file.common_app.main_sec_sec)
                {
                    M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModel(int.Parse(id));
                }
                M_Qskyd_mainrecord.yydh     = yydh;
                M_Qskyd_mainrecord.qymc     = qymc;
                M_Qskyd_mainrecord.syzd     = syzd;
                M_Qskyd_mainrecord.lsbh     = lsbh;
                M_Qskyd_mainrecord.ddbh     = ddbh;
                M_Qskyd_mainrecord.hykh     = hykh;
                M_Qskyd_mainrecord.hyrx     = hyrx;
                M_Qskyd_mainrecord.krxm     = krxm;
                M_Qskyd_mainrecord.tlkr     = tlkr;
                M_Qskyd_mainrecord.krgj     = krgj;
                M_Qskyd_mainrecord.krmz     = krmz;
                M_Qskyd_mainrecord.yxzj     = yxzj;
                M_Qskyd_mainrecord.zjhm     = zjhm;
                M_Qskyd_mainrecord.krxb     = krxb;
                M_Qskyd_mainrecord.krsr     = Convert.ToDateTime(krsr);
                M_Qskyd_mainrecord.krdh     = krdh;
                M_Qskyd_mainrecord.krsj     = krsj;
                M_Qskyd_mainrecord.krEmail  = krEmail;
                M_Qskyd_mainrecord.krdz     = krdz;
                M_Qskyd_mainrecord.krjg     = krjg;
                M_Qskyd_mainrecord.krdw     = krdw;
                M_Qskyd_mainrecord.krzy     = krzy;
                M_Qskyd_mainrecord.cxmd     = cxmd;
                M_Qskyd_mainrecord.qzrx     = qzrx;
                M_Qskyd_mainrecord.qzhm     = qzhm;
                M_Qskyd_mainrecord.zjyxq    = Convert.ToDateTime(zjyxq);
                M_Qskyd_mainrecord.tlyxq    = Convert.ToDateTime(tlyxq);
                M_Qskyd_mainrecord.tjrq     = Convert.ToDateTime(tjrq);
                M_Qskyd_mainrecord.czy      = czy;
                M_Qskyd_mainrecord.czsj     = Convert.ToDateTime(czsj);
                M_Qskyd_mainrecord.cznr     = cznr;
                M_Qskyd_mainrecord.main_sec = main_sec;
                M_Qskyd_mainrecord.vip_type = vip_type;
                M_Qskyd_mainrecord.hykh_bz  = hykh_bz;
                M_Qskyd_mainrecord.krrx     = krrx;
                string krrx_0 = get_htk(krxm, zjhm);
                if (krrx_0 != "")
                {
                    M_Qskyd_mainrecord.krrx = krrx_0;
                }
                if (main_sec == common_file.common_app.main_sec_main)
                {
                    M_Qskyd_mainrecord.lzka = lzka;

                    M_Qskyd_mainrecord.krly = krly;
                    if (krly == "")
                    {
                        string krly_0 = get_hy(hykh);
                        if (krly_0 != "")
                        {
                            M_Qskyd_mainrecord.krly = krly_0;
                        }
                    }
                    M_Qskyd_mainrecord.xyh         = xyh;
                    M_Qskyd_mainrecord.xydw        = xydw;
                    M_Qskyd_mainrecord.xsy         = xsy;
                    M_Qskyd_mainrecord.ddrx        = ddrx;
                    M_Qskyd_mainrecord.ddwz        = ddwz;
                    M_Qskyd_mainrecord.zyzt        = zyzt;
                    M_Qskyd_mainrecord.kr_children = Convert.ToInt32(kr_children);
                    M_Qskyd_mainrecord.ddsj        = Convert.ToDateTime(ddsj);
                    M_Qskyd_mainrecord.lzts        = Convert.ToInt32(lzts);
                    M_Qskyd_mainrecord.lksj        = Convert.ToDateTime(lksj);
                    M_Qskyd_mainrecord.qtyq        = qtyq;
                    M_Qskyd_mainrecord.sktt        = sktt;
                    M_Qskyd_mainrecord.yddj        = yddj;
                    M_Qskyd_mainrecord.tsyq        = tsyq;
                    M_Qskyd_mainrecord.ddly        = ddly;
                }
                B_Qskyd_mainrecord.Add(M_Qskyd_mainrecord);
                {
                    if (main_sec == common_file.common_app.main_sec_main)
                    {
                        Q_ff_xyxf Q_ff_xyxf_new = new Q_ff_xyxf();
                        Q_ff_xyxf_new.Qyddj_otherfee_add(yydh, qymc, lsbh, krxm, sktt, "", czy);
                    }
                }
                s = common_file.common_app.get_suc;
            }
            else if (add_edit_delete == common_file.common_app.get_edit)
            {
                //M_Qskyd_mainrecord.id = int.Parse(id);
                M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModel(int.Parse(id));
                DateTime ddsj_temp = M_Qskyd_mainrecord.ddsj;
                DateTime lksj_temp = M_Qskyd_mainrecord.lksj;
                string   krxm_temp = M_Qskyd_mainrecord.krxm;
                DataSet  DS_temp;
                string   fjbh_temp = "";
                DS_temp = B_Qskyd_fjrb.GetList("lsbh='" + M_Qskyd_mainrecord.lsbh + "'");
                if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
                {
                    fjbh_temp = DS_temp.Tables[0].Rows[0]["fjbh"].ToString();
                    if (fjbh_temp != "")
                    {
                        //这边要判断是否有一间房间,两个主单的情况,另外如抵离时间有变动,房态里的抵离时间也要跟着变动
                        if (yddj == common_file.common_yddj.yddj_yd)
                        {
                            if (ddsj_temp != DateTime.Parse(ddsj))
                            {
                                //清除
                                if (ddsj_temp >= DateTime.Now.Date && ddsj_temp < DateTime.Now.Date.AddDays(1))
                                {
                                    //清除预订
                                    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);
                                }


                                B_Common.ExecuteSql("update Qskyd_mainrecord set ddsj='" + ddsj + "',shsc=0,czsj='" + czsj + "' where lsbh in(select lsbh from View_Qskzd where fjbh='" + fjbh_temp + "' and ddsj='" + ddsj_temp + "' and lksj='" + lksj_temp + "')");
                                //B_Common.ExecuteSql("update Qskyd_fjrb set ddsj='" + ddsj + "',shsc=0,czsj='" + czsj + "' where lsbh in(select lsbh from View_Qskzd where fjbh='" + fjbh_temp + "' and ddsj='" + ddsj_temp + "' and lksj='" + lksj_temp + "')");
                                //判断新的预订是否要改房态
                                if (DateTime.Parse(ddsj) >= DateTime.Now.Date && DateTime.Parse(ddsj) < DateTime.Now.Date.AddDays(1))
                                {
                                    Qyddj.Qskyd_fjrb_add_edit_delete Qskyd_fjrb_add_edit_delete_new = new Qskyd_fjrb_add_edit_delete();
                                    Qskyd_fjrb_add_edit_delete_new.add_fjbh_yd_fjzt(M_Qskyd_mainrecord.lsbh, fjbh_temp, M_Qskyd_mainrecord.sktt, DateTime.Parse(czsj), czy, xxzs);
                                }
                            }
                            if (lksj_temp != DateTime.Parse(lksj))
                            {
                                string s_temp = "update Qskyd_mainrecord set lksj='" + lksj + "',shsc=0,czsj='" + czsj + "' where lsbh in(select lsbh from View_Qskzd where fjbh='" + fjbh_temp + "' and ddsj='" + ddsj + "' and lksj='" + lksj_temp + "')";
                                B_Common.ExecuteSql(s_temp);
                                //B_Common.ExecuteSql("update Qskyd_fjrb set lksj='" + lksj + "',shsc=0,czsj='" + czsj + "' where lsbh in(select lsbh from View_Qskzd where fjbh='" + fjbh_temp + "' and ddsj='" + ddsj_temp + "' and lksj='" + lksj_temp + "')");
                                s_temp = "update Ffjzt set yd_lksj='" + lksj + "',czsj='" + DateTime.Now.ToString() + "' where fjbh='" + fjbh_temp + "' and yd_ddsj='" + ddsj + "' and yd_lksj='" + lksj_temp + "'";
                                B_Common.ExecuteSql(s_temp);
                            }
                        }
                        else
                        if (yddj == common_file.common_yddj.yddj_dj)
                        {
                            if (lksj_temp != DateTime.Parse(lksj))
                            {
                                B_Common.ExecuteSql("update Qskyd_mainrecord set lksj='" + lksj + "',shsc=0,czsj='" + czsj + "' where lsbh in(select lsbh from View_Qskzd where fjbh='" + fjbh_temp + "' and ddsj='" + ddsj_temp + "' and lksj='" + lksj_temp + "')");
                                // B_Common.ExecuteSql("update Qskyd_fjrb set lksj='" + lksj + "',shsc=0,czsj='" + czsj + "' where lsbh in(select lsbh from View_Qskzd where fjbh='" + fjbh_temp + "' and ddsj='" + ddsj_temp + "' and lksj='" + lksj_temp + "')");
                                B_Common.ExecuteSql("update Ffjzt set lksj='" + lksj + "',czsj='" + DateTime.Now.ToString() + "' where fjbh='" + fjbh_temp + "' and ddsj='" + ddsj_temp + "' and lksj='" + lksj_temp + "'");
                            }
                        }
                    }
                }
                DS_temp.Dispose();
                M_Qskyd_mainrecord.yydh = yydh;
                M_Qskyd_mainrecord.qymc = qymc;
                M_Qskyd_mainrecord.lsbh = lsbh;
                M_Qskyd_mainrecord.ddbh = ddbh;
                M_Qskyd_mainrecord.hykh = hykh;
                M_Qskyd_mainrecord.hyrx = hyrx;
                M_Qskyd_mainrecord.krxm = krxm;
                M_Qskyd_mainrecord.tlkr = tlkr;
                M_Qskyd_mainrecord.krgj = krgj;
                M_Qskyd_mainrecord.krmz = krmz;
                M_Qskyd_mainrecord.yxzj = yxzj;
                M_Qskyd_mainrecord.zjhm = zjhm;
                M_Qskyd_mainrecord.krxb = krxb;
                M_Qskyd_mainrecord.krsr = Convert.ToDateTime(krsr);
                M_Qskyd_mainrecord.krdh = krdh;
                if (M_Qskyd_mainrecord.ddyy != common_file.common_app.ydzx_flag)
                {
                    M_Qskyd_mainrecord.xsy  = xsy;
                    M_Qskyd_mainrecord.xyh  = xyh;
                    M_Qskyd_mainrecord.xydw = xydw;
                    M_Qskyd_mainrecord.krly = krly;
                }
                //if(M_Qskyd_mainrecord.ddyy != common_file.common_app.ydzx_flage&&M_Qskyd_mainrecord.krly != common_file.common_app.krly_xydw_flage)
                //{
                //    M_Qskyd_mainrecord.xsy = xsy;
                // }

                M_Qskyd_mainrecord.krsj    = krsj;
                M_Qskyd_mainrecord.krEmail = krEmail;
                M_Qskyd_mainrecord.krdz    = krdz;
                M_Qskyd_mainrecord.krjg    = krjg;
                M_Qskyd_mainrecord.krdw    = krdw;
                M_Qskyd_mainrecord.krzy    = krzy;
                M_Qskyd_mainrecord.cxmd    = cxmd;
                M_Qskyd_mainrecord.qzrx    = qzrx;
                M_Qskyd_mainrecord.qzhm    = qzhm;
                M_Qskyd_mainrecord.zjyxq   = Convert.ToDateTime(zjyxq);
                M_Qskyd_mainrecord.tlyxq   = Convert.ToDateTime(tlyxq);
                M_Qskyd_mainrecord.tjrq    = Convert.ToDateTime(tjrq);
                M_Qskyd_mainrecord.lzka    = lzka;

                if (krly == "")
                {
                    string krly_0 = get_hy(hykh);
                    if (krly_0 != "")
                    {
                        M_Qskyd_mainrecord.krly = krly_0;
                    }
                }


                M_Qskyd_mainrecord.ddrx = ddrx;
                M_Qskyd_mainrecord.ddwz = ddwz;
                M_Qskyd_mainrecord.zyzt = zyzt;
                M_Qskyd_mainrecord.krrx = krrx;
                string krrx_0 = get_htk(krxm, zjhm);
                if (krrx_0 != "")
                {
                    M_Qskyd_mainrecord.krrx = krrx_0;
                }
                M_Qskyd_mainrecord.kr_children = Convert.ToInt32(kr_children);

                if (M_Qskyd_mainrecord.yddj != common_file.common_yddj.yddj_dj)
                {
                    M_Qskyd_mainrecord.ddsj = Convert.ToDateTime(ddsj);
                }

                M_Qskyd_mainrecord.lzts = Convert.ToInt32(lzts);
                M_Qskyd_mainrecord.lksj = Convert.ToDateTime(lksj);
                M_Qskyd_mainrecord.qtyq = qtyq;
                M_Qskyd_mainrecord.czy  = czy;
                M_Qskyd_mainrecord.czsj = Convert.ToDateTime(czsj);
                M_Qskyd_mainrecord.cznr = cznr;
                //M_Qskyd_mainrecord.sktt = sktt;
                //M_Qskyd_mainrecord.yddj = yddj;
                //M_Qskyd_mainrecord.main_sec = main_sec;
                M_Qskyd_mainrecord.vip_type = vip_type;
                M_Qskyd_mainrecord.tsyq     = tsyq;
                M_Qskyd_mainrecord.ddly     = ddly;
                M_Qskyd_mainrecord.hykh_bz  = hykh_bz;
                //common_file.common_Qskyd_mainrecord.PlInter(int.Parse(id), "修改");//删除前批量添加到备份表里
                B_Qskyd_mainrecord_new.Pladd(int.Parse(id), common_file.common_app.chinese_edit, "", czy, czsj, "xg", "");
                B_Qskyd_mainrecord.Update(M_Qskyd_mainrecord);
                fjbh_temp = "";
                string shlf_temp = "0";
                bool   shlf0     = common_file.common_fjzt.Islf(M_Qskyd_mainrecord.lsbh);
                if (shlf0 == true)
                {
                    shlf_temp = "1";
                }
                string shts_temp = "0";
                bool   shts0     = common_file.common_fjzt.Ists(M_Qskyd_mainrecord.lsbh);
                if (shts0 == true)
                {
                    shts_temp = "1";
                }
                string shvip_temp = "0";
                bool   shvip0     = common_file.common_fjzt.IsVIP(M_Qskyd_mainrecord.lsbh);
                if (shvip0 == true)
                {
                    shvip_temp = "1";
                }
                string fjbm_temp = "0";
                bool   fjbm0     = common_file.common_fjzt.Isbm(M_Qskyd_mainrecord.lsbh);
                if (fjbm0 == true)
                {
                    fjbm_temp = "1";
                }
                string krxm0 = M_Qskyd_mainrecord.krxm;
                if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
                {
                    fjbh_temp = DS_temp.Tables[0].Rows[0]["fjbh"].ToString();
                    if (yddj == common_file.common_yddj.yddj_dj)
                    {
                        B_Common.ExecuteSql("update Ffjzt set krxm='" + krxm0 + "',shlf='" + shlf_temp + "',shts='" + shts_temp + "',shvip='" + shvip_temp + "',fjbm='" + fjbm_temp + "',czsj='" + DateTime.Now.ToString() + "' where fjbh='" + fjbh_temp + "'");
                    }
                    else
                    if (yddj == common_file.common_yddj.yddj_yd)
                    {
                        B_Common.ExecuteSql("update Ffjzt set krxm='" + krxm0 + "',shlf='" + shlf_temp + "',shts='" + shts_temp + "',shvip='" + shvip_temp + "',fjbm='" + fjbm_temp + "',czsj='" + DateTime.Now.ToString() + "' where fjbh='" + fjbh_temp + "' and yd_ddsj='" + M_Qskyd_mainrecord.ddsj + "' and yd_lksj='" + M_Qskyd_mainrecord.lksj + "' and zyzt<>'" + common_file.common_fjzt.zzf + "'");
                    }
                }
                s = common_file.common_app.get_suc;
            }
            else if (add_edit_delete == common_file.common_app.get_delete)
            {
                s = delete_sz_xgft(id, "sc", cznr, qtyq, "", czy, czsj, xxzs);
                //通过qtyq传递取消原因过来
            }
            return(s);
        }
예제 #8
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);
        }
예제 #9
0
 public void InitalApp(string _lsbh, string _sk_tt)
 {
     dg_tfinfo.AutoGenerateColumns = false;
     lsbh  = _lsbh;
     sk_tt = _sk_tt;
     //否则,明细去相应主单的bak里面找
     ds = B_sjzzd.GetList("  yydh='" + common_file.common_app.yydh + "'  and  lsbh='" + lsbh + "'");
     if (ds != null && ds.Tables[0].Rows.Count > 0)
     {
         if (sk_tt == "sk")
         {
             BLL.Qskyd_fjrb_bak B_Qskyd_fjrb_bak = new Hotel_app.BLL.Qskyd_fjrb_bak();
             ds_temp = B_Qskyd_fjrb_bak.GetList(" lsbh='" + lsbh + "'  and  yydh='" + common_file.common_app.yydh + "'");
             if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
             {
                 objsource.DataSource = ds_temp.Tables[0];
                 dg_tfinfo.DataSource = objsource;
             }
         }
         if (sk_tt == "tt")
         {
             BLL.Qttyd_mainrecord_bak B_Qttyd_mainrecord_bak = new Hotel_app.BLL.Qttyd_mainrecord_bak();
             ds_temp = B_Qttyd_mainrecord_bak.GetList("  lsbh='" + lsbh + "'  and yydh='" + common_file.common_app.yydh + "'");
             if (ds_temp != null && ds.Tables[0].Rows.Count > 0)
             {
                 string ddbh = ds_temp.Tables[0].Rows[0]["ddbh"].ToString();
                 ds_temp = B_common.GetList(" select  *  from  Qskyd_fjrb_bak ", " id>=0 and  yydh='" + common_file.common_app.yydh + "'  and  fjbh!=''  and    lsbh in  (select  lsbh   from  Qskyd_mainrecord_bak  where  id>=0  and yydh='" + common_file.common_app.yydh + "'  and   ddbh='" + ddbh + "')");
                 if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
                 {
                     objsource.DataSource = ds_temp.Tables[0];
                     dg_tfinfo.DataSource = objsource;
                 }
             }
         }
     }
     else//如果当前的lshb在sjzzd里面找不到,就说明是在住或者预定的类型
     {
         if (sk_tt == "sk")
         {
             BLL.Qskyd_fjrb B_Qskyd_fjrb = new Hotel_app.BLL.Qskyd_fjrb();
             ds_temp = B_Qskyd_fjrb.GetList(" lsbh='" + lsbh + "'  and  yydh='" + common_file.common_app.yydh + "'");
             if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
             {
                 objsource.DataSource = ds_temp.Tables[0];
                 dg_tfinfo.DataSource = objsource;
             }
         }
         if (sk_tt == "tt")
         {
             BLL.Qttyd_mainrecord B_Qttyd_mainrecord = new Hotel_app.BLL.Qttyd_mainrecord();
             ds_temp = B_Qttyd_mainrecord.GetList("  lsbh='" + lsbh + "'  and yydh='" + common_file.common_app.yydh + "'");
             if (ds_temp != null && ds.Tables[0].Rows.Count > 0)
             {
                 string         ddbh         = ds_temp.Tables[0].Rows[0]["ddbh"].ToString();
                 BLL.Qskyd_fjrb B_Qskyd_fjrb = new Hotel_app.BLL.Qskyd_fjrb();
                 ds_temp = B_Qskyd_fjrb.GetList(" ddbh='" + ddbh + "'  and  yydh='" + common_file.common_app.yydh + "'");
                 if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
                 {
                     objsource.DataSource = ds_temp.Tables[0];
                     dg_tfinfo.DataSource = objsource;
                 }
             }
         }
     }
 }