Exemplo n.º 1
0
        //房间
        public string Ffjzt_add_edit_delete(string id, string yydh, string qymc, string jdlh, string jdlh_name, string jdcs, string jdcs_name, string fjrb, string fjrb_code, string fjbh, string fjdh, string dhfj, string bz, string add_edit_delete, string xxzs)
        {
            string s = common_file.common_app.get_failure;

            BLL.Ffjzt   B_Ffjzt     = new Hotel_app.BLL.Ffjzt();
            BLL.Ffjzt   B_Ffjzt_new = new Hotel_app.BLL.Ffjzt();
            Model.Ffjzt M_Ffjzt     = new Hotel_app.Model.Ffjzt();
            if (xxzs == common_file.common_app.xxzs_xxvalue)
            {
            }
            if (xxzs == common_file.common_app.xxzs_zsvalue)
            {
            }
            s = add_edit_delete;
            if (add_edit_delete == common_file.common_app.get_add)
            {
                M_Ffjzt.yydh        = yydh; M_Ffjzt.qymc = qymc; M_Ffjzt.jdlh = jdlh;
                M_Ffjzt.jdlh_name   = jdlh_name; M_Ffjzt.jdcs = jdcs; M_Ffjzt.jdcs_name = jdcs_name;
                M_Ffjzt.fjrb        = fjrb; M_Ffjzt.fjrb_code = fjrb_code;
                M_Ffjzt.fjbh        = fjbh; M_Ffjzt.fjdh = fjdh; M_Ffjzt.dhfj = dhfj; M_Ffjzt.bz = bz;
                M_Ffjzt.yd_ddsj     = M_Ffjzt.yd_lksj = M_Ffjzt.ddsj = M_Ffjzt.lksj = DateTime.Parse(common_file.common_app.cssj);
                M_Ffjzt.czsj        = DateTime.Now;
                M_Ffjzt.zyzt        = common_file.common_fjzt.gjf;
                M_Ffjzt.zyzt_second = "";
                if (B_Ffjzt_new.Add(M_Ffjzt) > 0)//调用自定义类初始化房间
                {
                    s = common_file.common_app.get_suc;
                }
            }
            else
            if (add_edit_delete == common_file.common_app.get_edit)
            {
                M_Ffjzt      = B_Ffjzt.GetModel(Convert.ToInt32(id));
                M_Ffjzt.jdlh = jdlh; M_Ffjzt.jdlh_name = jdlh_name;
                M_Ffjzt.jdcs = jdcs; M_Ffjzt.jdcs_name = jdcs_name;
                M_Ffjzt.fjrb = fjrb; M_Ffjzt.fjrb_code = fjrb_code;
                M_Ffjzt.fjdh = fjdh; M_Ffjzt.dhfj = dhfj; M_Ffjzt.bz = bz;
                M_Ffjzt.czsj = DateTime.Now;
                if (B_Ffjzt.Update(M_Ffjzt))
                {
                    s = common_file.common_app.get_suc;
                }
            }
            else
            if (add_edit_delete == common_file.common_app.get_delete)
            {
                if (id != null)
                {
                    if (id != "")
                    {
                        if (B_Ffjzt.Delete(Convert.ToInt32(id)))
                        {
                            s = common_file.common_app.get_suc;
                        }
                    }
                }
            }
            return(s);
        }
