Пример #1
0
        private void b_save_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (tB_xfxm.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "请关闭此窗体,选择冲帐项目");
                return;
            }
            else
            if (((Maticsoft.Common.PageValidate.IsDecimal(tB_je.Text.Trim()) || Maticsoft.Common.PageValidate.IsNumber(tB_je.Text.Trim())) == false))
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,所输入的数量不是有效数值!");
                tB_je.Focus();
                tB_je.SelectAll(); return;
            }
            else
            if (((Maticsoft.Common.PageValidate.IsDecimalSign(tB_sl.Text.Trim()) || Maticsoft.Common.PageValidate.IsNumberSign(tB_sl.Text.Trim())) == false))
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,所输入的数量不是有效数值!");
                tB_sl.Focus();
                tB_sl.SelectAll(); return;
            }
            id_app_new = common_file.common_ddbh.ddbh("xfmx", "lsbhdate", "lsbhcounter", 6);
            Hotel_app.Server.Szwgl.Szwmx Szwmx_serverice = new Hotel_app.Server.Szwgl.Szwmx();

            string Result = Szwmx_serverice.Szwmx_add_edit("", "", old_id_app, common_file.common_app.yydh, common_file.common_app.qymc, id_app_new, DateTime.Parse(tB_sj.Text.Trim()).ToString("yyyy-MM-dd"), tB_sj.Text.Trim(), common_file.common_app.czy, xfdr, xfrb, tB_xfxm.Text.Trim().Replace("'", "-"), GetBzInfo(tb_bz.Text), CzOrBz, common_file.common_sswl.Round_sswl(double.Parse(tB_je.Text.Trim().Replace("'", "_")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString(), "", common_file.common_sswl.Round_sswl(double.Parse(tB_je.Text.Trim().Replace("'", "_")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString(), tB_sl.Text.Trim().Replace("'", "-"),
                                                           common_file.common_app.czy_bc, CzOrBz, DateTime.Now.ToString(), common_file.common_app.syzd, common_file.common_app.get_add, common_file.common_app.xxzs, "0", "", "", mxbh, ddsj, lksj);

            if (Result.Equals(common_file.common_app.get_suc))
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败");
            }



            //string url = common_file.common_app.service_url + "Szwgl/Szwgl_app.asmx";
            //id_app_new = common_file.common_ddbh.ddbh("xfmx", "lsbhdate", "lsbhcounter", 6);
            //object[] args = new object[30];
            ////zd_id,sktt,old_id_app, yydh, qymc, id_app, xfrq

            //args[0] ="";
            //args[1] ="";
            //args[2] = old_id_app;  //要冲补帐的那条
            //args[3] = common_file.common_app.yydh;
            //args[4] = common_file.common_app.qymc;
            //args[5] = id_app_new;   //新生成的id_app
            ////xfrq, xfsj, czy
            //args[6] = DateTime.Parse(tB_sj.Text.Trim()).ToString("yyyy-MM-dd");   // DateTime.Now.ToString("yyyy-MM-dd");
            //args[7] = tB_sj.Text.Trim();
            //args[8] = common_file.common_app.czy;
            ////xfdr, xfrb, xfxm, xfbz, xfzy, xfje, yh, sjxfje, xfsl, czy_bc, czzt,
            //args[9] = xfdr;
            //args[10] = xfrb;
            //args[11] = tB_xfxm.Text.Trim().Replace("'", "-");
            //args[12] = GetBzInfo(tb_bz.Text);//tb_bz.Text.Trim().Replace("'", "-");
            //args[13] = CzOrBz;
            //args[14] = common_file.common_sswl.Round_sswl(double.Parse(tB_je.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_je.Text.Trim().Replace("'", "_")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString();
            //args[17] = tB_sl.Text.Trim().Replace("'", "-");
            //args[18] = common_file.common_app.czy_bc;
            //args[19] = CzOrBz;//这里要根据主单的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] = "0";
            //args[25] = "";
            //args[26] = "";
            //args[27] = mxbh;
            //args[28] = ddsj;
            //args[29] = lksj;
            //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Szwmx_add_edit", args);
            //{
            //    if (result != null && result.ToString() == common_file.common_app.get_suc)
            //    {
            //        //common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作成功");
            //        this.DialogResult = DialogResult.OK;
            //        this.Close();
            //    }
            //    else
            //    {
            //        common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败");
            //    }
            //}
        }
Пример #2
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;
        }
Пример #3
0
        private void Add_btff()
        {
            string[] list_lsbh  = new string[100];
            int      temp_count = 0;

            for (int i = 0; i < list_lsbh.Length; i++)
            {
                list_lsbh[i] = "";    //初始化为空
            }
            if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 0)
            {
                for (int j = 0; j < ds_temp.Tables[0].Rows.Count; j++)
                {
                    common_file.common_app.get_czsj();
                    DataGridViewDataErrorContexts ss = new DataGridViewDataErrorContexts();
                    if (this.dg_jzgl.Rows[j].Cells[2].GetEditedFormattedValue(j, ss) != null && Convert.ToBoolean(this.dg_jzgl.Rows[j].Cells[2].GetEditedFormattedValue(j, ss)) == true)
                    {
                        if (this.dg_jzgl.Rows[j].Cells["fjbh"].Value != null)
                        {
                            add_ff       = common_zw.ff_jsbtfy;
                            list_lsbh[j] = ds_temp.Tables[0].Rows[dg_jzgl.Rows[j].Index]["lsbh"].ToString();
                        }
                    }
                    if (this.dg_jzgl.Rows[j].Cells[3].GetEditedFormattedValue(j, ss) != null && Convert.ToBoolean(this.dg_jzgl.Rows[j].Cells[3].GetEditedFormattedValue(j, ss)) == true)
                    {
                        if (this.dg_jzgl.Rows[j].Cells["fjbh"].Value != null)
                        {
                            add_ff = common_zw.ff_jsqtfy;
                            int i_0 = 0;

                            DataRowView dgr = dg_jzgl.Rows[j].DataBoundItem as DataRowView;
                            i_0 = ds_temp.Tables[0].Rows.IndexOf(dgr.Row);

                            list_lsbh[j] = ds_temp.Tables[0].Rows[i_0]["lsbh"].ToString();
                        }
                    }
                }
            }
            //判断当前的数组里面是否有值
            foreach (string ss_temp in list_lsbh)
            {
                if (ss_temp.Trim() != "")
                {
                    temp_count += 1;
                    break;
                }
            }

            if (temp_count > 0)
            {
                if (common_file.common_app.message_box_show_select(common_file.common_app.message_title, "确定要对以上所选的房间加收" + add_ff + "?") == true)
                {
                    common_file.common_app.get_czsj();
                    string url = common_file.common_app.service_url;
                    url += "Szwgl/Szwgl_app.asmx";
                    object[] args = new object[10];
                    args[0] = common_file.common_app.yydh;
                    args[1] = common_file.common_app.qymc;
                    args[2] = list_lsbh;
                    args[3] = add_ff;    //半天还是全天
                    args[4] = "bbd";
                    args[5] = common_file.common_app.czy_bc;
                    args[6] = common_file.common_app.syzd;
                    args[7] = common_file.common_app.czy;
                    args[8] = DateTime.Now;
                    args[9] = common_file.common_app.xxzs;

                    Hotel_app.Server.Szwgl.Szwmx Szwmx_services = new Hotel_app.Server.Szwgl.Szwmx();
                    string result = Szwmx_services.New_muli_fjfy(args[0].ToString(), args[1].ToString(), list_lsbh, args[3].ToString(), args[4].ToString(), args[5].ToString(), args[6].ToString(), args[7].ToString(), DateTime.Parse(args[8].ToString()), args[9].ToString());
                    //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "New_muli_fjfy", args);
                    if (result != null && result == common_file.common_app.get_suc)
                    {
                        //common_file.common_app.Message_box_show(common_file.common_app.message_title, "保存成功!");
                    }
                }
            }
        }