예제 #1
0
        /// <summary>
        /// 删除时批量添加 到Qskyd_mainrecord_temp表
        /// </summary>
        /// //public static string Pladd(string lsbh_old, string lsbh_new, string ddbh_new, string czy, string czsj)
        public static string Pladd(string yydh, string qymc, string lsbh_old, string lsbh_new, string ddbh_new, string czy, string czsj, string krxm, string sktt)
        {
            string s = common_app.get_failure;

            BLL.Common    B_common = new Hotel_app.BLL.Common();
            StringBuilder strSql   = new StringBuilder();

            strSql.Append("insert into Qskyd_mainrecord(yydh,qymc,lsbh,ddbh,is_top,is_select,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,shsc,sktt,yddj,ffshys,main_sec,sdcz,syzd,vip_type,tsyq,ddly)");
            strSql.Append(" select yydh,qymc,'" + lsbh_new + "','" + ddbh_new + "',is_top,is_select,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 + "','" + common_app.chinese_add + "','" + "0" + "',sktt,yddj,'" + "0" + "','" + common_app.main_sec_main + "',sdcz,syzd,vip_type,tsyq,ddly from Qskyd_mainrecord");
            strSql.Append(" where lsbh='" + lsbh_old + "'");

            string  krxm0 = ""; string sktt0 = "";
            DataSet DS_temp = B_common.GetList("select sktt,krxm from Qskyd_mainrecord", " lsbh='" + lsbh_old + "'");

            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();
            }
            Hotel_app.Server.Qyddj.Q_ff_xyxf Q_ff_xyxf_new = new Hotel_app.Server.Qyddj.Q_ff_xyxf();
            Q_ff_xyxf_new.Qyddj_otherfee_add(yydh, qymc, lsbh_new, krxm0, sktt0, "", czy);


            if (B_common.ExecuteSql(strSql.ToString()) > 0)
            {
                s = common_app.get_suc;
            }
            return(s);
        }
