Пример #1
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;

            Qyddj.Qyddj_add_edit_delete Qyddj_add_edit_delete_new = new Qyddj_add_edit_delete();
            s = Qyddj_add_edit_delete_new.Qskdj_add_edit_delete(id, yydh, qymc, lsbh, ddbh, hykh, hyrx, krxm, tlkr, krgj, krmz, yxzj, zjhm, krxb, krsr, krdh, krsj, krEmail, krdz, krjg, krdw, krzy, cxmd, qzrx, qzhm, zjyxq, tlyxq, tjrq, lzka, krly, xyh, xydw, xsy, ddrx, ddwz, zyzt, krrx, kr_children, ddsj, lzts, lksj, qtyq, czy, czsj, cznr, sktt, yddj, main_sec, yddj_rx, syzd, vip_type, tsyq, add_edit_delete, xxzs, ddly, hykh_bz);
            return(s);
        }
Пример #2
0
        public string delete_sk_multi(string[] id_arg, string czzt, string czbz, string qxyy, string jzbh, string czy, string czsj, string xxzs)
        {
            string s = common_file.common_app.get_failure;

            Qyddj.Qyddj_add_edit_delete Qyddj_add_edit_delete_new = new Qyddj_add_edit_delete();
            s = Qyddj_add_edit_delete_new.delete_sk_multi(id_arg, czzt, czbz, qxyy, jzbh, czy, czsj, xxzs);
            return(s);
        }
Пример #3
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_ttyd(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.Qttyd_mainrecord        B_Qttyd_mainrecord        = new Hotel_app.BLL.Qttyd_mainrecord();
            Model.Qttyd_mainrecord      M_Qttyd_mainrecord        = new Hotel_app.Model.Qttyd_mainrecord();
            BLL.Qttyd_mainrecord_new    B_Qttyd_mainrecord_new    = new Hotel_app.BLL.Qttyd_mainrecord_new();
            Qyddj.Qyddj_add_edit_delete Qyddj_add_edit_delete_new = new Qyddj_add_edit_delete();
            BLL.Common B_Common = new Hotel_app.BLL.Common();
            if (id != "")
            {
                DataSet DS_temp;
                M_Qttyd_mainrecord = B_Qttyd_mainrecord.GetModel(int.Parse(id));
                //判断预订的记录有两条房类时删除同一个主单避免出错
                if (M_Qttyd_mainrecord == null)
                {
                    i_temp = 9;
                }
                else
                {
                    s       = common_file.common_app.get_suc;
                    DS_temp = B_Common.GetList("select * from Qskyd_mainrecord", "ddbh='" + M_Qttyd_mainrecord.ddbh + "'");
                    if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
                    {
                        s = common_file.common_app.get_failure;
                        for (int i_temp_0 = 0; i_temp_0 < DS_temp.Tables[0].Rows.Count; i_temp_0++)
                        {
                            s = Qyddj_add_edit_delete_new.delete_sz_xgft(DS_temp.Tables[0].Rows[i_temp_0]["id"].ToString(), czzt, czbz, qxyy, jzbh, czy, czsj, xxzs);
                        }
                    }
                    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_Qttyd_mainrecord_new.Pladd(strid, czbz, qxyy, czy, czsj, czzt, jzbh);//删除前批量添加到备份表里
                        if (B_Qttyd_mainrecord.Delete(strid) == true)
                        {
                            //s = common_file.common_app.get_suc;
                        }
                    }
                }
                if (i_temp == 9)
                {
                    //s = common_file.common_app.get_suc;
                }
            }


            s = common_file.common_app.get_suc;
            return(s);
        }