Exemplo n.º 2
0
        public void Ffjzt_xgft(string zyzt, string zyzt_second, string zybz, string fjbh, string krxm, DateTime ddsj, DateTime lksj, DateTime yd_ddsj, DateTime yd_lksj, bool shlf, bool shts, bool shvip, bool fjbm, string sktt, string lsbh, DateTime czsj, string czy, string cznr, string xxzs)
        {
            string s = common_file.common_app.get_failure;

            if (xxzs == common_file.common_app.xxzs_xxvalue)
            {
            }
            if (xxzs == common_file.common_app.xxzs_zsvalue)
            {
            }
            BLL.Common  B_Common = new Hotel_app.BLL.Common();
            BLL.Ffjzt   B_Ffjzt  = new Hotel_app.BLL.Ffjzt();
            Model.Ffjzt M_Ffjzt  = new Hotel_app.Model.Ffjzt();
            DataSet     ds_temp;

            ds_temp = B_Common.GetList("select id from Ffjzt", "fjbh='" + fjbh + "'");
            int id = 0;

            if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
            {
                id           = Convert.ToInt32(ds_temp.Tables[0].Rows[0]["id"].ToString());
                M_Ffjzt      = B_Ffjzt.GetModel(id);
                M_Ffjzt.zybz = zybz;
                if (zyzt == common_file.common_fjzt.zzf && M_Ffjzt.zyzt == common_file.common_fjzt.zf)
                {
                    M_Ffjzt.zybz = common_file.common_fjzt.yjf;
                }
                M_Ffjzt.zyzt = zyzt; M_Ffjzt.zyzt_second = zyzt_second;



                M_Ffjzt.krxm    = krxm; M_Ffjzt.ddsj = ddsj; M_Ffjzt.lksj = lksj;
                M_Ffjzt.yd_ddsj = yd_ddsj; M_Ffjzt.yd_lksj = yd_lksj; M_Ffjzt.shlf = shlf; M_Ffjzt.fjbm = fjbm;
                M_Ffjzt.shts    = shts; M_Ffjzt.shvip = shvip; M_Ffjzt.sktt = sktt;
                M_Ffjzt.lsbh    = lsbh; M_Ffjzt.czsj = DateTime.Now; M_Ffjzt.czy = czy; M_Ffjzt.cznr = cznr;
                if (B_Ffjzt.Update(M_Ffjzt))
                {
                    s = common_file.common_app.get_suc;
                }
            }
            ds_temp.Dispose();
        }