예제 #2
0
        public string sk_ydzdj(string lsbh, string czy, string cznr, DateTime czsj, string xxzs)
        {
            string   s       = common_file.common_app.get_failure;
            string   yydh    = "";
            string   qymc    = "";
            string   krxm    = "";
            string   fjrb    = "";
            string   fjbh    = "";
            DateTime yd_ddsj = DateTime.Parse(common_file.common_app.cssj);
            DateTime yd_lksj = DateTime.Parse(common_file.common_app.cssj);

            BLL.Common B_Common  = new Hotel_app.BLL.Common();
            DataSet    DS_temp_2 = B_Common.GetList("select * from Qskyd_fjrb", "lsbh='" + lsbh + "' and fjbh<>'' and yddj='" + common_file.common_yddj.yddj_yd + "'");

            if (DS_temp_2 != null && DS_temp_2.Tables[0].Rows.Count > 0)
            {
                yydh    = DS_temp_2.Tables[0].Rows[0]["yydh"].ToString();
                qymc    = DS_temp_2.Tables[0].Rows[0]["qymc"].ToString();
                krxm    = DS_temp_2.Tables[0].Rows[0]["krxm"].ToString();
                fjrb    = DS_temp_2.Tables[0].Rows[0]["fjrb"].ToString();
                fjbh    = DS_temp_2.Tables[0].Rows[0]["fjbh"].ToString();
                yd_ddsj = DateTime.Parse(DS_temp_2.Tables[0].Rows[0]["ddsj"].ToString());
                yd_lksj = DateTime.Parse(DS_temp_2.Tables[0].Rows[0]["lksj"].ToString());
                Qskyd_fjrb_add_edit_delete Qskyd_fjrb_add_edit_delete_new = new Qskyd_fjrb_add_edit_delete();
                s = Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(DS_temp_2.Tables[0].Rows[0]["id"].ToString(), DS_temp_2.Tables[0].Rows[0]["yydh"].ToString(), DS_temp_2.Tables[0].Rows[0]["qymc"].ToString(), lsbh, DS_temp_2.Tables[0].Rows[0]["krxm"].ToString(), "", DS_temp_2.Tables[0].Rows[0]["yddj"].ToString(), DS_temp_2.Tables[0].Rows[0]["fjrb"].ToString(), DS_temp_2.Tables[0].Rows[0]["fjbh"].ToString(), czsj, DateTime.Parse(DS_temp_2.Tables[0].Rows[0]["lksj"].ToString()), decimal.Parse(DS_temp_2.Tables[0].Rows[0]["lzfs"].ToString()), DS_temp_2.Tables[0].Rows[0]["shqh"].ToString(), decimal.Parse(DS_temp_2.Tables[0].Rows[0]["fjjg"].ToString()), decimal.Parse(DS_temp_2.Tables[0].Rows[0]["sjfjjg"].ToString()), DS_temp_2.Tables[0].Rows[0]["yh"].ToString(), decimal.Parse(DS_temp_2.Tables[0].Rows[0]["yhbl"].ToString()), DS_temp_2.Tables[0].Rows[0]["bz"].ToString(), czy, czsj, cznr, common_file.common_yddj.yddj_ydzdj, common_file.common_app.get_edit, xxzs, DS_temp_2.Tables[0].Rows[0]["fjbm"].ToString(), decimal.Parse(DS_temp_2.Tables[0].Rows[0]["jcje"].ToString()));
            }
            DS_temp_2.Dispose();
            if (s == common_file.common_app.get_suc)
            {
                s = common_file.common_app.get_failure;
                if (B_Common.ExecuteSql("update Qskyd_mainrecord set ddsj='" + czsj + "',yddj='" + common_file.common_yddj.yddj_dj + "' where lsbh='" + lsbh + "'") > 0)
                {
                    if (fjbh != "")
                    {
                        B_Common.ExecuteSql("update Ffjzt set zyzt_second='',yd_ddsj='" + common_file.common_app.cssj + "',yd_lksj='" + common_file.common_app.cssj + "' where fjbh='" + fjbh + "' and zyzt_second='" + common_file.common_yddj.yddj_yd + "' and yd_ddsj='" + yd_ddsj.ToString() + "' and yd_lksj='" + yd_lksj.ToString() + "'");
                    }
                    s = common_file.common_app.get_suc;
                }
            }
            if (s == common_file.common_app.get_suc)
            {
                //在这里判断是否是从预定中心来的单子
                DataSet ds_ydzx = B_Common.GetList(" select * from View_Qskzd ", " id>=0 and yydh='" + yydh + "' and ddyy='" + common_file_server.common_app.ydzx_flage + "' and lsbh='" + lsbh + "'  and main_sec='" + common_file.common_app.main_sec_main + "'  and shsc=0 ");
                if (ds_ydzx != null && ds_ydzx.Tables[0].Rows.Count > 0)
                {
                    Hotel_app.Server.Qyddj.Q_ff_xyxf Q_ff_xyxf_new = new Hotel_app.Server.Qyddj.Q_ff_xyxf();
                    Q_ff_xyxf_new.Qyddj_otherfee_add(yydh, qymc, lsbh, ds_ydzx.Tables[0].Rows[0]["krxm"].ToString(), ds_ydzx.Tables[0].Rows[0]["sktt"].ToString(), "", czy);


                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    sb.Append(" insert into    Qyqskyd_ydzlzmx(yydh, qymc, lsbh, fjrb, fjbh, sjjg, ddsj, lksj, ddrq, lkrq, lzrx, lzfs, shsc, scsj )");
                    sb.Append("  select  yydh,qymc,lsbh,fjrb,fjbh,sjfjjg,ddsj,lksj,ddsj,lksj,1,lzfs,0,'" + czsj + "'  from  View_Qskzd   where lsbh='" + lsbh + "' and yydh='" + yydh + "'  and  main_sec='" + common_file.common_app.main_sec_main + "' ");
                    B_Common.ExecuteSql(sb.ToString());
                }

                if (yydh != "")
                {
                    common_file.common_czjl.add_czjl(yydh, qymc, czy, common_file.common_yddj.yddj_ydzdj, krxm + "_" + fjrb + "_" + fjbh, lsbh, czsj);
                }
            }
            return(s);
        }