Пример #4
0
        public string Qttyd_add_edit_delete_app(string id, string yydh, string qymc, string lsbh, string ddbh, string krxm, string krbh, string yddj, string sktt, string krgj, string krdz, string krly, string xyh, string xydw, string xsy, string krdh, string krsj, string kremail, string ydrxm, string ddsj, string lzts, string lksj, string qtyq, string ddrx, string ddwz, string zyzt, string czy, string cznr, string czsj, string syzd, string tsyq, string add_edit_delete, string xxzs, string ddly)
        {
            string s = common_file.common_app.get_failure;

            Model.Qttyd_mainrecord M_Qttyd_mainrecord = new Hotel_app.Model.Qttyd_mainrecord();
            BLL.Qttyd_mainrecord   B_Qttyd_mainrecord = new Hotel_app.BLL.Qttyd_mainrecord();
            //DataSet Ds_temp;
            if (add_edit_delete == common_file.common_app.get_add)
            {
                M_Qttyd_mainrecord.cznr    = cznr;
                M_Qttyd_mainrecord.czsj    = Convert.ToDateTime(czsj);
                M_Qttyd_mainrecord.czy     = czy;
                M_Qttyd_mainrecord.ddbh    = ddbh;
                M_Qttyd_mainrecord.ddrx    = ddrx;
                M_Qttyd_mainrecord.ddsj    = Convert.ToDateTime(ddsj);
                M_Qttyd_mainrecord.ddwz    = ddwz;
                M_Qttyd_mainrecord.krbh    = krbh;
                M_Qttyd_mainrecord.krdh    = krdh;
                M_Qttyd_mainrecord.krdz    = krdz;
                M_Qttyd_mainrecord.krEmail = kremail;
                M_Qttyd_mainrecord.krgj    = krgj;
                M_Qttyd_mainrecord.krly    = krly;
                M_Qttyd_mainrecord.krsj    = krsj;
                M_Qttyd_mainrecord.krxm    = krxm;
                M_Qttyd_mainrecord.lksj    = Convert.ToDateTime(lksj);
                M_Qttyd_mainrecord.lsbh    = lsbh;
                M_Qttyd_mainrecord.lzts    = Convert.ToInt32(lzts);
                M_Qttyd_mainrecord.qtyq    = qtyq;
                M_Qttyd_mainrecord.qymc    = qymc;
                M_Qttyd_mainrecord.sktt    = sktt;
                M_Qttyd_mainrecord.syzd    = syzd;
                M_Qttyd_mainrecord.tsyq    = tsyq;
                M_Qttyd_mainrecord.xsy     = xsy;
                M_Qttyd_mainrecord.xydw    = xydw;
                M_Qttyd_mainrecord.xyh     = xyh;
                M_Qttyd_mainrecord.yddj    = yddj;
                M_Qttyd_mainrecord.ydrxm   = ydrxm;
                M_Qttyd_mainrecord.yydh    = yydh;
                M_Qttyd_mainrecord.zyzt    = zyzt;
                M_Qttyd_mainrecord.ddly    = ddly;
                int IsAdd = B_Qttyd_mainrecord.Add(M_Qttyd_mainrecord);
                if (IsAdd > 0)
                {
                    s = common_file.common_app.get_suc;
                }
            }
            else if (add_edit_delete == common_file.common_app.get_edit)
            {
                M_Qttyd_mainrecord = B_Qttyd_mainrecord.GetModel(int.Parse(id));
                if (M_Qttyd_mainrecord != null)
                {
                    DateTime ddsj_temp = M_Qttyd_mainrecord.ddsj;
                    DateTime lksj_temp = M_Qttyd_mainrecord.lksj;
                    M_Qttyd_mainrecord.id      = int.Parse(id);
                    M_Qttyd_mainrecord.cznr    = cznr;
                    M_Qttyd_mainrecord.czsj    = Convert.ToDateTime(czsj);
                    M_Qttyd_mainrecord.czy     = czy;
                    M_Qttyd_mainrecord.ddbh    = ddbh;
                    M_Qttyd_mainrecord.ddrx    = ddrx;
                    M_Qttyd_mainrecord.ddsj    = Convert.ToDateTime(ddsj);
                    M_Qttyd_mainrecord.ddwz    = ddwz;
                    M_Qttyd_mainrecord.krbh    = krbh;
                    M_Qttyd_mainrecord.krdh    = krdh;
                    M_Qttyd_mainrecord.krdz    = krdz;
                    M_Qttyd_mainrecord.krEmail = kremail;
                    M_Qttyd_mainrecord.krgj    = krgj;

                    M_Qttyd_mainrecord.krsj = krsj;
                    M_Qttyd_mainrecord.krxm = krxm;
                    M_Qttyd_mainrecord.lksj = Convert.ToDateTime(lksj);
                    M_Qttyd_mainrecord.lsbh = lsbh;
                    M_Qttyd_mainrecord.lzts = Convert.ToInt32(lzts);
                    M_Qttyd_mainrecord.qtyq = qtyq;
                    M_Qttyd_mainrecord.qymc = qymc;
                    M_Qttyd_mainrecord.sktt = sktt;
                    M_Qttyd_mainrecord.syzd = syzd;
                    M_Qttyd_mainrecord.tsyq = tsyq;

                    M_Qttyd_mainrecord.yddj  = yddj;
                    M_Qttyd_mainrecord.ydrxm = ydrxm;
                    M_Qttyd_mainrecord.yydh  = yydh;
                    M_Qttyd_mainrecord.zyzt  = zyzt;
                    M_Qttyd_mainrecord.ddly  = ddly;

                    if (M_Qttyd_mainrecord.ddyy != common_file_server.common_app.ydzx_flage)
                    {
                        M_Qttyd_mainrecord.xsy  = xsy;
                        M_Qttyd_mainrecord.xydw = xydw;
                        M_Qttyd_mainrecord.krly = krly;
                        M_Qttyd_mainrecord.xyh  = xyh;
                    }
                    //if (M_Qttyd_mainrecord.ddyy != common_file.common_app.ydzx_flage&&M_Qttyd_mainrecord.krly != common_file.common_app.krly_xydw_flage)
                    //{
                    //     M_Qttyd_mainrecord.xsy = xsy;
                    // }


                    if (ddsj_temp != M_Qttyd_mainrecord.ddsj || lksj_temp != M_Qttyd_mainrecord.lksj)
                    {
                        DataSet ds_temp_0;
                        BLL.Qskyd_mainrecord B_Qskyd_mainrecord = new Hotel_app.BLL.Qskyd_mainrecord();
                        ds_temp_0 = B_Qskyd_mainrecord.GetList("ddbh='" + M_Qttyd_mainrecord.ddbh + "'");
                        if (ds_temp_0 != null && ds_temp_0.Tables[0].Rows.Count > 0)
                        {
                            Model.Qskyd_mainrecord M_Qskyd_mainrecord = new Hotel_app.Model.Qskyd_mainrecord();
                            for (int i_temp_0 = 0; i_temp_0 < ds_temp_0.Tables[0].Rows.Count; i_temp_0++)
                            {
                                M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModel(int.Parse(ds_temp_0.Tables[0].Rows[i_temp_0]["id"].ToString()));
                                if (M_Qskyd_mainrecord != null)
                                {
                                    Qyddj.Qyddj_add_edit_delete Qyddj_add_edit_delete_new = new Qyddj_add_edit_delete();
                                    Qyddj_add_edit_delete_new.Qskdj_add_edit_delete(M_Qskyd_mainrecord.id.ToString(), M_Qskyd_mainrecord.yydh,
                                                                                    M_Qskyd_mainrecord.qymc, M_Qskyd_mainrecord.lsbh,
                                                                                    M_Qskyd_mainrecord.ddbh, M_Qskyd_mainrecord.hykh,
                                                                                    M_Qskyd_mainrecord.hyrx, M_Qskyd_mainrecord.krxm, M_Qskyd_mainrecord.tlkr, M_Qskyd_mainrecord.krgj,
                                                                                    M_Qskyd_mainrecord.krmz, M_Qskyd_mainrecord.yxzj, M_Qskyd_mainrecord.zjhm, M_Qskyd_mainrecord.krxb,
                                                                                    M_Qskyd_mainrecord.krsr.ToString(), M_Qskyd_mainrecord.krdh, M_Qskyd_mainrecord.krsj, M_Qskyd_mainrecord.krEmail,
                                                                                    M_Qskyd_mainrecord.krdz, M_Qskyd_mainrecord.krjg, M_Qskyd_mainrecord.krdw, M_Qskyd_mainrecord.krzy,
                                                                                    M_Qskyd_mainrecord.cxmd, M_Qskyd_mainrecord.qzrx, M_Qskyd_mainrecord.qzhm, M_Qskyd_mainrecord.zjyxq.ToString(),
                                                                                    M_Qskyd_mainrecord.tlyxq.ToString(), M_Qskyd_mainrecord.tjrq.ToString(), M_Qskyd_mainrecord.lzka, M_Qskyd_mainrecord.krly,
                                                                                    M_Qttyd_mainrecord.xyh, M_Qttyd_mainrecord.xydw, M_Qttyd_mainrecord.xsy, M_Qttyd_mainrecord.ddrx,
                                                                                    M_Qttyd_mainrecord.ddwz, M_Qttyd_mainrecord.zyzt, M_Qskyd_mainrecord.krrx, M_Qskyd_mainrecord.kr_children.ToString(),
                                                                                    M_Qttyd_mainrecord.ddsj.ToString(), M_Qttyd_mainrecord.lzts.ToString(), M_Qttyd_mainrecord.lksj.ToString(), M_Qskyd_mainrecord.qtyq, czy,
                                                                                    czsj, cznr, M_Qttyd_mainrecord.sktt, M_Qttyd_mainrecord.yddj,
                                                                                    M_Qskyd_mainrecord.main_sec, M_Qskyd_mainrecord.yddj,
                                                                                    M_Qttyd_mainrecord.syzd, M_Qskyd_mainrecord.vip_type, M_Qskyd_mainrecord.tsyq, add_edit_delete, xxzs, M_Qttyd_mainrecord.ddly, M_Qskyd_mainrecord.hykh_bz);
                                }
                            }
                        }
                        ds_temp_0.Dispose();
                    }
                    if (B_Qttyd_mainrecord.Update(M_Qttyd_mainrecord))
                    {
                        s = common_file.common_app.get_suc;
                    }
                }
            }
            else if (add_edit_delete == common_file.common_app.get_delete)
            {
                if (id != "")
                {
                    s = delete_sz_ttyd(id, "sc", cznr, qtyq, "", czy, czsj, xxzs);
                }
            }

            return(s);
        }