Exemplo n.º 3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Hotel_app.Model.Ffjzt model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Ffjzt(");
            strSql.Append("yydh,qymc,zyzt,zyzt_second,zybz,fjrb_code,fjrb,fjbh,fjdh,dhfj,jdlh,jdlh_name,jdcs,jdcs_name,krxm,ddsj,lksj,yd_ddsj,yd_lksj,bz,shlf,shts,shvip,lsbh,sktt,is_select,is_top,use_time,is_secret,czsj,cznr,czy,fjbm)");
            strSql.Append(" values (");
            strSql.Append("@yydh,@qymc,@zyzt,@zyzt_second,@zybz,@fjrb_code,@fjrb,@fjbh,@fjdh,@dhfj,@jdlh,@jdlh_name,@jdcs,@jdcs_name,@krxm,@ddsj,@lksj,@yd_ddsj,@yd_lksj,@bz,@shlf,@shts,@shvip,@lsbh,@sktt,@is_select,@is_top,@use_time,@is_secret,@czsj,@cznr,@czy,@fjbm)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@yydh",        SqlDbType.VarChar,     50),
                new SqlParameter("@qymc",        SqlDbType.VarChar,     50),
                new SqlParameter("@zyzt",        SqlDbType.VarChar,     50),
                new SqlParameter("@zyzt_second", SqlDbType.VarChar,     50),
                new SqlParameter("@zybz",        SqlDbType.VarChar,     50),
                new SqlParameter("@fjrb_code",   SqlDbType.VarChar,     50),
                new SqlParameter("@fjrb",        SqlDbType.VarChar,     50),
                new SqlParameter("@fjbh",        SqlDbType.VarChar,     50),
                new SqlParameter("@fjdh",        SqlDbType.VarChar,     50),
                new SqlParameter("@dhfj",        SqlDbType.VarChar,     50),
                new SqlParameter("@jdlh",        SqlDbType.VarChar,     50),
                new SqlParameter("@jdlh_name",   SqlDbType.VarChar,     50),
                new SqlParameter("@jdcs",        SqlDbType.VarChar,     50),
                new SqlParameter("@jdcs_name",   SqlDbType.VarChar,     50),
                new SqlParameter("@krxm",        SqlDbType.VarChar,    120),
                new SqlParameter("@ddsj",        SqlDbType.DateTime),
                new SqlParameter("@lksj",        SqlDbType.DateTime),
                new SqlParameter("@yd_ddsj",     SqlDbType.DateTime),
                new SqlParameter("@yd_lksj",     SqlDbType.DateTime),
                new SqlParameter("@bz",          SqlDbType.VarChar,   1000),
                new SqlParameter("@shlf",        SqlDbType.Bit,          1),
                new SqlParameter("@shts",        SqlDbType.Bit,          1),
                new SqlParameter("@shvip",       SqlDbType.Bit,          1),
                new SqlParameter("@lsbh",        SqlDbType.VarChar,     50),
                new SqlParameter("@sktt",        SqlDbType.VarChar,     50),
                new SqlParameter("@is_select",   SqlDbType.Bit,          1),
                new SqlParameter("@is_top",      SqlDbType.Bit,          1),
                new SqlParameter("@use_time",    SqlDbType.Decimal,      9),
                new SqlParameter("@is_secret",   SqlDbType.Bit,          1),
                new SqlParameter("@czsj",        SqlDbType.DateTime),
                new SqlParameter("@cznr",        SqlDbType.VarChar,    200),
                new SqlParameter("@czy",         SqlDbType.VarChar,     50),
                new SqlParameter("@fjbm",        SqlDbType.Bit, 1)
            };
            parameters[0].Value  = model.yydh;
            parameters[1].Value  = model.qymc;
            parameters[2].Value  = model.zyzt;
            parameters[3].Value  = model.zyzt_second;
            parameters[4].Value  = model.zybz;
            parameters[5].Value  = model.fjrb_code;
            parameters[6].Value  = model.fjrb;
            parameters[7].Value  = model.fjbh;
            parameters[8].Value  = model.fjdh;
            parameters[9].Value  = model.dhfj;
            parameters[10].Value = model.jdlh;
            parameters[11].Value = model.jdlh_name;
            parameters[12].Value = model.jdcs;
            parameters[13].Value = model.jdcs_name;
            parameters[14].Value = model.krxm;
            parameters[15].Value = model.ddsj;
            parameters[16].Value = model.lksj;
            parameters[17].Value = model.yd_ddsj;
            parameters[18].Value = model.yd_lksj;
            parameters[19].Value = model.bz;
            parameters[20].Value = model.shlf;
            parameters[21].Value = model.shts;
            parameters[22].Value = model.shvip;
            parameters[23].Value = model.lsbh;
            parameters[24].Value = model.sktt;
            parameters[25].Value = model.is_select;
            parameters[26].Value = model.is_top;
            parameters[27].Value = model.use_time;
            parameters[28].Value = model.is_secret;
            parameters[29].Value = model.czsj;
            parameters[30].Value = model.cznr;
            parameters[31].Value = model.czy;
            parameters[32].Value = model.fjbm;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Hotel_app.Model.Ffjzt GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 id,yydh,qymc,zyzt,zyzt_second,zybz,fjrb_code,fjrb,fjbh,fjdh,dhfj,jdlh,jdlh_name,jdcs,jdcs_name,krxm,ddsj,lksj,yd_ddsj,yd_lksj,bz,shlf,shts,shvip,lsbh,sktt,is_select,is_top,use_time,is_secret,czsj,cznr,czy,fjbm from Ffjzt ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;

            Hotel_app.Model.Ffjzt model = new Hotel_app.Model.Ffjzt();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["id"] != null && ds.Tables[0].Rows[0]["id"].ToString() != "")
                {
                    model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["yydh"] != null && ds.Tables[0].Rows[0]["yydh"].ToString() != "")
                {
                    model.yydh = ds.Tables[0].Rows[0]["yydh"].ToString();
                }
                if (ds.Tables[0].Rows[0]["qymc"] != null && ds.Tables[0].Rows[0]["qymc"].ToString() != "")
                {
                    model.qymc = ds.Tables[0].Rows[0]["qymc"].ToString();
                }
                if (ds.Tables[0].Rows[0]["zyzt"] != null && ds.Tables[0].Rows[0]["zyzt"].ToString() != "")
                {
                    model.zyzt = ds.Tables[0].Rows[0]["zyzt"].ToString();
                }
                if (ds.Tables[0].Rows[0]["zyzt_second"] != null && ds.Tables[0].Rows[0]["zyzt_second"].ToString() != "")
                {
                    model.zyzt_second = ds.Tables[0].Rows[0]["zyzt_second"].ToString();
                }
                if (ds.Tables[0].Rows[0]["zybz"] != null && ds.Tables[0].Rows[0]["zybz"].ToString() != "")
                {
                    model.zybz = ds.Tables[0].Rows[0]["zybz"].ToString();
                }
                if (ds.Tables[0].Rows[0]["fjrb_code"] != null && ds.Tables[0].Rows[0]["fjrb_code"].ToString() != "")
                {
                    model.fjrb_code = ds.Tables[0].Rows[0]["fjrb_code"].ToString();
                }
                if (ds.Tables[0].Rows[0]["fjrb"] != null && ds.Tables[0].Rows[0]["fjrb"].ToString() != "")
                {
                    model.fjrb = ds.Tables[0].Rows[0]["fjrb"].ToString();
                }
                if (ds.Tables[0].Rows[0]["fjbh"] != null && ds.Tables[0].Rows[0]["fjbh"].ToString() != "")
                {
                    model.fjbh = ds.Tables[0].Rows[0]["fjbh"].ToString();
                }
                if (ds.Tables[0].Rows[0]["fjdh"] != null && ds.Tables[0].Rows[0]["fjdh"].ToString() != "")
                {
                    model.fjdh = ds.Tables[0].Rows[0]["fjdh"].ToString();
                }
                if (ds.Tables[0].Rows[0]["dhfj"] != null && ds.Tables[0].Rows[0]["dhfj"].ToString() != "")
                {
                    model.dhfj = ds.Tables[0].Rows[0]["dhfj"].ToString();
                }
                if (ds.Tables[0].Rows[0]["jdlh"] != null && ds.Tables[0].Rows[0]["jdlh"].ToString() != "")
                {
                    model.jdlh = ds.Tables[0].Rows[0]["jdlh"].ToString();
                }
                if (ds.Tables[0].Rows[0]["jdlh_name"] != null && ds.Tables[0].Rows[0]["jdlh_name"].ToString() != "")
                {
                    model.jdlh_name = ds.Tables[0].Rows[0]["jdlh_name"].ToString();
                }
                if (ds.Tables[0].Rows[0]["jdcs"] != null && ds.Tables[0].Rows[0]["jdcs"].ToString() != "")
                {
                    model.jdcs = ds.Tables[0].Rows[0]["jdcs"].ToString();
                }
                if (ds.Tables[0].Rows[0]["jdcs_name"] != null && ds.Tables[0].Rows[0]["jdcs_name"].ToString() != "")
                {
                    model.jdcs_name = ds.Tables[0].Rows[0]["jdcs_name"].ToString();
                }
                if (ds.Tables[0].Rows[0]["krxm"] != null && ds.Tables[0].Rows[0]["krxm"].ToString() != "")
                {
                    model.krxm = ds.Tables[0].Rows[0]["krxm"].ToString();
                }
                if (ds.Tables[0].Rows[0]["ddsj"] != null && ds.Tables[0].Rows[0]["ddsj"].ToString() != "")
                {
                    model.ddsj = DateTime.Parse(ds.Tables[0].Rows[0]["ddsj"].ToString());
                }
                if (ds.Tables[0].Rows[0]["lksj"] != null && ds.Tables[0].Rows[0]["lksj"].ToString() != "")
                {
                    model.lksj = DateTime.Parse(ds.Tables[0].Rows[0]["lksj"].ToString());
                }
                if (ds.Tables[0].Rows[0]["yd_ddsj"] != null && ds.Tables[0].Rows[0]["yd_ddsj"].ToString() != "")
                {
                    model.yd_ddsj = DateTime.Parse(ds.Tables[0].Rows[0]["yd_ddsj"].ToString());
                }
                if (ds.Tables[0].Rows[0]["yd_lksj"] != null && ds.Tables[0].Rows[0]["yd_lksj"].ToString() != "")
                {
                    model.yd_lksj = DateTime.Parse(ds.Tables[0].Rows[0]["yd_lksj"].ToString());
                }
                if (ds.Tables[0].Rows[0]["bz"] != null && ds.Tables[0].Rows[0]["bz"].ToString() != "")
                {
                    model.bz = ds.Tables[0].Rows[0]["bz"].ToString();
                }
                if (ds.Tables[0].Rows[0]["shlf"] != null && ds.Tables[0].Rows[0]["shlf"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["shlf"].ToString() == "1") || (ds.Tables[0].Rows[0]["shlf"].ToString().ToLower() == "true"))
                    {
                        model.shlf = true;
                    }
                    else
                    {
                        model.shlf = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["shts"] != null && ds.Tables[0].Rows[0]["shts"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["shts"].ToString() == "1") || (ds.Tables[0].Rows[0]["shts"].ToString().ToLower() == "true"))
                    {
                        model.shts = true;
                    }
                    else
                    {
                        model.shts = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["shvip"] != null && ds.Tables[0].Rows[0]["shvip"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["shvip"].ToString() == "1") || (ds.Tables[0].Rows[0]["shvip"].ToString().ToLower() == "true"))
                    {
                        model.shvip = true;
                    }
                    else
                    {
                        model.shvip = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["lsbh"] != null && ds.Tables[0].Rows[0]["lsbh"].ToString() != "")
                {
                    model.lsbh = ds.Tables[0].Rows[0]["lsbh"].ToString();
                }
                if (ds.Tables[0].Rows[0]["sktt"] != null && ds.Tables[0].Rows[0]["sktt"].ToString() != "")
                {
                    model.sktt = ds.Tables[0].Rows[0]["sktt"].ToString();
                }
                if (ds.Tables[0].Rows[0]["is_select"] != null && ds.Tables[0].Rows[0]["is_select"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["is_select"].ToString() == "1") || (ds.Tables[0].Rows[0]["is_select"].ToString().ToLower() == "true"))
                    {
                        model.is_select = true;
                    }
                    else
                    {
                        model.is_select = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["is_top"] != null && ds.Tables[0].Rows[0]["is_top"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["is_top"].ToString() == "1") || (ds.Tables[0].Rows[0]["is_top"].ToString().ToLower() == "true"))
                    {
                        model.is_top = true;
                    }
                    else
                    {
                        model.is_top = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["use_time"] != null && ds.Tables[0].Rows[0]["use_time"].ToString() != "")
                {
                    model.use_time = decimal.Parse(ds.Tables[0].Rows[0]["use_time"].ToString());
                }
                if (ds.Tables[0].Rows[0]["is_secret"] != null && ds.Tables[0].Rows[0]["is_secret"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["is_secret"].ToString() == "1") || (ds.Tables[0].Rows[0]["is_secret"].ToString().ToLower() == "true"))
                    {
                        model.is_secret = true;
                    }
                    else
                    {
                        model.is_secret = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["czsj"] != null && ds.Tables[0].Rows[0]["czsj"].ToString() != "")
                {
                    model.czsj = DateTime.Parse(ds.Tables[0].Rows[0]["czsj"].ToString());
                }
                if (ds.Tables[0].Rows[0]["cznr"] != null && ds.Tables[0].Rows[0]["cznr"].ToString() != "")
                {
                    model.cznr = ds.Tables[0].Rows[0]["cznr"].ToString();
                }
                if (ds.Tables[0].Rows[0]["czy"] != null && ds.Tables[0].Rows[0]["czy"].ToString() != "")
                {
                    model.czy = ds.Tables[0].Rows[0]["czy"].ToString();
                }
                if (ds.Tables[0].Rows[0]["fjbm"] != null && ds.Tables[0].Rows[0]["fjbm"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["fjbm"].ToString() == "1") || (ds.Tables[0].Rows[0]["fjbm"].ToString().ToLower() == "true"))
                    {
                        model.fjbm = true;
                    }
                    else
                    {
                        model.fjbm = false;
                    }
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Hotel_app.Model.Ffjzt model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Ffjzt set ");
            strSql.Append("yydh=@yydh,");
            strSql.Append("qymc=@qymc,");
            strSql.Append("zyzt=@zyzt,");
            strSql.Append("zyzt_second=@zyzt_second,");
            strSql.Append("zybz=@zybz,");
            strSql.Append("fjrb_code=@fjrb_code,");
            strSql.Append("fjrb=@fjrb,");
            strSql.Append("fjbh=@fjbh,");
            strSql.Append("fjdh=@fjdh,");
            strSql.Append("dhfj=@dhfj,");
            strSql.Append("jdlh=@jdlh,");
            strSql.Append("jdlh_name=@jdlh_name,");
            strSql.Append("jdcs=@jdcs,");
            strSql.Append("jdcs_name=@jdcs_name,");
            strSql.Append("krxm=@krxm,");
            strSql.Append("ddsj=@ddsj,");
            strSql.Append("lksj=@lksj,");
            strSql.Append("yd_ddsj=@yd_ddsj,");
            strSql.Append("yd_lksj=@yd_lksj,");
            strSql.Append("bz=@bz,");
            strSql.Append("shlf=@shlf,");
            strSql.Append("shts=@shts,");
            strSql.Append("shvip=@shvip,");
            strSql.Append("lsbh=@lsbh,");
            strSql.Append("sktt=@sktt,");
            strSql.Append("is_select=@is_select,");
            strSql.Append("is_top=@is_top,");
            strSql.Append("use_time=@use_time,");
            strSql.Append("is_secret=@is_secret,");
            strSql.Append("czsj=@czsj,");
            strSql.Append("cznr=@cznr,");
            strSql.Append("czy=@czy,");
            strSql.Append("fjbm=@fjbm");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@yydh",        SqlDbType.VarChar,     50),
                new SqlParameter("@qymc",        SqlDbType.VarChar,     50),
                new SqlParameter("@zyzt",        SqlDbType.VarChar,     50),
                new SqlParameter("@zyzt_second", SqlDbType.VarChar,     50),
                new SqlParameter("@zybz",        SqlDbType.VarChar,     50),
                new SqlParameter("@fjrb_code",   SqlDbType.VarChar,     50),
                new SqlParameter("@fjrb",        SqlDbType.VarChar,     50),
                new SqlParameter("@fjbh",        SqlDbType.VarChar,     50),
                new SqlParameter("@fjdh",        SqlDbType.VarChar,     50),
                new SqlParameter("@dhfj",        SqlDbType.VarChar,     50),
                new SqlParameter("@jdlh",        SqlDbType.VarChar,     50),
                new SqlParameter("@jdlh_name",   SqlDbType.VarChar,     50),
                new SqlParameter("@jdcs",        SqlDbType.VarChar,     50),
                new SqlParameter("@jdcs_name",   SqlDbType.VarChar,     50),
                new SqlParameter("@krxm",        SqlDbType.VarChar,    120),
                new SqlParameter("@ddsj",        SqlDbType.DateTime),
                new SqlParameter("@lksj",        SqlDbType.DateTime),
                new SqlParameter("@yd_ddsj",     SqlDbType.DateTime),
                new SqlParameter("@yd_lksj",     SqlDbType.DateTime),
                new SqlParameter("@bz",          SqlDbType.VarChar,   1000),
                new SqlParameter("@shlf",        SqlDbType.Bit,          1),
                new SqlParameter("@shts",        SqlDbType.Bit,          1),
                new SqlParameter("@shvip",       SqlDbType.Bit,          1),
                new SqlParameter("@lsbh",        SqlDbType.VarChar,     50),
                new SqlParameter("@sktt",        SqlDbType.VarChar,     50),
                new SqlParameter("@is_select",   SqlDbType.Bit,          1),
                new SqlParameter("@is_top",      SqlDbType.Bit,          1),
                new SqlParameter("@use_time",    SqlDbType.Decimal,      9),
                new SqlParameter("@is_secret",   SqlDbType.Bit,          1),
                new SqlParameter("@czsj",        SqlDbType.DateTime),
                new SqlParameter("@cznr",        SqlDbType.VarChar,    200),
                new SqlParameter("@czy",         SqlDbType.VarChar,     50),
                new SqlParameter("@fjbm",        SqlDbType.Bit,          1),
                new SqlParameter("@id",          SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.yydh;
            parameters[1].Value  = model.qymc;
            parameters[2].Value  = model.zyzt;
            parameters[3].Value  = model.zyzt_second;
            parameters[4].Value  = model.zybz;
            parameters[5].Value  = model.fjrb_code;
            parameters[6].Value  = model.fjrb;
            parameters[7].Value  = model.fjbh;
            parameters[8].Value  = model.fjdh;
            parameters[9].Value  = model.dhfj;
            parameters[10].Value = model.jdlh;
            parameters[11].Value = model.jdlh_name;
            parameters[12].Value = model.jdcs;
            parameters[13].Value = model.jdcs_name;
            parameters[14].Value = model.krxm;
            parameters[15].Value = model.ddsj;
            parameters[16].Value = model.lksj;
            parameters[17].Value = model.yd_ddsj;
            parameters[18].Value = model.yd_lksj;
            parameters[19].Value = model.bz;
            parameters[20].Value = model.shlf;
            parameters[21].Value = model.shts;
            parameters[22].Value = model.shvip;
            parameters[23].Value = model.lsbh;
            parameters[24].Value = model.sktt;
            parameters[25].Value = model.is_select;
            parameters[26].Value = model.is_top;
            parameters[27].Value = model.use_time;
            parameters[28].Value = model.is_secret;
            parameters[29].Value = model.czsj;
            parameters[30].Value = model.cznr;
            parameters[31].Value = model.czy;
            parameters[32].Value = model.fjbm;
            parameters[33].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 8
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);
        }