예제 #3
0
        private void b_delete_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (DS_ff_xyxf != null && DS_ff_xyxf.Tables[0].Rows.Count > 0)
            {
                if (common_file.common_app.message_box_show_select(common_file.common_app.message_title, "是否要删除所选中的记录!") == true)
                {
                    int j = 0; string s = "";
                    for (int i = 0; i < dg_count; i++)
                    {
                        common_file.common_app.get_czsj();
                        DataGridViewDataErrorContexts ss = new DataGridViewDataErrorContexts();
                        if (this.dg_ff_xyxf.Rows[i].Cells[0].GetEditedFormattedValue(i, ss) != null && Convert.ToBoolean(this.dg_ff_xyxf.Rows[i].Cells[0].GetEditedFormattedValue(i, ss)) == true)
                        {
                            //j = Convert.ToInt32(dg_ff_xyxf.Rows[i].Index.ToString());
                            DataRowView dgr = dg_ff_xyxf.SelectedRows[0].DataBoundItem as DataRowView;
                            dgr = dg_ff_xyxf.CurrentRow.DataBoundItem as DataRowView;
                            j   = DS_ff_xyxf.Tables[0].Rows.IndexOf(dgr.Row);

                            if (DS_ff_xyxf.Tables[0].Rows[j]["id"].ToString() != "")
                            {
                                //id,yydh, qymc, fyrx, xfdr, xfrb, xfxm, xfsl, xfje,

                                //add_edit_delete, czy, czsj, cznr, xxzs,jjje,mxbh)
                                string   url  = common_file.common_app.service_url + "Qyddj/Qyddj_app.asmx";
                                object[] args = new object[16];
                                args[0]  = DS_ff_xyxf.Tables[0].Rows[j]["id"].ToString();
                                args[1]  = common_file.common_app.yydh;
                                args[2]  = common_file.common_app.qymc;
                                args[3]  = "";
                                args[4]  = "";
                                args[5]  = "";
                                args[6]  = "";
                                args[7]  = decimal.Parse("0");
                                args[8]  = decimal.Parse("0");
                                args[9]  = common_file.common_app.get_delete;
                                args[10] = common_file.common_app.czy;
                                args[11] = DateTime.Now;
                                args[12] = common_file.common_app.chinese_delete;
                                args[13] = common_file.common_app.xxzs;
                                args[14] = decimal.Parse("0");
                                args[15] = "";

                                Hotel_app.Server.Qyddj.Q_ff_xyxf Q_ff_xyxf_services = new Hotel_app.Server.Qyddj.Q_ff_xyxf();
                                string result = Q_ff_xyxf_services.add_edit_delete_Q_ff_xyxf(args[0].ToString(), args[1].ToString(), args[2].ToString(), args[3].ToString(), args[4].ToString(), args[5].ToString(), args[6].ToString(), decimal.Parse(args[7].ToString()), decimal.Parse(args[8].ToString()), args[9].ToString(), args[10].ToString(), DateTime.Parse(args[11].ToString()), args[12].ToString(), args[13].ToString(), decimal.Parse(args[14].ToString()), args[15].ToString());
                                // object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "add_edit_delete_Q_ff_xyxf", args);
                                if (result == common_file.common_app.get_suc && (s == common_file.common_app.get_suc || s == ""))
                                {
                                    s = common_file.common_app.get_suc;
                                }
                                else
                                {
                                    s = common_file.common_app.get_failure;
                                }
                            }
                        }
                    }
                    if (s == common_file.common_app.get_suc)
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "删除成功!");
                    }
                    else
                    if (s == common_file.common_app.get_failure)
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "删除不成功!");
                    }
                    Refresh_app();
                }
            }
            Cursor.Current = Cursors.Default;
        }