Пример #5
0
        /// <summary>
        /// 结帐时的批量帐务处理
        ///
        /// </summary>
        /// 先写入Sjzzd,同时写sjzmx,Ffkfssz
        /// 写入成功后,将zwmx里面的对应的记录写入到zwmx_bak,并删除当前lsbh对应下的zwmx记录
        public static string Pladd(string lsbh, string jzbh, string xydw, string krly, string czsj, string syzd, string czy, string czy_bc, string jzzt, string cznr, string bz, string fkje, string xfje, string xxzs)
        {
            //修改房态时用到的变量
            string id = "";//主单的ID

            //
            Ffjzt.Ffjzt_add_edit             Ffjzt_add_edit_new = new Hotel_app.Ffjzt.Ffjzt_add_edit(); //用于修改房态
            BLL.Ffjzt                        B_Ffjzt            = new Hotel_app.BLL.Ffjzt();            //修改房态
            Hotel_app.BLL.Qskyd_fjrb         B_Qskyd_fjrb       = new Hotel_app.BLL.Qskyd_fjrb();
            Hotel_app.Model.Qskyd_mainrecord M_Qskyd_mainrecord;
            Hotel_app.BLL.Qskyd_mainrecord   B_Qskyd_mainrecord = new Hotel_app.BLL.Qskyd_mainrecord();

            Hotel_app.Server.Qyddj.Qyddj_add_edit_delete Qyddj_add_edit_delete_new = new Hotel_app.Server.Qyddj.Qyddj_add_edit_delete();//房态及删除主单操作


            string        s      = common_app.get_failure;
            StringBuilder strSql = new StringBuilder();//注意jzzd只写入一次(公共信息查一次就好)

            strSql.Append("insert into Sjzzd(yydh,qymc,lsbh,jzbh,krxm,sktt,fjbh,xydw,krly,tfsj,czsj,czy,czzt,jzzt,syzd,bz,fkje,xfje)");
            strSql.Append(" select top 1 yydh,qymc,'" + lsbh + "',jzbh,krxm,sktt,fjbh,'" + xydw + "','" + krly + "','" + DateTime.Now + "','" + czsj + "','" + czy + "','" + common_file.common_jzzt.czzt_sz + "','" + common_file.common_jzzt.czzt_sz + "','" + syzd + "','" + bz + "','" + fkje + "','" + xfje + "'  from Szw_temp");
            strSql.Append(" where lsbh='" + lsbh + "' and  czy_temp='" + czy + "'");
            BLL.Common B_common = new Hotel_app.BLL.Common();
            if (B_common.ExecuteSql(strSql.ToString()) > 0)//写入主单成功后,写入jzmx
            {
                strSql = new StringBuilder();
                strSql.Append("insert into Sjzmx(yydh,qymc,id_app,jzbh,lsbh,krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,jjje,xfje,yh,sjxfje,xfsl,shsc,czy_bc,czzt,czsj,syzd,jzzt,fkfs ) ");
                strSql.Append(" select yydh,qymc,id_app,jzbh,'" + lsbh + "',krxm,fjrb,fjbh,sktt,xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy,jjje,xfje,yh,sjxfje,xfsl,shsc,'" + czy_bc + "','" + jzzt + "','" + czsj + "','" + syzd + "','" + jzzt + "',fkfs  from Szw_temp");
                strSql.Append(" where lsbh='" + lsbh + "' and  czy_temp='" + czy + "'");
                if (B_common.ExecuteSql(strSql.ToString()) > 0)//写入jzmx成功后,
                {
                    //提取fkdr为付款的项目写入Ffkfssz
                    strSql = new StringBuilder();
                    strSql.Append("insert into Sfkfssz(yydh,qymc,jzbh,jzzt,lsbh,fjbh,krxm,fkfs,xfdr,xfrb,xfxm,xfje,sjxfje,fkrq,fksj,xfrq,xfsj,czy,czy_bc,syzd)");
                    strSql.Append(" select yydh,qymc,jzhb,'" + jzzt + "',lsbh,fjbh,krxm,fkfs,xfdr,xfxm,xfje,sjxfje,fkrq,fksj,xfrq,xfsj,czy,czy_bc,syzd from Szw_temp");
                    strSql.Append(" where lsbh='" + lsbh + "'  and czy_temp='" + czy + "'  and  xfdr='" + common_app.fkdr + "'");

                    //删除zwmx里面此lsbh对应的帐务(同时通过zwmx上面的触发器来写入到zwmx_bak里面)
                    strSql = new StringBuilder();
                    strSql.Append("update  Szwmx  set  jzbh='" + jzbh + "'  where id>0  " + common_file.common_app.yydh_select + "  and  lsbh='" + lsbh + "'");
                    if (B_common.ExecuteSql(strSql.ToString()) > 0)//更新成功
                    {
                        strSql = new StringBuilder();
                        strSql.Append("delete from Szwmx  where id>0  " + common_file.common_app.yydh_select + "  and  lsbh='" + lsbh + "'");
                        //删除的时候根据删除的触发器写入到对应的bak表中

                        if (B_common.ExecuteSql(strSql.ToString()) > 0)
                        {
                            //先更新押金操作表里面的jzbh,再删除yjcz表里面对应的记录,并写入其bak,写入Ffkfssz
                            strSql = new StringBuilder();
                            strSql.Append("update Syjcz  set jzbh='" + jzbh + "'  where id>0 " + common_app.yydh_select + "  and  lsbh='" + lsbh + "'");
                            if (B_common.ExecuteSql(strSql.ToString()) > 0)  //押金更新成功
                            {
                                if (jzzt == common_file.common_jzzt.czzt_sz) //算帐
                                {
                                    strSql = new StringBuilder();
                                    strSql.Append("delete from Syjcz where id>0  " + common_app.yydh_select + "  and lsbh='" + lsbh + "'");
                                    if (B_common.ExecuteSql(strSql.ToString()) > 0)
                                    {
                                        //清除Szw_temp
                                        strSql = new StringBuilder();
                                        strSql.Append("delete from Szw_temp  where  id>0  " + common_app.yydh_select + "  and lsbh='" + lsbh + "'");
                                        if (B_common.ExecuteSql(strSql.ToString()) > 0) //清除Szw_temp里面的数据了
                                        {
                                            //调用修改房态的方法(第五步)
                                            M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id>0  " + common_app.yydh_select + "  and lsbh='" + lsbh + "'")[0];
                                            id = M_Qskyd_mainrecord.id.ToString();

                                            //删除主单并记录(这里有包含主单记录删除时的备份)
                                            if (Qyddj_add_edit_delete_new.delete_sz_xgft(id, "jz", common_file.common_jzzt.czzt_sz, "", jzbh, czy, czsj, xxzs) == common_app.get_suc)
                                            {
                                                s = common_app.get_suc;
                                            }
                                        }
                                    }
                                }
                                else if (jzzt == common_file.common_jzzt.czzt_gz || jzzt == common_file.common_jzzt.czzt_jz)//挂帐或者记帐
                                {
                                    strSql = new StringBuilder();
                                    strSql.Append("delete from Szw_temp  where  id>0  " + common_app.yydh_select + "  and lsbh='" + lsbh + "'");
                                    if (B_common.ExecuteSql(strSql.ToString()) > 0) //清除Szw_temp里面的数据了
                                    {
                                        //调用修改房态的方法(第五步)
                                        M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id>0  " + common_app.yydh_select + "  and lsbh='" + lsbh + "'")[0];
                                        id = M_Qskyd_mainrecord.id.ToString();

                                        //删除主单并记录(这里有包含主单记录删除时的备份)
                                        if (Qyddj_add_edit_delete_new.delete_sz_xgft(id, "jz", jzzt, "", jzbh, czy, czsj, xxzs) == common_app.get_suc)
                                        {
                                            s = common_app.get_suc;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(s);
        }