예제 #4
0
        private void b_save_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            string ddsj = common_file.common_app.cssj;
            string lksj = common_file.common_app.cssj;

            if (tB_xfrb.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "请选择消费类别");
                return;
            }
            else
            if (((Maticsoft.Common.PageValidate.IsDecimal(tB_xfsl.Text.Trim()) || Maticsoft.Common.PageValidate.IsNumber(tB_xfsl.Text.Trim())) == false))
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,所输入的数量不是有效数值!");
                tB_xfsl.Focus();
                tB_xfsl.SelectAll();
            }
            else
            if (((Maticsoft.Common.PageValidate.IsDecimal(tB_xfje.Text.Trim()) || Maticsoft.Common.PageValidate.IsNumber(tB_xfje.Text.Trim())) == false))
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,所输入的数量不是有效数值!");
                tB_xfje.Focus();
                tB_xfje.SelectAll();
            }
            else
            {
                if (sel_model == "xf")
                {
                    BLL.Common B_common = new Hotel_app.BLL.Common();
                    DataSet    ds_0     = null;
                    //  czsj, syzd,add_edit_delete, xxzs,jjje
                    id_app = common_file.common_ddbh.ddbh("xfmx", "lsbhdate", "lsbhcounter", 6);
                    string zd_id = "";
                    if (sk_tt == "sk")
                    {
                        ds_0 = B_common.GetList(" select * from View_Qskzd ", " id>=0  " + common_file.common_app.yydh_select + "  and lsbh='" + lsbh + "'   and    main_sec='" + common_file.common_app.main_sec_main + "'");
                        if (ds_0 != null && ds_0.Tables[0].Rows.Count > 0)
                        {
                            zd_id = ds_0.Tables[0].Rows[0]["id"].ToString();
                            ddsj  = ds_0.Tables[0].Rows[0]["ddsj"].ToString();
                            lksj  = ds_0.Tables[0].Rows[0]["lksj"].ToString();
                            if (ds_0.Tables[0].Rows[0]["yddj"].ToString() == common_file.common_yddj.yddj_yd)
                            {
                                zwmx_czzt = common_file.common_yddj.yddj_yd;
                            }
                            if (ds_0.Tables[0].Rows[0]["yddj"].ToString() == common_file.common_yddj.yddj_dj)
                            {
                                zwmx_czzt = common_file.common_yddj.yddj_dj;
                            }
                        }
                    }
                    if (sk_tt == "tt")
                    {
                        ds_0 = B_common.GetList(" select * from View_Qttzd ", " id>=0  " + common_file.common_app.yydh_select + "  and lsbh='" + lsbh + "' ");
                        if (ds_0 != null && ds_0.Tables[0].Rows.Count > 0)
                        {
                            zd_id = ds_0.Tables[0].Rows[0]["id"].ToString();
                            ddsj  = ds_0.Tables[0].Rows[0]["ddsj"].ToString();
                            lksj  = ds_0.Tables[0].Rows[0]["lksj"].ToString();
                            if (ds_0.Tables[0].Rows[0]["yddj"].ToString() == common_file.common_yddj.yddj_yd)
                            {
                                zwmx_czzt = common_file.common_yddj.yddj_yd;
                            }
                            if (ds_0.Tables[0].Rows[0]["yddj"].ToString() == common_file.common_yddj.yddj_dj)
                            {
                                zwmx_czzt = common_file.common_yddj.yddj_dj;
                            }
                        }
                    }
                    string   url  = common_file.common_app.service_url + "Szwgl/Szwgl_app.asmx";
                    object[] args = new object[30];
                    args[0] = zd_id;
                    args[1] = sk_tt;
                    args[2] = "";
                    if (sk_tt == "sk")
                    {
                        args[3] = common_file.common_app.yydh;
                        args[4] = common_file.common_app.qymc;
                    }
                    if (sk_tt == "tt")
                    {
                        args[3] = common_file.common_app.yydh;
                        args[4] = common_file.common_app.qymc;
                    }
                    args[5] = id_app;
                    //xfrq, xfsj, czy
                    args[6] = DateTime.Now.ToString("yyyy-MM-dd");
                    args[7] = DateTime.Now.ToString();
                    args[8] = common_file.common_app.czy;
                    //xfdr, xfrb, xfxm, xfbz, xfzy, xfje, yh, sjxfje, xfsl, czy_bc, czzt,
                    args[9]  = xfdr;                                  //这里是找出节点的付款大类
                    args[10] = tB_xfrb.Text.Trim();                   //消费小类
                    args[11] = tB_xfxm.Text.Trim().Replace("'", "-"); //消费明细
                    if (args[11].ToString() == "")
                    {
                        args[11] = args[10];
                    }
                    if (ds_0 != null && ds_0.Tables[0].Rows.Count > 0 && sk_tt == "sk" && tB_xfbz.Text.Trim().Replace("'", "-") == "")
                    {
                        args[12] = ds_0.Tables[0].Rows[0]["fjbh"].ToString();
                    }
                    else
                    {
                        args[12] = tB_xfbz.Text.Trim().Replace("'", "-");
                    }
                    args[13] = tb_tm.Text.Trim().Replace("'", "-");//tB_xfbz.Text.Trim().Replace("'", "-");
                    args[14] = common_file.common_sswl.Round_sswl(double.Parse(tB_xfje.Text.Trim().Replace("'", "_")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString();
                    args[15] = "";
                    args[16] = common_file.common_sswl.Round_sswl(double.Parse(tB_xfje.Text.Trim().Replace("'", "_")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString();
                    args[17] = tB_xfsl.Text.Trim().Replace("'", "-");
                    args[18] = common_file.common_app.czy_bc;
                    args[19] = zwmx_czzt;//这里要根据主单的yddj的类型(预订,在住,记帐,挂帐)
                    args[20] = DateTime.Now.ToString();
                    args[21] = common_file.common_app.syzd;
                    args[22] = common_file.common_app.get_add;
                    args[23] = common_file.common_app.xxzs;
                    args[24] = jjje.ToString();
                    args[25] = "";
                    args[26] = "";
                    args[27] = mxbh;
                    args[28] = ddsj;
                    args[29] = lksj;

                    Hotel_app.Server.Szwgl.Szwmx Szwmx_services = new Hotel_app.Server.Szwgl.Szwmx();
                    string result = Szwmx_services.Szwmx_add_edit(args[0].ToString(), args[1].ToString(), args[2].ToString(), args[3].ToString(), args[4].ToString(), args[5].ToString(), args[6].ToString(), args[7].ToString(), args[8].ToString(), args[9].ToString(), args[10].ToString(), args[11].ToString(), args[12].ToString(), args[13].ToString(), args[14].ToString(), args[15].ToString(), args[16].ToString(), args[17].ToString(), args[18].ToString(), args[19].ToString(), args[20].ToString(), args[21].ToString(), args[22].ToString(), args[23].ToString(), args[24].ToString(), args[25].ToString(), args[26].ToString(), args[27].ToString(), args[28].ToString(), args[29].ToString());
                    //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Szwmx_add_edit", args);
                    if (result != null && result == common_file.common_app.get_suc)
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "增加消费成功!");
                        xrbh         = ""; xfdr = ""; xfje = 0; xfmx = ""; jjje = 0; mxbh = "";
                        tB_xfrb.Text = ""; tB_xfxm.Text = ""; tB_xfsl.Text = "1"; tB_xfje.Text = "0";
                        tB_xfbz.Text = ""; mxbh = ""; tb_tm.Text = ""; tb_tm.Focus();
                        if (judge_add_edit == common_file.common_app.get_add)
                        {
                            common_file.common_form.Szwcl_new.BindData(lsbh, common_file.common_app.czy_GUID);
                        }
                        else if (judge_add_edit == common_file.common_app.get_edit)
                        {
                            this.Close();
                        }
                    }
                    else
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败!");
                    }
                }
                else
                if (sel_model == "xyxf")
                {
                    if (cB_fyrx.Text.Trim() == "")
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "请选择费用类型!");
                        return;
                    }
                    string   url  = common_file.common_app.service_url + "Qyddj/Qyddj_app.asmx";
                    object[] args = new object[16];
                    args[0] = Q_xy_xyxf_id;
                    args[1] = common_file.common_app.yydh;
                    args[2] = common_file.common_app.qymc;
                    args[3] = cB_fyrx.Text.Trim().Replace("'", "-");
                    args[4] = xfdr;
                    args[5] = tB_xfrb.Text.Trim().Replace("'", "-");
                    args[6] = tB_xfxm.Text.Trim().Replace("'", "-");
                    if (args[6].ToString() == "")
                    {
                        args[6] = args[5];
                    }
                    args[7]  = decimal.Parse(tB_xfsl.Text.Trim().Replace("'", "-"));
                    args[8]  = decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(tB_xfje.Text.Trim().Replace("'", "-")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                    args[9]  = judge_add_edit;
                    args[10] = common_file.common_app.czy;
                    args[11] = DateTime.Now;
                    if (judge_add_edit == common_file.common_app.get_add)
                    {
                        args[12] = common_file.common_app.chinese_add;
                    }
                    else
                    if (judge_add_edit == common_file.common_app.get_edit)
                    {
                        args[12] = common_file.common_app.chinese_edit;
                    }
                    args[13] = common_file.common_app.xxzs;
                    args[14] = jjje;
                    args[15] = mxbh;

                    Hotel_app.Server.Qyddj.Q_ff_xyxf Q_ff_xyxf_services = new Hotel_app.Server.Qyddj.Q_ff_xyxf();
                    string result = Q_ff_xyxf_services.add_edit_delete_Q_ff_xyxf(args[0].ToString(), args[1].ToString(), args[2].ToString(), args[3].ToString(), args[4].ToString(), args[5].ToString(), args[6].ToString(), Decimal.Parse(args[7].ToString()), Decimal.Parse(args[8].ToString()), args[9].ToString(), args[10].ToString(), DateTime.Parse(args[11].ToString()), args[12].ToString(), args[13].ToString(), decimal.Parse(args[14].ToString()), args[15].ToString());
                    //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "add_edit_delete_Q_ff_xyxf", args);
                    if (result == common_file.common_app.get_suc)
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "保存成功!");
                        this.Close();
                        xrbh = ""; xfdr = ""; xfje = 0; xfmx = ""; jjje = 0;
                    }
                    else
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败!");
                    }
                }

/////////////////这里改单

                else if (sel_model == "xf_gd")
                {
                    BLL.Common B_common = new Hotel_app.BLL.Common();
                    DataSet    ds_0     = null;
                    //  czsj, syzd,add_edit_delete, xxzs,jjje
                    id_app = common_file.common_ddbh.ddbh("xfmx", "lsbhdate", "lsbhcounter", 6);

                    if (gd_jzzd.Trim() != "" && gd_lsbh.Trim() == "")
                    {
                        DataSet ds_1    = B_common.GetList(" SELECT * FROM Sjzzd ", " id>=0  and yydh='" + common_file.common_app.yydh + "' and jzbh='" + gd_jzzd + "' ");
                        string  xfsj_gd = (DateTime.Parse(ds_1.Tables[0].Rows[0]["tfsj"].ToString()).AddDays(-1)).ToString();
                        string  xfrq_gd = (DateTime.Parse(ds_1.Tables[0].Rows[0]["tfsj"].ToString()).AddDays(-1)).ToShortDateString();

                        if (ds_1 != null && ds_1.Tables[0].Rows.Count > 0)
                        {
                            StringBuilder sb = new StringBuilder();
                            sb.Append(" insert into  Sjzmx_gd_temp (yydh, qymc,  id_app, jzbh, krxm, fjrb, fjbh, sktt, xfrq, xfsj, czy, xfrb, xfdr, xfxm, xfbz, xfzy, jjje, yh, xfje, sjxfje, xfsl, czzt, czy_bc, tfsj, czsj, syzd, xyh, jzzt, fkfs, mxbh, zd_fkje, zd_xfje, zd_ddsj, zd_tfsj, zd_fjbh, zd_krxm_lz, zd_fjbh_lz, czy_temp, lsbh )");
                            sb.Append("  select  yydh,qymc,'" + id_app + "',jzbh,krxm,'',fjbh,sktt,'" + xfrq_gd + "','" + xfsj_gd + "',czy,'" + tB_xfrb.Text.Trim().Replace("'", "-") + "','" + xfdr + "','" + tB_xfxm.Text.Trim().Replace("'", "-") + "','" + tB_xfbz.Text.Trim().Replace("'", "-") + "','',0,'','" + tB_xfje.Text.Trim().Replace("'", "-") + "','" + tB_xfje.Text.Trim().Replace("'", "-") + "',1,czzt, '早班', tfsj, czsj, syzd, xyh, jzzt, '', '',fkje,xfje,ddsj,tfsj,fjbh,krxm_lz,fjbh_lz,'" + common_file.common_app.czy_GUID + "',lsbh  from  Sjzzd ");
                            sb.Append(" where jzbh='" + gd_jzzd + "' and yydh='" + common_file.common_app.yydh + "' ");
                            if (B_common.ExecuteSql(sb.ToString()) > 0)
                            {
                                this.DialogResult = DialogResult.OK;
                                common_file.common_app.Message_box_show(common_file.common_app.message_title, "改单增加消费成功!");
                                xrbh         = ""; xfdr = ""; xfje = 0; xfmx = ""; jjje = 0;
                                tB_xfrb.Text = ""; tB_xfxm.Text = ""; tB_xfsl.Text = "1"; tB_xfje.Text = "0";
                                tB_xfbz.Text = ""; mxbh = "";
                            }
                        }
                    }
                    else if (gd_jzzd.Trim() == "" && gd_lsbh.Trim() != "" && sk_tt.Trim() != "")
                    {
                        string        xfsj_gd = DateTime.Now.ToString();
                        string        xfrq_gd = DateTime.Now.ToString();
                        DataSet       ds_1    = null;
                        StringBuilder sb      = null;
                        if (sk_tt == "sk")
                        {
                            ds_1 = B_common.GetList(" SELECT * FROM View_Qskzd ", " id>=0  and yydh='" + common_file.common_app.yydh + "' and lsbh='" + gd_lsbh + "' and main_sec='" + common_file.common_app.main_sec_main + "' ");
                        }
                        if (sk_tt == "tt")
                        {
                            ds_1 = B_common.GetList(" SELECT * FROM View_Qttzd ", " id>=0  and yydh='" + common_file.common_app.yydh + "' and lsbh='" + gd_lsbh + "'");
                        }
                        if (ds_1 != null && ds_1.Tables[0].Rows.Count > 0)
                        {
                            if (sk_tt == "sk")
                            {
                                sb = new StringBuilder();
                                sb.Append(" insert into  Sjzmx_gd_temp (yydh, qymc,  id_app, jzbh, krxm, fjrb, fjbh, sktt, xfrq, xfsj, czy, xfrb, xfdr, xfxm, xfbz, xfzy, jjje, yh, xfje, sjxfje, xfsl, czzt, czy_bc, tfsj, czsj, syzd, xyh, jzzt, fkfs, mxbh, zd_fkje, zd_xfje, zd_ddsj, zd_tfsj, zd_fjbh, zd_krxm_lz, zd_fjbh_lz, czy_temp, lsbh )");
                                sb.Append("  select  yydh,qymc,'" + id_app + "','',krxm,'',fjbh,sktt,'" + xfrq_gd + "','" + xfsj_gd + "','" + common_file.common_app.czy + "','" + tB_xfrb.Text.Trim().Replace("'", "-") + "','" + xfdr + "','" + tB_xfxm.Text.Trim().Replace("'", "-") + "','" + tB_xfbz.Text.Trim().Replace("'", "-") + "','',0,'','" + tB_xfje.Text.Trim().Replace("'", "-") + "','" + tB_xfje.Text.Trim().Replace("'", "-") + "',1,'', '早班','" + DateTime.Now.ToString() + "','" + DateTime.Now.ToString() + "', syzd, '', krxm, '', '',fkje,xfje,ddsj,'" + DateTime.Now.ToString() + "',fjbh,krxm,fjbh,'" + common_file.common_app.czy_GUID + "',lsbh  from  View_Qskzd ");
                                sb.Append(" where lsbh='" + gd_lsbh + "' and yydh='" + common_file.common_app.yydh + "' and main_sec='" + common_file.common_app.main_sec_main + "' ");
                            }
                            if (sk_tt == "tt")
                            {
                                sb = new StringBuilder();
                                sb.Append(" insert into  Sjzmx_gd_temp (yydh, qymc,  id_app, jzbh, krxm, fjrb, fjbh, sktt, xfrq, xfsj, czy, xfrb, xfdr, xfxm, xfbz, xfzy, jjje, yh, xfje, sjxfje, xfsl, czzt, czy_bc, tfsj, czsj, syzd, xyh, jzzt, fkfs, mxbh, zd_fkje, zd_xfje, zd_ddsj, zd_tfsj, zd_fjbh, zd_krxm_lz, zd_fjbh_lz, czy_temp, lsbh )");
                                sb.Append("  select  yydh,qymc,'" + id_app + "','',krxm,'','',sktt,'" + xfrq_gd + "','" + xfsj_gd + "','" + common_file.common_app.czy + "','" + tB_xfrb.Text.Trim().Replace("'", "-") + "','" + xfdr + "','" + tB_xfxm.Text.Trim().Replace("'", "-") + "','" + tB_xfbz.Text.Trim().Replace("'", "-") + "','',0,'','" + tB_xfje.Text.Trim().Replace("'", "-") + "','" + tB_xfje.Text.Trim().Replace("'", "-") + "',1,'', '早班','" + DateTime.Now.ToString() + "','" + DateTime.Now.ToString() + "', syzd, '', krxm, '', '',fkje,xfje,ddsj,'" + DateTime.Now.ToString() + "','',krxm,'','" + common_file.common_app.czy_GUID + "',lsbh  from  View_Qttzd ");
                                sb.Append(" where lsbh='" + gd_lsbh + "' and yydh='" + common_file.common_app.yydh + "' ");
                            }
                            if (B_common.ExecuteSql(sb.ToString()) > 0)
                            {
                                this.DialogResult = DialogResult.OK;
                                common_file.common_app.Message_box_show(common_file.common_app.message_title, "改单增加消费成功!");
                                xrbh         = ""; xfdr = ""; xfje = 0; xfmx = ""; jjje = 0;
                                tB_xfrb.Text = ""; tB_xfxm.Text = ""; tB_xfsl.Text = "1"; tB_xfje.Text = "0";
                                tB_xfbz.Text = ""; mxbh = "";
                            }
                        }


                        if (sk_tt == "tt")
                        {
                        }
                    }
                    else
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "没有主单,无法进行改单操作!");
                    }
                }
                /////改单结束
            }

            Cursor.Current = Cursors.Default;
        }