Beispiel #1
0
        //private void display_new_commonform_1(string judge_type_0, int left_0, int top_0, TextBox TB_ls)
        //{
        //    common_file.common_app.get_czsj();
        //    Xxtsz.X_common_one X_common_one_new = new Hotel_app.Xxtsz.X_common_one();
        //    X_common_one_new.judge_type = judge_type_0;
        //    X_common_one_new.Left = common_file.common_app.x();
        //    X_common_one_new.Top = common_file.common_app.y();
        //    if (X_common_one_new.ShowDialog() == DialogResult.OK)
        //    {
        //        TB_ls.Text = X_common_one_new.get_value;
        //    }
        //    X_common_one_new.Dispose();
        //    TB_ls.Focus();
        //    Cursor.Current = Cursors.Default;
        //}

        private void b_save_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (checkTbValue())
            {
                id_app = common_file.common_ddbh.ddbh("pzsk", "lsbhdate", "lsbhcounter", 6);//平帐收款

                string   url  = common_file.common_app.service_url + "Szwgl/Szwgl_app.asmx";
                object[] args = new object[30];
                args[0] = "0";//Xxfxr_id
                args[1] = common_file.common_app.yydh;
                args[2] = common_file.common_app.qymc;
                args[3] = id_app;
                if ((openfrom == "Szw_Common") || (openfrom == "Sfjcz") || (openfrom == "Szw_pljz")) //部分算帐,记/挂分结都要生成新的jzbh
                {
                    args[4] = "";                                                                    //初始jzbh为空
                }
                if ((openfrom == "Sjjzwll"))
                {
                    args[4] = jzbh; //B_sjzmx.GetModelList("id>=0  " + common_file.common_app.yydh_select + " and  lsbh='" + lsbh + "'")[0].jzbh;
                }
                if (openfrom == "Szw_pljz")
                {
                    args[5] = common_file.common_ddbh.ddbh("gzpj", "lsbhdate", "lsbhcounter", 6);
                    //args[5] = this.lsbh;
                    args[6] = jzzt;
                    args[7] = "";
                    args[8] = "";
                    args[9] = "";
                }
                else
                {
                    args[5] = this.lsbh;
                    args[6] = jzzt;
                    args[7] = "";
                    args[8] = "";
                    args[9] = "";
                }
                if ((openfrom == "Szw_Common") || (openfrom == "Sfjcz" && jjType == common_file.common_jzzt.czzt_bfsz))//部分算帐才会在主单里面找
                {
                    if (sk_tt == "sk")
                    {
                        M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id>=0  " + common_file.common_app.yydh_select + "  and lsbh='" + this.lsbh + "'")[0];
                        M_Qskyd_fjrb       = B_Qskyd_fjrb.GetModelList("id>=0  " + common_file.common_app.yydh_select + "  and lsbh='" + this.lsbh + "'")[0];
                        args[6]            = M_Qskyd_mainrecord.krxm;
                        args[7]            = M_Qskyd_fjrb.fjrb;
                        args[8]            = M_Qskyd_fjrb.fjbh;
                        args[9]            = M_Qskyd_mainrecord.sktt;
                    }
                    if (sk_tt == "tt")
                    {
                        M_Qttyd_mainrecord = B_Qttyd_mainrecord.GetModelList("id>=0  " + common_file.common_app.yydh_select + "  and lsbh='" + this.lsbh + "'")[0];
                        args[6]            = M_Qttyd_mainrecord.krxm;
                        args[7]            = "";
                        args[8]            = "";
                        args[9]            = M_Qttyd_mainrecord.sktt;
                    }
                }
                //是从帐务浏览打开或者分结操作中的记/挂帐分结
                else if (openfrom == "Sjjzwll" || (openfrom == "Sfjcz" && (jjType == common_file.common_jzzt.czzt_gz || jjType == common_file.common_jzzt.czzt_jz)))//是从帐务浏览打开的
                {
                    if (sk_tt == "sk")
                    {
                        BLL.Common B_common = new Hotel_app.BLL.Common();
                        DataSet    ds_00    = B_common.GetList("select * from Sjzzd ", "id>=0  " + common_file.common_app.yydh_select + " and jzbh='" + jzbh + "'");
                        if (ds_00 != null && ds_00.Tables[0].Rows.Count > 0)
                        {
                            //M_Qskyd_mainrecord_bak = B_Qskyd_mainrecord_bak.GetModelList("id>=0  " + common_file.common_app.yydh_select + "  and lsbh='" + this.lsbh + "'")[0];
                            //M_Qskyd_fjrb_bak = B_Qskyd_fjrb_bak.GetModelList("id>=0  " + common_file.common_app.yydh_select + "  and lsbh='" + this.lsbh + "'")[0];
                            args[6] = ds_00.Tables[0].Rows[0]["krxm"].ToString();
                            args[7] = "";
                            args[8] = ds_00.Tables[0].Rows[0]["fjbh"].ToString();
                            args[9] = ds_00.Tables[0].Rows[0]["sktt"].ToString();
                        }
                    }
                    if (sk_tt == "tt")
                    {
                        //M_Qttyd_mainrecord_bak = B_Qttyd_mainrecord_bak.GetModelList("id>=0  " + common_file.common_app.yydh_select + "  and lsbh='" + this.lsbh + "'")[0];
                        BLL.Common B_common = new Hotel_app.BLL.Common();
                        DataSet    ds_00    = B_common.GetList("select * from Sjzzd ", "id>=0  " + common_file.common_app.yydh_select + " and jzbh='" + jzbh + "'");
                        if (ds_00 != null)
                        {
                            args[6] = ds_00.Tables[0].Rows[0]["krxm"].ToString();
                            args[7] = "";
                            args[8] = "";
                            args[9] = ds_00.Tables[0].Rows[0]["sktt"].ToString();
                        }
                        else
                        {
                            args[6] = "";
                            args[7] = "";
                            args[8] = "";
                            args[9] = "";
                        }
                    }
                }
                //xfrq,xfsj,czy,xfdr,xfrb,xfxm,xfbz,xfzy
                args[10] = DateTime.Now.ToString("yyyy-MM-dd");
                args[11] = DateTime.Now.ToString();
                args[12] = common_file.common_app.czy;
                args[13] = common_file.common_app.fkdr;//这里是找出节点的付款大类
                args[14] = common_file.common_app.dj_pzsk;
                args[15] = common_file.common_app.dj_pzsk;
                args[16] = "平帐时,客户再付款为:" + tB_krzfk.Text.Trim() + ";客户最后收回:" + tB_krxsh.Text.Trim();//摘要描述平帐时的操作
                args[17] = common_file.common_app.dj_pzsk;
                //xfje,yh,sjxfje,xfsl,czy_bc,czzt,czsj,syzd,add,xxzs
                if (krzqk > 0)
                {
                    args[18] = "-" + krzqk.ToString().Trim().Replace("'", "-");
                    args[20] = "-" + krzqk.ToString().Trim().Replace("'", "-");
                }
                if (krzqk < 0)
                {
                    args[18] = Math.Abs(krzqk).ToString().Trim().Replace("'", "-");
                    args[20] = Math.Abs(krzqk).ToString().Trim().Replace("'", "-");
                }
                args[19] = "";
                args[21] = "1";
                args[22] = common_file.common_app.czy_bc;
                if (openfrom == "Sjjzwll")
                {
                    string czzt_Temp = (jjType == common_file.common_jzzt.czzt_gz) ? common_file.common_jzzt.czzt_gzzsz : common_file.common_jzzt.czzt_jzzsz;
                    args[23] = czzt_Temp;
                }
                if (openfrom == "Sfjcz" && (jjType == common_file.common_jzzt.czzt_gz || jjType == common_file.common_jzzt.czzt_jz || jjType == common_file.common_jzzt.czzt_bfsz))
                {
                    string czzt_temp = "";
                    if (jjType == common_file.common_jzzt.czzt_gz || jjType == common_file.common_jzzt.czzt_gzfj)
                    {
                        czzt_temp = (jjType == common_file.common_jzzt.czzt_gz) ? jjType = common_file.common_jzzt.czzt_gzfj : jjType = common_file.common_jzzt.czzt_jzfj;
                    }
                    else
                    {
                        czzt_temp = common_file.common_jzzt.czzt_bfsz;
                    }
                    args[23] = czzt_temp;
                }
                else if (openfrom == "Szw_Common")
                {
                    args[23] = jjType;//挂,记,结 直接用(当结帐时要更改相应记录的状态)
                }
                else if (openfrom == "Szw_pljz")
                {
                    args[23] = common_file.common_jzzt.czzt_gzzsz;
                }
                //czsj, syzd, is_visible, add_edit_delete, xxzs,jjje
                //args[24] = common_file.common_app.xxzs,fkfs
                args[24] = DateTime.Now.ToString();
                args[25] = common_file.common_app.syzd;
                args[26] = common_file.common_app.get_add;
                args[27] = common_file.common_app.xxzs;
                args[28] = tB_fkfs.Text.Trim();
                args[29] = common_file.common_app.czy_GUID;

                Hotel_app.Server.Szwgl.Szw_jzOrgzOrSZ Szw_jzOrgzOrSZ_services = new Hotel_app.Server.Szwgl.Szw_jzOrgzOrSZ();

                string result = Szw_jzOrgzOrSZ_services.Sjzmx_pz(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, "Fun_PZ", args);
                if (result != null && result == common_file.common_app.get_suc)
                {
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, "平帐成功");
                    this.DialogResult = DialogResult.OK;
                    //common_file.common_form.Szwcz_new.pz_control = true;//成功后,可以结帐
                    this.Close();
                }
            }
            Cursor.Current = Cursors.Default;
        }
Beispiel #2
0
        public void b_save_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            url = common_file.common_app.service_url;
            //更新Qskyd_fqrb

            //M_Qskyd_fjrb = B_Qskyd_fjrb.GetModel(int.Parse(Qskdj_fjrb_id));



            if (this.tB_lzfs.Text.Trim() == "" || decimal.Parse(this.tB_lzfs.Text.Trim()) < 0)
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "请填写入住房数!");
                tB_lzfs.Focus();
                return;
            }



            if (yddj_type == common_file.common_app.yddj_type_personal)
            {
                common_file.common_app.get_czsj();
                #region 处理散客的部分

                //登记的时候
                if (this.yddj == common_file.common_yddj.yddj_dj)
                {
                    if (tB_fjrb.Text.Trim() == "")
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "请选择房型!");
                        tB_fjrb.Focus();
                        return;
                    }
                    if (tB_fjbh.Text.Trim() == "")
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "请选择房号!");
                        tB_fjbh.Focus();
                        return;
                    }

                    if (tB_lzfs.Text.Trim() == "")
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "登记状态下请将写入住房数不能为空!");
                        tB_lzfs.Focus();
                        tB_lzfs.SelectAll();
                        return;
                    }

                    else
                    {
                        int i_1 = 3;
                        if (M_Qskyd_fjrb == null)
                        {
                            i_1 = 3;
                        }
                        else
                        {
                            if (M_Qskyd_fjrb != null && (M_Qskyd_fjrb.lzfs == 0 && (decimal.Parse(tB_lzfs.Text)) == 0))
                            {
                                i_1 = 2;
                            }
                            else
                            {
                                i_1 = 3;
                            }
                        }
                        if (i_1 == 3)
                        {
                            if ((decimal.Parse(tB_lzfs.Text) - 1) != 0)
                            {
                                common_file.common_app.Message_box_show(common_file.common_app.message_title, "登记状态下请将写入住房数为1!");
                                tB_lzfs.Focus();
                                tB_lzfs.SelectAll();
                                return;
                            }
                        }
                    }

                    common_file.common_app.get_czsj();
                    M_Qskyd_fjrb = B_Qskyd_fjrb.GetModel(int.Parse(Qskdj_fjrb_id));
                    url         += "Qyddj/Qyddj_app.asmx";
                    object[] args = new object[26];
                    args[0]  = Qskdj_fjrb_id;
                    args[1]  = common_file.common_app.yydh;
                    args[2]  = common_file.common_app.qymc;
                    args[3]  = M_Qskyd_fjrb.lsbh;
                    args[4]  = M_Qskyd_fjrb.krxm;
                    args[5]  = M_Qskyd_fjrb.sktt;
                    args[6]  = M_Qskyd_fjrb.yddj;
                    args[7]  = tB_fjrb.Text.Trim().Replace("'", "_");
                    args[8]  = tB_fjbh.Text.Trim().Replace("'", "_");
                    args[9]  = M_Qskyd_fjrb.ddsj;
                    args[10] = M_Qskyd_fjrb.lksj;
                    if (tB_lzfs.Text.Trim() == "")
                    {
                        args[11] = 0;
                    }
                    else
                    {
                        args[11] = Convert.ToDecimal(tB_lzfs.Text.Trim().Replace("'", "_"));
                    }
                    args[12] = cB_shqh.Text.Trim().Replace("'", "_");
                    args[13] = decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(tB_fjjg.Text.Trim().Replace("'", "_")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                    args[14] = decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(tB_fjjg.Text.Trim().Replace("'", "_")) * double.Parse(yhbl.ToString()), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                    args[15] = tB_yh.Text.Trim().Replace("'", "_");
                    args[16] = yhbl;
                    args[17] = tB_bz.Text.Trim().Replace("'", "_");
                    args[18] = common_file.common_app.czy;
                    args[19] = DateTime.Now;
                    args[20] = common_file.common_app.chinese_edit;
                    args[21] = M_Qskyd_fjrb.yddj;//有三种状态,一种预订、一种登记、一种预订转登记
                    args[22] = judge_add_edit;
                    args[23] = common_file.common_app.xxzs;
                    args[24] = cB_fjbm.Text.Trim().Replace("'", "_");
                    args[25] = 0;
                    if (tB_jcje.Text.Trim() != "")
                    {
                        args[25] = decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(tB_jcje.Text.Trim().Replace("'", "_")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                    }
                    //先判断是否超排房

                    if (judge_add_edit == common_file.common_app.get_edit)
                    {
                        if (M_Qskyd_fjrb.fjbh != "")
                        {
                            if (decimal.Parse(args[11].ToString()) > 1)
                            {
                                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,已经排房的记录不能直接修改房数!");
                                return;
                            }
                        }
                    }


                    if (judge_kyfs(M_Qskyd_fjrb.krxm, tB_fjbh.Text, M_Qskyd_fjrb.lsbh) == true)
                    {
                        Hotel_app.Server.Qyddj.Qskyd_fjrb_add_edd_delete_1 Qskyd_fjrb_add_edd_delete_1_services = new Hotel_app.Server.Qyddj.Qskyd_fjrb_add_edd_delete_1();
                        string result = Qskyd_fjrb_add_edd_delete_1_services.Qskyd_fjrb_add_edit_delete_app_1(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(), DateTime.Parse(args[9].ToString()),
                                                                                                              DateTime.Parse(args[10].ToString()), Decimal.Parse(args[11].ToString()), args[12].ToString(), Decimal.Parse(args[13].ToString()), Decimal.Parse(args[14].ToString()), args[15].ToString(), Decimal.Parse(args[16].ToString()), args[17].ToString(), args[18].ToString(), DateTime.Parse(args[19].ToString()), args[20].ToString(), args[21].ToString(),
                                                                                                              args[22].ToString(), args[23].ToString(), args[24].ToString(), Decimal.Parse(args[25].ToString()));
                        //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Qskyd_fjrb_add_edit_delete_app", args);
                        //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Qskyd_fjrb_add_edit_delete_app_1", 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;
                            common_file.common_form.Qskdj_new.lsbh = M_Qskyd_fjrb.lsbh;
                            common_file.common_form.Qskdj_new.refresh_app();
                        }
                        else
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败!");
                        }
                    }
                }
                //预订
                if (this.yddj == common_file.common_yddj.yddj_yd)
                {
                    if (decimal.Parse(this.tB_lzfs.Text.Trim()) == 0)
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "请填写入住房数!");
                        tB_lzfs.Focus();
                        return;
                    }


                    common_file.common_app.get_czsj();
                    if (tB_fjrb.Text.Trim() == "")
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "请选择房间类型!");
                        return;
                    }
                    //新增,要判断  这种类型的房间是否有都排完
                    //修改时,类型有改变,要判断改后类型是存在未排完的
                    if (B_Qskyd_fjrb.GetModelList("yydh='" + common_file.common_app.yydh + "'  and lsbh='" + lsbh + "'  and fjbh='' and id!='" + Qskdj_fjrb_id + "' and  fjrb='" + tB_fjrb.Text + "'").Count > 0)
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "此种房型已经存在,不能再重新排同种房,如有需要增加请去修改数量!");
                        return;
                    }

                    //三种情况下判断是否发送短信:
                    //旧的房型为空,当前的不为空
                    //旧的不为空,当前的不等于旧的
                    //旧的不为空,当前的数量不等于旧的预定数量
                    bool dx_fs = false;//标注短信是否发送

                    //if (( (old_fx.Trim().Equals("") && !tB_fjrb.Text.Trim().Equals("")) || (!old_fx.Trim().Equals("") && !old_fx.Equals(tB_fjrb.Text.Trim())) || (!old_fx.Trim().Equals("")&&(old_fx.Equals(tB_fjrb.Text.Trim())&&!(old_fx_sl-decimal.Parse(tB_lzfs.Text.Trim())==0)))))
                    //{
                    //    if (common_file.common_app.message_box_show_select(common_file.common_app.message_title, "房型房间信息有更改,是否要提示发送短信给客人?"))
                    //    {
                    //        if (judge_add_edit.Equals(common_file.common_app.get_edit) || judge_add_edit.Equals(common_file.common_app.get_add))//修改当前的
                    //        {
                    //            dx_fs = true;
                    //            //Common_Qyddj.hy_yd_dx_tx(lsbh, tB_lzfs.Text.Remove(tB_lzfs.Text.LastIndexOf('.')), tB_fjrb.Text, false, Qskdj_fjrb_id);
                    //        }
                    //    }
                    //}



                    common_file.common_app.get_czsj();
                    url += "Qyddj/Qyddj_app.asmx";
                    object[] args = new object[26];
                    args[0] = Qskdj_fjrb_id;
                    args[1] = common_file.common_app.yydh;
                    args[2] = common_file.common_app.qymc;
                    args[3] = this.lsbh;
                    args[7] = tB_fjrb.Text.Trim().Replace("'", "_");
                    args[8] = tB_fjbh.Text.Trim().Replace("'", "_");
                    if (tB_lzfs.Text.Trim() == "")
                    {
                        args[11] = 1;
                    }
                    else
                    {
                        args[11] = Convert.ToDecimal(tB_lzfs.Text.Trim().Replace("'", "_"));
                    }
                    args[12] = cB_shqh.Text.Trim().Replace("'", "_");
                    if (yhbl == 0)
                    {
                        yhbl = 1;
                    }
                    args[13] = decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(tB_fjjg.Text.Trim().Replace("'", "_")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                    args[14] = decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(tB_fjjg.Text.Trim().Replace("'", "_")) * double.Parse(yhbl.ToString()), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                    args[15] = tB_yh.Text.Trim().Replace("'", "_");
                    args[16] = yhbl;
                    args[17] = tB_bz.Text.Trim().Replace("'", "_");
                    args[18] = common_file.common_app.czy;
                    args[19] = DateTime.Now;
                    args[20] = common_file.common_app.chinese_edit;
                    args[22] = judge_add_edit;
                    args[23] = common_file.common_app.xxzs;
                    args[24] = cB_fjbm.Text.Trim().Replace("'", "_");
                    args[25] = 0;
                    if (tB_jcje.Text.Trim() != "")
                    {
                        args[25] = decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(tB_jcje.Text.Trim().Replace("'", "_")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                    }
                    //由于这里在fjrb表里面的记录会被删除掉,所以当找不到时改用主单记录里面的信息
                    if (B_Qskyd_fjrb.GetModelList("lsbh='" + this.lsbh + "'").Count > 0)
                    {
                        M_Qskyd_fjrb = B_Qskyd_fjrb.GetModelList("lsbh='" + this.lsbh + "'")[0];
                        args[4]      = M_Qskyd_fjrb.krxm;
                        args[5]      = M_Qskyd_fjrb.sktt;
                        args[6]      = M_Qskyd_fjrb.yddj;
                        args[9]      = M_Qskyd_fjrb.ddsj;
                        args[10]     = M_Qskyd_fjrb.lksj;
                        args[21]     = M_Qskyd_fjrb.yddj;//有三种状态,一种预订、一种登记、一种预订转登记
                    }
                    //如果找不到当前临时编号在fjrb表里面对应的记录,直接找lsbh对应的主单记录
                    else
                    {
                        M_qskyd_mainrecord_temp = B_qskyd_mainrecord_temp.GetModelList("lsbh='" + this.lsbh + "'")[0];
                        args[4]  = M_qskyd_mainrecord_temp.krxm;
                        args[5]  = M_qskyd_mainrecord_temp.sktt;
                        args[6]  = M_qskyd_mainrecord_temp.yddj;
                        args[9]  = M_qskyd_mainrecord_temp.ddsj;
                        args[10] = M_qskyd_mainrecord_temp.lksj;
                        args[21] = M_qskyd_mainrecord_temp.yddj;//有三种状态,一种预订、一种登记、一种预订转登记
                    }

                    if (judge_add_edit == common_file.common_app.get_edit)
                    {
                        if (Qskdj_fjrb_id != "")
                        {
                            M_Qskyd_fjrb = B_Qskyd_fjrb.GetModel(int.Parse(Qskdj_fjrb_id));
                            if (M_Qskyd_fjrb != null)
                            {
                                if (M_Qskyd_fjrb.fjbh != "")
                                {
                                    if (decimal.Parse(args[11].ToString()) > 1)
                                    {
                                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,已经排房的记录不能直接修改房数!");
                                        return;
                                    }
                                }
                            }
                        }
                    }



                    //先判断是否超排房
                    if (judge_kyfs(M_Qskyd_fjrb.krxm, tB_fjbh.Text, M_Qskyd_fjrb.lsbh) == true)
                    {
                        Hotel_app.Server.Qyddj.Qskyd_fjrb_add_edd_delete_1 Qskyd_fjrb_add_edit_delete_services = new Hotel_app.Server.Qyddj.Qskyd_fjrb_add_edd_delete_1();

                        string result = Qskyd_fjrb_add_edit_delete_services.Qskyd_fjrb_add_edit_delete_app_1(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(), DateTime.Parse(args[9].ToString()),
                                                                                                             DateTime.Parse(args[10].ToString()), decimal.Parse(args[11].ToString()), args[12].ToString(), Decimal.Parse(args[13].ToString()), Decimal.Parse(args[14].ToString()), args[15].ToString(), Decimal.Parse(args[16].ToString()), args[17].ToString(), args[18].ToString(), DateTime.Parse(args[19].ToString()), args[20].ToString(), args[21].ToString(),
                                                                                                             args[22].ToString(), args[23].ToString(), args[24].ToString(), Decimal.Parse(args[25].ToString()));



                        //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Qskyd_fjrb_add_edit_delete_app_1", args);
                        if (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;

                            //成功后,调用短信发送
                            if (dx_fs)//如果选择发送短信
                            {
                                BLL.Common B_common = new Hotel_app.BLL.Common();
                                DataSet    ds_dx_zd = B_common.GetList(" select  *  from   View_Qskzd  ", " lsbh='" + lsbh + "'  and    yddj='" + common_file.common_yddj.yddj_yd + "'  and    krsj!=''    and   main_sec='" + common_file.common_app.main_sec_main + "'   ");
                                string     phoneNo = ""; bool check_phone = false;
                                if (ds_dx_zd != null && ds_dx_zd.Tables[0].Rows.Count > 0)
                                {
                                    phoneNo     = ds_dx_zd.Tables[0].Rows[0]["krsj"].ToString();
                                    check_phone = System.Text.RegularExpressions.Regex.IsMatch(phoneNo, @"^[1]+[3,4,5,6,8]+\d{9}");
                                    if (!check_phone)
                                    {
                                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "当前预订人的手机号不正确,请修正预订人的手机号系统才能即时发送短信提醒!");
                                    }
                                }



                                BLL.Common B_common00 = new Hotel_app.BLL.Common();
                                DataSet    ds_dx      = B_common00.GetList(" select * from  Qskyd_fjrb  ", "  id>=0  and    lsbh in (select lsbh from Qskyd_mainrecord  where lsbh='" + lsbh + "'  and  yddj='" + common_file.common_yddj.yddj_yd + "')  ");
                                if (ds_dx != null && ds_dx.Tables[0].Rows.Count > 0)
                                {
                                    StringBuilder sb = new StringBuilder();
                                    for (int i = 0; i < ds_dx.Tables[0].Rows.Count; i++)
                                    {
                                        if (ds_dx.Tables[0].Rows[i]["fjrb"].ToString().Length > 0)
                                        {
                                            if (sb.ToString().Length > 0)
                                            {
                                                sb.Append(",");
                                            }
                                            string lzfs_fs = ds_dx.Tables[0].Rows[i]["lzfs"].ToString();
                                            try
                                            {
                                                lzfs_fs = lzfs_fs.Remove(lzfs_fs.LastIndexOf('.'));
                                            }
                                            catch
                                            {
                                                //lzfs_fs=lzfs_fs;
                                            }
                                            sb.Append(DateTime.Parse(ds_dx.Tables[0].Rows[i]["ddsj"].ToString()).ToShortDateString() + ds_dx.Tables[0].Rows[i]["fjrb"].ToString() + lzfs_fs + "间");
                                        }
                                    }
                                    if (!sb.ToString().Equals("") && check_phone)
                                    {
                                        //Hotel_app.Hhygl_app.Hhygl_app Hhygl_app_services_new = new Hotel_app.Server.Hhygl_app.Hhygl_app();
                                        //Hhygl_app_services_new.Url = common_file.common_app.service_url + "Hhygl/Hhygl_app.asmx";
                                        Hotel_app.Server.Hhygl.Hhygl_verifyCode Hhygl_verifyCode_services = new Hotel_app.Server.Hhygl.Hhygl_verifyCode();

                                        string ss = Hhygl_verifyCode_services.Hhygl_SendMsm(phoneNo, sb.ToString(), common_file.common_app.yydh, "", common_file.common_hyAction.hy_Action_ydxg, "", "", "", "", "", "", common_file.common_app.xxzs);
                                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "系统修改当前会员的预订单成功,并己经自动将房型及房数以短信告知客人!");
                                        //MessageBox.Show(sb.ToString());
                                    }
                                }
                            }


                            common_file.common_form.Qskdj_new.lsbh = this.lsbh;
                            common_file.common_form.Qskdj_new.refresh_app();
                        }
                        else
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, result.ToString());
                        }
                    }
                }
                #endregion
            }

            if (yddj_type == common_file.common_app.yddj_type_group)
            {
                if (this.tB_lzfs.Text.Trim() == "")
                {
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, "请填写入住房数!");
                    tB_lzfs.Focus();
                    return;
                }


                common_file.common_app.get_czsj();
                #region 处理团体的部分_初始房态(fjbh='')
                if (tB_fjbh.Text.Trim() == "")
                {
                    if (tB_fjrb.Text.Trim() == "")//是否有选房型
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "请选择房型!");
                        tB_fjrb.Focus();
                        return;
                    }
                    if (this.tB_lzfs.Text.Trim() == "" || decimal.Parse(this.tB_lzfs.Text.Trim()) < 0)//是否有写入住房数
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "请填写入住房数!");
                        tB_lzfs.Focus();
                        return;
                    }
                    //新增时要先判断(第一是否有空记录,第二步要判断是否有存在相同类别未排房的记录)
                    if (judge_add_edit == common_file.common_app.get_add)
                    {
                        if (B_Qskyd_fjrb.GetModelList("lsbh='" + lsbh + "'  and  fjbh='' and  fjrb=''").Count > 0)
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "存在空记录,请先修改!");
                            return;
                        }
                        if (B_Qskyd_fjrb.GetModelList("lsbh='" + lsbh + "'  and fjbh=''  and   fjrb='" + this.tB_fjrb.Text.Trim() + "'").Count > 0)
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "同种房类以经存在,请直接修改数量!");
                            return;
                        }
                    }
                    //修改时,判断,修改后的类型是否当前以经存在
                    if (judge_add_edit == common_file.common_app.get_edit)
                    {
                        if (B_Qskyd_fjrb.GetModelList("lsbh='" + lsbh + "'  and fjbh=''  and   fjrb='" + this.tB_fjrb.Text.Trim() + "' and id!='" + Qskdj_fjrb_id + "'").Count > 0)
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "修改的房间类型以经存在,请直接修改数量");
                            return;
                        }
                    }
                    common_file.common_app.get_czsj();
                    url += "Qyddj/Qyddj_app.asmx";
                    object[] args = new object[26];
                    args[0]  = Qskdj_fjrb_id;
                    args[1]  = common_file.common_app.yydh;
                    args[2]  = common_file.common_app.qymc;
                    args[3]  = this.lsbh;
                    args[4]  = M_Qskyd_fjrb.krxm;
                    args[5]  = M_Qskyd_fjrb.sktt;
                    args[6]  = M_Qskyd_fjrb.yddj;
                    args[7]  = tB_fjrb.Text.Trim().Replace("'", "_");
                    args[8]  = "";
                    args[9]  = M_Qskyd_fjrb.ddsj;
                    args[10] = M_Qskyd_fjrb.lksj;
                    if (tB_lzfs.Text.Trim() == "")
                    {
                        args[11] = 0;
                    }
                    else
                    {
                        args[11] = Convert.ToDecimal(tB_lzfs.Text.Trim().Replace("'", "_"));
                    }
                    args[12] = cB_shqh.Text.Trim().Replace("'", "_");
                    args[13] = decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(tB_fjjg.Text.Trim().Replace("'", "_")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                    args[14] = decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(tB_fjjg.Text.Trim().Replace("'", "_")) * double.Parse(yhbl.ToString()), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                    args[15] = tB_yh.Text.Trim().Replace("'", "_");
                    args[16] = yhbl;
                    args[17] = tB_bz.Text.Trim().Replace("'", "_");
                    args[18] = common_file.common_app.czy;
                    args[19] = DateTime.Now;
                    args[20] = common_file.common_app.chinese_edit;
                    args[21] = M_Qskyd_fjrb.yddj;//有三种状态,一种预订、一种登记、一种预订转登记
                    args[22] = judge_add_edit;
                    args[23] = common_file.common_app.xxzs;
                    args[24] = cB_fjbm.Text.Trim().Replace("'", "_");
                    args[25] = 0;
                    if (tB_jcje.Text.Trim() != "")
                    {
                        args[25] = decimal.Parse(common_file.common_sswl.Round_sswl(double.Parse(tB_jcje.Text.Trim().Replace("'", "_")), common_file.common_sswl.sswl_ws, common_file.common_sswl.selectMode_sel).ToString());
                    }
                    if (judge_add_edit == common_file.common_app.get_edit)
                    {
                        if (M_Qskyd_fjrb.fjbh != "")
                        {
                            if (decimal.Parse(args[11].ToString()) > 1)
                            {
                                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,已经排房的记录不能直接修改房数!");
                                return;
                            }
                        }
                    }



                    //先判断是否超排房
                    if (judge_kyfs(args[4].ToString(), "", args[3].ToString()) == true)
                    {
                        Hotel_app.Server.Qyddj.Qskyd_fjrb_add_edit_delete Qskyd_fjrb_add_edit_delete_services = new Hotel_app.Server.Qyddj.Qskyd_fjrb_add_edit_delete();

                        string result = Qskyd_fjrb_add_edit_delete_services.Qskyd_fjrb_add_edit_delete_app(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(), DateTime.Parse(args[9].ToString()),
                                                                                                           DateTime.Parse(args[10].ToString()), Decimal.Parse(args[11].ToString()), args[12].ToString(), Decimal.Parse(args[13].ToString()), Decimal.Parse(args[14].ToString()), args[15].ToString(), Decimal.Parse(args[16].ToString()), args[17].ToString(), args[18].ToString(), DateTime.Parse(args[19].ToString()), args[20].ToString(), args[21].ToString(), args[22].ToString(), args[23].ToString(), args[24].ToString(), Decimal.Parse(args[25].ToString()));
                        //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Qskyd_fjrb_add_edit_delete_app", args);

                        if (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;
                            common_file.common_form.Qttdj_new.lsbh = this.lsbh;
                            //common_file.common_form.Qttdj_new.add_edit = "";
                            common_file.common_form.Qttdj_new.RefreshApp();
                        }
                        else
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, result.ToString());
                        }
                    }
                }

                #endregion
            }
            Cursor.Current = Cursors.Default;
        }
Beispiel #3
0
        private void GetZzInfo()
        {
            common_file.common_app.get_czsj();

            // 记、挂--转帐
            if (Zz_Type == Szwgl.common_zw.zwzz_gz_tt || Zz_Type == Szwgl.common_zw.zwzz_jz_tt || Zz_Type == Szwgl.common_zw.zwzz_gz_sk || Zz_Type == Szwgl.common_zw.zwzz_jz_sk)
            {
                //帐务向团体转
                if (Zz_Type == Szwgl.common_zw.zwzz_gz_tt || Zz_Type == Szwgl.common_zw.zwzz_jz_tt)//向团体转
                {
                    if (dg_tt.Rows.Count > 0)
                    {
                        if (dg_tt.CurrentRow != null)
                        {
                            int         i   = dg_tt.CurrentRow.Index;
                            DataRowView dgr = dg_tt.CurrentRow.DataBoundItem as DataRowView;
                            i = DS_Qtt.Tables[0].Rows.IndexOf(dgr.Row);


                            if (i > -1 && i < dg_tt.Rows.Count)//当前行为内容行
                            {
                                int id_temp = Convert.ToInt32(DS_Qtt.Tables[0].Rows[i]["id"].ToString());
                                M_Qttyd_mainrecord = B_Qttyd_mainrecord.GetModelList("Id=" + id_temp)[0];
                                lsbh_new           = M_Qttyd_mainrecord.lsbh;
                            }
                        }
                        else
                        {
                            return;
                        }
                    }
                    else
                    {
                        return;
                    }
                }
                //帐务向散客转
                if (Zz_Type == Szwgl.common_zw.zwzz_gz_sk || Zz_Type == Szwgl.common_zw.zwzz_jz_sk)//向散客转
                {
                    if (dg_sk.Rows.Count > 0)
                    {
                        if (dg_sk.CurrentRow != null)
                        {
                            int         i   = dg_sk.CurrentRow.Index;
                            DataRowView dgr = dg_sk.CurrentRow.DataBoundItem as DataRowView;
                            if (dgr != null)
                            {
                                i = DS_Qsk.Tables[0].Rows.IndexOf(dgr.Row);



                                if (i > -1 && i < dg_sk.Rows.Count)//当前行为内容行
                                {
                                    int id_temp = Convert.ToInt32(DS_Qsk.Tables[0].Rows[i]["id"].ToString());
                                    //DS_Qsk.Tables[0].Rows[i]["id"].ToString();
                                    M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id=" + id_temp)[0];
                                    lsbh_new           = M_Qskyd_mainrecord.lsbh;
                                }
                            }
                        }
                        else
                        {
                            return;
                        }
                    }
                    else
                    {
                        return;
                    }
                }

                //注意这里传的是记挂的结帐主单ID
                M_Sjzzd  = B_Sjzzd.GetModel(int.Parse(id));
                lsbh_old = M_Sjzzd.lsbh;
                jzbh_old = M_Sjzzd.jzbh;
                sk_tt    = M_Sjzzd.sktt;
            }

            //在住---向团体转
            if (Zz_Type == Szwgl.common_zw.zwzz_sk_tt || Zz_Type == Szwgl.common_zw.zwzz_tt_tt || Zz_Type == Szwgl.common_zw.zwzz_tt_sk || Zz_Type == Szwgl.common_zw.zwzz_sk_sk)
            {
                if (Zz_Type == Szwgl.common_zw.zwzz_sk_tt || Zz_Type == Szwgl.common_zw.zwzz_tt_tt)
                {
                    if (dg_tt.Rows.Count > 0)
                    {
                        if (dg_tt.CurrentRow != null)
                        {
                            int         i   = dg_tt.CurrentRow.Index;
                            DataRowView dgr = dg_tt.CurrentRow.DataBoundItem as DataRowView;
                            if (dgr != null)
                            {
                                i = DS_Qtt.Tables[0].Rows.IndexOf(dgr.Row);


                                if (i > -1 && i < dg_tt.Rows.Count)//当前行为内容行
                                {
                                    int id_temp = Convert.ToInt32(DS_Qtt.Tables[0].Rows[i]["id"].ToString());
                                    M_Qttyd_mainrecord = B_Qttyd_mainrecord.GetModelList("Id=" + id_temp)[0];
                                    lsbh_new           = M_Qttyd_mainrecord.lsbh;
                                }
                            }

                            if (Zz_Type == Szwgl.common_zw.zwzz_sk_tt)
                            {
                                M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModel(int.Parse(id));
                                lsbh_old           = M_Qskyd_mainrecord.lsbh;
                                sk_tt = M_Qskyd_mainrecord.sktt;
                            }
                            if (Zz_Type == Szwgl.common_zw.zwzz_tt_tt)
                            {
                                M_Qttyd_mainrecord = B_Qttyd_mainrecord.GetModel(int.Parse(id));
                                lsbh_old           = M_Qttyd_mainrecord.lsbh;
                                sk_tt = M_Qttyd_mainrecord.sktt;
                            }
                        }
                        else
                        {
                            return;
                        }
                    }
                    else
                    {
                        return;
                    }
                }

                //在住---向散客转
                if (Zz_Type == Szwgl.common_zw.zwzz_tt_sk || Zz_Type == Szwgl.common_zw.zwzz_sk_sk)
                {
                    if (dg_sk.Rows.Count > 0)
                    {
                        if (dg_sk.CurrentRow != null)
                        {
                            int         i   = dg_sk.CurrentRow.Index;
                            DataRowView dgr = dg_sk.CurrentRow.DataBoundItem as DataRowView;
                            if (dgr != null)
                            {
                                i = DS_Qsk.Tables[0].Rows.IndexOf(dgr.Row);

                                if (i > -1 && i < dg_sk.Rows.Count)//当前行为内容行
                                {
                                    int id_temp = Convert.ToInt32(DS_Qsk.Tables[0].Rows[i]["id"].ToString());
                                    //DS_Qsk.Tables[0].Rows[i]["id"].ToString();
                                    M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id=" + id_temp)[0];
                                    lsbh_new           = M_Qskyd_mainrecord.lsbh;
                                }
                            }
                            if (Zz_Type == Szwgl.common_zw.zwzz_sk_sk)
                            {
                                {
                                    M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModel(int.Parse(id));
                                    lsbh_old           = M_Qskyd_mainrecord.lsbh;
                                    sk_tt = M_Qskyd_mainrecord.sktt;
                                }
                            }
                            if (Zz_Type == Szwgl.common_zw.zwzz_tt_sk)
                            {
                                M_Qttyd_mainrecord = B_Qttyd_mainrecord.GetModel(int.Parse(id));
                                lsbh_old           = M_Qttyd_mainrecord.lsbh;
                                sk_tt = M_Qttyd_mainrecord.sktt;
                            }
                        }
                        else
                        {
                            return;
                        }
                    }
                    else
                    {
                        return;
                    }
                }
            }
            Cursor.Current = Cursors.Default;
        }
Beispiel #4
0
        public string Qskyd_fjrb_add_edit_delete_app_1(string id, string yydh, string qymc, string lsbh, string krxm, string sktt, string yddj, string fjrb, string fjbh, DateTime ddsj, DateTime lksj, Decimal lzfs, string shqh, decimal fjjg, decimal sjfjjg, string yh, decimal yhbl, string bz, string czy, DateTime czsj,
                                                       string cznr, string zyzt, string add_edit_delete, string xxzs, string fjbm, decimal jcje)
        {
            string s = common_file.common_app.get_failure;

            BLL.Qskyd_fjrb       B_temp             = new Hotel_app.BLL.Qskyd_fjrb();
            Model.Qskyd_fjrb     M_Qskyd_fjrb       = new Hotel_app.Model.Qskyd_fjrb();
            Ffjzt.Flfsz_add_edit Flfsz_add_edit_new = new Hotel_app.Server.Ffjzt.Flfsz_add_edit();
            BLL.Common           B_Common           = new Hotel_app.BLL.Common();
            DataSet ds = new DataSet();
            int     id_temp = 0; int id_temp2 = 0;
            int     j_temp = 1;
            string  lsbh_News = "";
            string  ddbh_News = "";
            string  lfbh_News = ""; int i_1 = 0;
            string  old_fjbh = "";

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

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

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

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

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



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

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


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

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

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


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

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

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

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



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

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

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

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

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

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

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

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



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

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



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


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

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

                                        #endregion

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


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



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


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

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

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


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

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

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

                            if (old_fjbh != "")
                            {
                                j_temp = 1;
                            }
                            if (j_temp == 3)
                            {
                                if (fjbh != "")
                                {
                                    //找到当前房间类型为1,而且还没有排房号的那条记录
                                    //M_Qskyd_fjrb = B_temp.GetModelList("lsbh='" + lsbh + "' and  fjrb='" + fjrb + "'  and  lzfs=1  and fjbh=''")[0];
                                    //得到主单的信息:
                                    lsbh_News = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                                    ddbh_News = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                                    //通过当前的主单信息新增一条新的记录
                                    if (common_file_server.Common_pl_Qskyd_mainRecord_add.Pladd(yydh, qymc, lsbh, lsbh_News, ddbh_News, czy, czsj.ToString(), "", "") == common_file.common_app.get_suc)
                                    {
                                        #region     //修改fjrb表里当前生成这条记录的房间信息
                                        id_temp2 = GetModel("", lsbh_News).id;
                                        if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id_temp2.ToString(), yydh, qymc, lsbh_News, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, "自动新增", zyzt, common_file.common_app.get_edit, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                        {
                                            //修改成功后,把当前原来fjrb表里面对应的那条记录删除
                                            if (GetModel(fjrb, lsbh) != null)
                                            {
                                                id_temp2 = int.Parse(id);
                                                if (B_temp.Delete(id_temp2))
                                                {
                                                    //删除对应记录成功后,把新生成的记录加到联房里
                                                    #region 判断当前的lsbh在不在在联房表里面,然后做相应处理
                                                    if (lf_GetResult(lsbh, qymc, lsbh_News, yydh, fjbh, krxm, sktt, yddj, czy, czsj, xxzs))
                                                    {
                                                        s = common_file.common_app.get_suc;
                                                    }
                                                    #endregion
                                                }
                                            }
                                        }
                                        #endregion
                                    }
                                }
                                else
                                {
                                    if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id.ToString(), yydh, qymc, lsbh, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, cznr, zyzt, add_edit_delete, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                    {
                                        s = common_file.common_app.get_suc;
                                    }
                                    else
                                    {
                                        return(s);
                                    }
                                }
                            }
                            else
                            {
                                if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id.ToString(), yydh, qymc, lsbh, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, cznr, zyzt, add_edit_delete, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                                {
                                    s = common_file.common_app.get_suc;
                                }
                            }
                        }
                    }    //if (yddj == common_file.common_yddj.yddj_yd)
                    else
                    if (yddj == common_file.common_yddj.yddj_dj)
                    {
                        if (Qskyd_fjrb_add_edit_delete_new.Qskyd_fjrb_add_edit_delete_app(id.ToString(), yydh, qymc, lsbh, krxm, sktt, yddj, fjrb, fjbh, ddsj, lksj, lzfs, shqh, fjjg, sjfjjg, yh, yhbl, bz, czy, czsj, cznr, zyzt, add_edit_delete, xxzs, fjbm, jcje) == common_file.common_app.get_suc)
                        {
                            s = common_file.common_app.get_suc;
                        }
                        else
                        {
                            return(s);
                        }
                    }        //if (yddj == common_file.common_yddj.yddj_dj)
                }
                #endregion
                #region hy类型的时候
                else
                if (sktt == common_file.common_sktt.sktt_tt || sktt == common_file.common_sktt.sktt_hy)
                {
                    if (add_edit_delete == common_file.common_app.get_add)
                    {
                        if (yddj == common_file.common_yddj.yddj_yd)
                        {
                            //1.新增主单
                            //2.修改房类Qskyd_Fjrb表,把fjbh写进,lzfs设为1.
                            //3.修改没有带房号的临时编号lzfs减1
                        }
                    }
                    else
                    if (add_edit_delete == common_file.common_app.get_edit)
                    {
                    }
                }
                #endregion
            }
            ds.Dispose();
            return(s);
        }
Beispiel #5
0
        private void b_save_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (tB_fkfs.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "请选择付款方式");
                return;
            }
            else if (tB_xfje.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "请填写付款金额");
                return;
            }
            //既不是数字也不是decimal
            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();
            }
            else
            {
                id_app = common_file.common_ddbh.ddbh("yjcz", "lsbhdate", "lsbhcounter", 6);

                //id, yydh, qymc, id_app, jzbh, lsbh, krxm, fjrb, fjbh, sktt, xfrq, xfsj, czy, xfdr, xfrb, xfxm, xfbz, xfzy, fkfs, xfje, sjxfje, czy_bc, syzd, add_edit_delete, xxzs
                string   url  = common_file.common_app.service_url + "Szwgl/Szwgl_app.asmx";
                object[] args = new object[26];
                args[0] = Syjcz_id;
                args[1] = common_file.common_app.yydh;
                args[2] = common_file.common_app.qymc;
                args[3] = id_app;
                if (openfrom == "Szwcl") //结记挂帐之前
                {
                    args[4] = "";        //结帐前jzbh为空
                }
                else
                {
                    //string jzbh_temp = DbHelperSQL.GetSingle("SELECT Jzbh  from  Sjzzd where lsbh='" + lsbh + "'").ToString();
                    args[4] = jzbh;
                }
                args[5] = lsbh;
                if (openfrom == "Szwcl")
                {
                    if (sk_tt == "sk")
                    {
                        M_Qskyd_mainrecord = B_Qskyd_mainrecord.GetModelList("id>=0 " + common_file.common_app.yydh_select + " and lsbh='" + lsbh + "'")[0];
                        M_Qskyd_fjrb       = B_Qskyd_fjrb.GetModelList("id>=0 " + common_file.common_app.yydh_select + " and Lsbh='" + lsbh + "'")[0];
                        args[6]            = M_Qskyd_mainrecord.krxm;
                        args[7]            = M_Qskyd_fjrb.fjrb;
                        args[8]            = M_Qskyd_fjrb.fjbh;
                        args[9]            = M_Qskyd_mainrecord.sktt;
                    }
                    else if (sk_tt == "tt")
                    {
                        M_Qttyd_mainrecord = B_M_Qttyd_mainrecord.GetModelList("id>=0 " + common_file.common_app.yydh_select + " and  lsbh='" + lsbh + "'")[0];
                        args[6]            = M_Qttyd_mainrecord.krxm;
                        args[7]            = "";
                        args[8]            = "";
                        args[9]            = M_Qttyd_mainrecord.sktt;
                    }
                }
                else
                {
                    if (sk_tt == "sk")
                    {
                        List <Model.Qskyd_mainrecord_bak> list = new List <Hotel_app.Model.Qskyd_mainrecord_bak>();
                        list = B_Qskyd_mainrecord_bak.GetModelList("id>=0 " + common_file.common_app.yydh_select + " and lsbh='" + lsbh + "'");
                        if (list.Count > 0)
                        {
                            M_Qskyd_mainrecord_bak = list[0];
                            M_Qskyd_fjrb_bak       = B_Qskyd_fjrb_bak.GetModelList("id>=0 " + common_file.common_app.yydh_select + " and Lsbh='" + lsbh + "'")[0];
                            args[6] = M_Qskyd_mainrecord_bak.krxm;
                            args[7] = M_Qskyd_fjrb_bak.fjrb;
                            if (M_Qskyd_fjrb_bak.fjbh != null)
                            {
                                args[8] = M_Qskyd_fjrb_bak.fjbh;
                            }
                            else
                            {
                                args[8] = "";
                            }
                            args[9] = M_Qskyd_mainrecord_bak.sktt;
                        }
                        else
                        {
                            args[6] = "";
                            args[7] = "";
                            args[8] = "";
                        }
                    }
                    else if (sk_tt == "tt")
                    {
                        List <Model.Qttyd_mainrecord_bak> list = new List <Hotel_app.Model.Qttyd_mainrecord_bak>();
                        list = B_Qttyd_mainrecord_bak.GetModelList("id>=0 " + common_file.common_app.yydh_select + " and  lsbh='" + lsbh + "'");
                        if (list.Count > 0)
                        {
                            M_Qttyd_mainrecord_bak = list[0];
                            args[6] = M_Qttyd_mainrecord_bak.krxm;
                        }
                        else
                        {
                            args[6] = "";
                        }
                        args[7] = "";
                        args[8] = "";
                        if (list.Count > 0)
                        {
                            args[9] = M_Qttyd_mainrecord_bak.sktt;
                        }
                        else
                        {
                            args[9] = common_file.common_sktt.sktt_tt;
                        }
                    }
                }
                args[10] = DateTime.Now.ToString("yyyy-MM-dd");
                args[11] = DateTime.Now.ToString();
                args[12] = common_file.common_app.czy;
                args[13] = common_file.common_app.fkdr;
                args[14] = common_file.common_app.dj_ysk;
                args[15] = tB_xfxm.Text.Trim().Replace("'", "-");
                args[16] = tB_bz.Text.Trim().Replace("'", "-");
                args[17] = tB_fkzy.Text.Trim().Replace("'", "-");
                args[18] = tB_fkfs.Text.Trim().Replace("'", "-");
                args[19] = tB_xfje.Text.Trim().Replace("'", "-");
                args[20] = tB_xfje.Text.Trim().Replace("'", "-");
                args[21] = common_file.common_app.czy_bc;
                args[22] = common_file.common_app.syzd;
                args[23] = judge_add_edit;
                args[24] = common_file.common_app.xxzs;
                args[25] = DateTime.Now.ToString();

                Hotel_app.Server.Szwgl.Syjcz Syjcz_new = new Hotel_app.Server.Szwgl.Syjcz();
                string result = Syjcz_new.Syjcz_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());
                // object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Syjcz_add_edit", args);
                if (result == common_file.common_app.get_suc)
                {
                    this.DialogResult = DialogResult.OK;
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, "保存成功!");
                }
                else
                {
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败!");
                }
            }
            Cursor.Current = Cursors.Default;
        }
Beispiel #6
0
        /// <summary>
        /// 下载订单信息
        /// </summary>
        public static void DownLoadOrderFromSite()
        {
            string lsbh;
            string ddbh;

            Model.Qskyd_mainrecord M_Qskyd_mainrecord = new Model.Qskyd_mainrecord();
            BLL.Qskyd_mainrecord   B_Qskyd_mainrecord = new BLL.Qskyd_mainrecord();

            DataSet ds = null;

            //获取订单
            ds = GetOrderFromSite(1);
            //处理订单
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    lsbh = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                    ddbh = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                    string krxm = "";
                    M_Qskyd_mainrecord.lsbh = lsbh;
                    M_Qskyd_mainrecord.yydh = Com.ConfigInfo.yydh;
                    M_Qskyd_mainrecord.qymc = Com.ConfigInfo.qymc;
                    M_Qskyd_mainrecord.ddbh = ddbh;
                    M_Qskyd_mainrecord.hykh = dr["user_id"].ToString();
                    M_Qskyd_mainrecord.hyrx = Com.Common.hyrx_site;
                    M_Qskyd_mainrecord.krxm = dr["yd_name"].ToString();
                    //M_Qskyd_mainrecord.krgj = Com.Common.hyrx_site;
                    //M_Qskyd_mainrecord.krmz = dr[12].ToString();
                    //M_Qskyd_mainrecord.yxzj = dr[13].ToString();
                    //M_Qskyd_mainrecord.zjhm = dr[14].ToString();
                    M_Qskyd_mainrecord.krxb    = dr["yd_sex"].ToString();
                    M_Qskyd_mainrecord.krsj    = dr["yd_mobile"].ToString();
                    M_Qskyd_mainrecord.krEmail = dr["yd_email"].ToString();
                    //M_Qskyd_mainrecord.krdz = dr[20].ToString();
                    M_Qskyd_mainrecord.krly = Com.Common.hyrx_site;
                    M_Qskyd_mainrecord.yddj = common_app.yddj_yd;
                    M_Qskyd_mainrecord.sktt = common_app.sktt_sk;
                    M_Qskyd_mainrecord.ddly = common_app.ddly;
                    M_Qskyd_mainrecord.cznr = common_app.cznr_add;
                    //M_Qskyd_mainrecord.xyh = dr[23].ToString();
                    //M_Qskyd_mainrecord.xydw = dr[24].ToString();
                    M_Qskyd_mainrecord.xsy  = Com.Common.xsy_site;
                    M_Qskyd_mainrecord.ddsj = Convert.ToDateTime(dr["yd_statetime"].ToString());
                    M_Qskyd_mainrecord.lksj = Convert.ToDateTime(dr["yd_endtime"].ToString()).AddHours(12);
                    //M_Qskyd_mainrecord.czy = dr[28].ToString();
                    //M_Qskyd_mainrecord.hykh_bz = dr[6].ToString();
                    //M_Qskyd_mainrecord.lzts = Convert.ToInt32(dr[38].ToString());
                    M_Qskyd_mainrecord.shsc = true;
                    M_Qskyd_mainrecord.ddyy = common_file.Common.ReadXML("add", "hyrx_site"); //Com.Common.hyrx_site;//标志网上预订
                    M_Qskyd_mainrecord.zyzt = common_app.yddj_yd;
                    M_Qskyd_mainrecord.qtyq = dr["content"].ToString();                       //其它要求
                    B_Qskyd_mainrecord.Add(M_Qskyd_mainrecord);
                    string Remote_lsbh = dr["order_lsbh"].ToString();
                    //向中心服务器加本的新生成的lsbh成功后修改web_skyd各web_Qskyd_fjrb中字段shsc = 1都放在同一个存储过程注意;
                    InsertToQyddjlsbhbg_yy(Remote_lsbh, lsbh, yydh);
                    //下载完后修改本地Qskyd_fjrb表fjrb,fjjg等
                    string  qc_fjrb = dr["title"].ToString();
                    decimal qc_fjjg = Com.CommFunc.GetDecimalValue(dr["yd_jg"].ToString());
                    Qskyd_fjrb_Update(lsbh, qc_fjrb, 1, qc_fjjg, qc_fjjg);
                    string lflsbh = common_file.common_ddbh.ddbh("lf", "skyddate", "skydcounter", 6);//联房编号
                    //下载完后添加到联房里
                    Common_flfsz.Flfsz_add(yydh, qymc, lflsbh, lsbh, "", krxm, common_app.sktt_sk, common_app.yddj_yd, Com.Common.xsy_site);
                }
            }
        }
Beispiel #7
0
        //下载网上预订的方法
        public static int Download_orderFrom400()
        {
            Model.Qskyd_mainrecord M_Qskyd_mainrecord = new Model.Qskyd_mainrecord();
            BLL.Qskyd_mainrecord   B_Qskyd_mainrecord = new BLL.Qskyd_mainrecord();
            string lsbh = ""; string ddbh = "";
            int    dlsum = 0;
            string ss = common_app.get_failure;

            url = common_file.Common.ReadXML("add", "url") + "/Qyddj/Qyddj_app.asmx";
            DataSet DS_downloadData = new DataSet();

            qymc = common_file.Common.Getqyxx(2);
            int  rows = 0;
            bool status = false;

            object[] obj = new object[4];
            obj[0] = qymc;
            obj[1] = rows;
            obj[2] = status;
            obj[3] = DS_downloadData;
            object result = jdgl_res_head_app.DynamicWebServiceCall.InvokeWebService(url, "yddj_download_DS", obj);

            ss = result.ToString();
            if (ss == common_app.get_suc)
            {
                #region  预订中心数据处理
                try
                {
                    DS_downloadData = (DataSet)obj[3];
                    foreach (DataRow dr in DS_downloadData.Tables[0].Rows)
                    {
                        string sktt_value = dr[30].ToString();
                        //第一步,生成本地临时编号
                        string lflsbh      = common_file.common_ddbh.ddbh("lf", "skyddate", "skydcounter", 6);; //联房编号
                        string Remote_lsbh = dr[3].ToString();                                                  //远程lsbh
                        string Local_yydh  = dr[1].ToString();                                                  //中心服务的yydh
                        string yydh        = dr[1].ToString();
                        qymc = dr[2].ToString();
                        int xfCount = 0;

                        //如果是团体直接添加到本地Qttyd_mainrecord表中和中心服务器Qydlsbhbg_yy表插入数据
                        if (sktt_value == common_app.sktt_tt)
                        {
                            //id,yydh,qymc,lsbh,ddbh,hykh,hykh_bz,hyrx,krxm,krbh,ydrxm,
                            //krgj,krmz,yxzj,zjhm,krxb,krsr,krdh,krsj,krEmail,krdz,
                            //qtyq,krly,xyh,xydw,xsy,ddsj,lksj,czy,ydsj,sktt,
                            //yddj,vip_type,fjrb,fjbh,sjjg,jsjg,lzfs,lzts,lzrs,sfqr,
                            //ydxg,shxg,shsc
                            Model.Qttyd_mainrecord M_Qttyd_mainrecord = new Model.Qttyd_mainrecord();
                            BLL.Qttyd_mainrecord   B_Qttyd_mainrecord = new BLL.Qttyd_mainrecord();
                            lsbh = common_file.common_ddbh.ddbh("ttyd", "ttyddate", "ttydcounter", 6);
                            ddbh = common_file.common_ddbh.ddbh("ttyd", "ttyddate", "ttydcounter", 6);
                            M_Qttyd_mainrecord.cznr    = common_app.cznr_add;
                            M_Qttyd_mainrecord.czsj    = DateTime.Now;
                            M_Qttyd_mainrecord.czy     = dr[28].ToString();
                            M_Qttyd_mainrecord.ddbh    = ddbh;
                            M_Qttyd_mainrecord.ddly    = common_app.ddly;
                            M_Qttyd_mainrecord.ddrx    = "";
                            M_Qttyd_mainrecord.ddsj    = Convert.ToDateTime(dr[26].ToString()).AddHours(12);
                            M_Qttyd_mainrecord.ddwz    = "";
                            M_Qttyd_mainrecord.ddyy    = "";
                            M_Qttyd_mainrecord.ffshys  = false;
                            M_Qttyd_mainrecord.krbh    = dr[9].ToString();
                            M_Qttyd_mainrecord.krdh    = dr[17].ToString();
                            M_Qttyd_mainrecord.krdz    = dr[20].ToString();
                            M_Qttyd_mainrecord.krEmail = dr[19].ToString();
                            M_Qttyd_mainrecord.krgj    = dr[11].ToString();
                            M_Qttyd_mainrecord.krly    = dr[22].ToString();
                            M_Qttyd_mainrecord.krsj    = dr[18].ToString();
                            M_Qttyd_mainrecord.krxm    = dr[8].ToString();
                            M_Qttyd_mainrecord.lksj    = Convert.ToDateTime(dr[27].ToString()).AddHours(12);
                            M_Qttyd_mainrecord.lsbh    = lsbh;
                            M_Qttyd_mainrecord.lzts    = Convert.ToInt32(dr[38].ToString());
                            M_Qttyd_mainrecord.qtyq    = dr[21].ToString();
                            M_Qttyd_mainrecord.qymc    = qymc;
                            M_Qttyd_mainrecord.sdcz    = false;
                            M_Qttyd_mainrecord.shsc    = true;
                            M_Qttyd_mainrecord.sktt    = common_app.sktt_tt;
                            M_Qttyd_mainrecord.syzd    = "";
                            M_Qttyd_mainrecord.tsyq    = "";
                            M_Qttyd_mainrecord.xsy     = dr[25].ToString();
                            M_Qttyd_mainrecord.xydw    = dr[24].ToString();
                            M_Qttyd_mainrecord.xyh     = dr[23].ToString();
                            M_Qttyd_mainrecord.yddj    = common_app.yddj_yd;
                            M_Qttyd_mainrecord.ydrxm   = dr[10].ToString();
                            M_Qttyd_mainrecord.yydh    = yydh;
                            M_Qttyd_mainrecord.zyzt    = "";
                            M_Qttyd_mainrecord.ddyy    = common_app.ddyy;//标志网上预订
                            M_Qskyd_mainrecord.zyzt    = common_app.yddj_yd;
                            B_Qttyd_mainrecord.Add(M_Qttyd_mainrecord);
                            //向中心服务器加本地的新生成的lsbh,成功后修改web_skyd的shsc = 1都放在同一个存储过程注意,
                            InsertToQyddjlsbhbg_yy(Remote_lsbh, lsbh, Local_yydh);
                        }
                        //第二步,1.sktt=散客,根据房间数量生成相对应的Qskyd_mainrecord主单和中心服务器Qydlsbhbg_yy表插入数据,修改Qskyd_fjrb表里的fjrb,lzfs,shsc,并且添加到联房。
                        //        2.sktt=团体,如果是第一条房型的话就直接修改Qskyd_fjrb,第二种房型就直接加到Qskyd_fjrb表
                        DataSet DS_Fjrb = Qskydfjrb_ds(qymc, Remote_lsbh);
                        foreach (DataRow rb in DS_Fjrb.Tables[0].Rows)
                        {
                            xfCount++;
                            string  lzfs     = rb[12].ToString().Substring(0, rb[12].ToString().TrimEnd().IndexOf("."));
                            int     qc_lzfsa = int.Parse(lzfs.ToString());
                            string  qc_fjrb  = rb[8].ToString();                     //房间类别
                            decimal qc_lzfs  = Convert.ToDecimal(rb[12].ToString()); //入住房数
                            decimal qc_fjjg  = Convert.ToDecimal(rb[14].ToString());
                            if (qc_lzfsa > 0)
                            {
                                #region 如果sktt=散客。
                                if (sktt_value == common_app.sktt_sk)//如果是散客
                                {
                                    for (int i = 0; i <= qc_lzfsa - 1; i++)
                                    {
                                        //id,yydh,qymc,lsbh,ddbh,hykh,hykh_bz,hyrx,krxm,krbh,ydrxm,
                                        //krgj,krmz,yxzj,zjhm,krxb,krsr,krdh,krsj,krEmail,krdz,
                                        //qtyq,krly,xyh,xydw,xsy,ddsj,lksj,czy,ydsj,sktt,
                                        //yddj,vip_type,fjrb,fjbh,sjjg,jsjg,lzfs,lzts,lzrs,sfqr,
                                        //ydxg,shxg,shsc
                                        lsbh = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                                        ddbh = common_file.common_ddbh.ddbh("skyd", "skyddate", "skydcounter", 6);
                                        string krxm = dr[8].ToString();
                                        M_Qskyd_mainrecord.lsbh    = lsbh;
                                        M_Qskyd_mainrecord.yydh    = yydh;
                                        M_Qskyd_mainrecord.qymc    = qymc;
                                        M_Qskyd_mainrecord.ddbh    = ddbh;
                                        M_Qskyd_mainrecord.hykh    = dr[5].ToString();
                                        M_Qskyd_mainrecord.hyrx    = dr[7].ToString();
                                        M_Qskyd_mainrecord.krxm    = krxm;
                                        M_Qskyd_mainrecord.krgj    = dr[11].ToString();
                                        M_Qskyd_mainrecord.krmz    = dr[12].ToString();
                                        M_Qskyd_mainrecord.yxzj    = dr[13].ToString();
                                        M_Qskyd_mainrecord.zjhm    = dr[14].ToString();
                                        M_Qskyd_mainrecord.krxb    = dr[15].ToString();
                                        M_Qskyd_mainrecord.krsj    = dr[18].ToString();
                                        M_Qskyd_mainrecord.krEmail = dr[19].ToString();
                                        M_Qskyd_mainrecord.krdz    = dr[20].ToString();
                                        M_Qskyd_mainrecord.krly    = dr[22].ToString();
                                        M_Qskyd_mainrecord.yddj    = common_app.yddj_yd;
                                        M_Qskyd_mainrecord.sktt    = common_app.sktt_sk;
                                        M_Qskyd_mainrecord.ddly    = common_app.ddly;
                                        M_Qskyd_mainrecord.cznr    = common_app.cznr_add;
                                        M_Qskyd_mainrecord.xyh     = dr[23].ToString();
                                        M_Qskyd_mainrecord.xydw    = dr[24].ToString();
                                        M_Qskyd_mainrecord.xsy     = dr[25].ToString();
                                        M_Qskyd_mainrecord.ddsj    = Convert.ToDateTime(dr[26].ToString()).AddHours(12);
                                        M_Qskyd_mainrecord.lksj    = Convert.ToDateTime(dr[27].ToString()).AddHours(12);
                                        M_Qskyd_mainrecord.czy     = dr[28].ToString();
                                        M_Qskyd_mainrecord.hykh_bz = dr[6].ToString();
                                        M_Qskyd_mainrecord.lzts    = Convert.ToInt32(dr[38].ToString());
                                        M_Qskyd_mainrecord.shsc    = true;
                                        M_Qskyd_mainrecord.ddyy    = common_app.ddyy;   //标志网上预订
                                        M_Qskyd_mainrecord.zyzt    = common_app.yddj_yd;
                                        M_Qskyd_mainrecord.qtyq    = dr[21].ToString(); //其它要求
                                        B_Qskyd_mainrecord.Add(M_Qskyd_mainrecord);

                                        //向中心服务器加本的新生成的lsbh成功后修改web_skyd各web_Qskyd_fjrb中字段shsc = 1都放在同一个存储过程注意;
                                        InsertToQyddjlsbhbg_yy(Remote_lsbh, lsbh, Local_yydh);
                                        //下载完后修改本地Qskyd_fjrb表fjrb,fjjg等
                                        Qskyd_fjrb_Update(lsbh, qc_fjrb, 1, qc_fjjg, qc_fjjg);
                                        //下载完后添加到联房里
                                        Common_flfsz.Flfsz_add(yydh, qymc, lflsbh, lsbh, "", krxm, common_app.sktt_sk, common_app.yddj_yd, dr[28].ToString());
                                    }
                                    dlsum = int.Parse(DS_downloadData.Tables[0].Rows.Count.ToString());//返回行数
                                }
                                #endregion
                                #region   如果是团体
                                else if (sktt_value == common_app.sktt_tt)//如果是团体
                                {
                                    //修改本地Qskyd_fjrb表中的房型
                                    //1.如果是第一条房型的话就直接修改Qskyd_fjrb。
                                    //2.除第一条其它数据就直接添加房型
                                    if (xfCount == 1)
                                    {
                                        Qskyd_fjrb_Update(lsbh, qc_fjrb, qc_lzfs, qc_fjjg, qc_fjjg);
                                    }
                                    else
                                    {
                                        Model.Qskyd_fjrb M_fjrb = new Model.Qskyd_fjrb();
                                        BLL.Qskyd_fjrb   B_fjrb = new BLL.Qskyd_fjrb();
                                        M_fjrb.yydh   = yydh;
                                        M_fjrb.yddj   = common_app.yddj_yd;
                                        M_fjrb.sktt   = common_app.sktt_tt;
                                        M_fjrb.sjfjjg = Convert.ToDecimal(rb[15].ToString());
                                        M_fjrb.shsc   = true;
                                        M_fjrb.shqh   = rb[13].ToString();
                                        M_fjrb.qymc   = qymc;
                                        M_fjrb.lzfs   = Convert.ToDecimal(rb[12].ToString());
                                        M_fjrb.lsbh   = lsbh;
                                        M_fjrb.lksj   = Convert.ToDateTime(dr[27].ToString()).AddHours(12);
                                        M_fjrb.krxm   = rb[5].ToString();
                                        M_fjrb.fjrb   = rb[8].ToString();
                                        M_fjrb.fjjg   = Convert.ToDecimal(rb[15].ToString());
                                        M_fjrb.fjbh   = "";
                                        M_fjrb.fjbm   = "";
                                        M_fjrb.ddsj   = Convert.ToDateTime(dr[26].ToString()).AddHours(12);
                                        M_fjrb.bz     = rb[16].ToString();
                                        M_fjrb.cznr   = common_app.cznr_add;
                                        M_fjrb.czy    = dr[28].ToString();
                                        B_fjrb.Add(M_fjrb);
                                    }
                                    dlsum = int.Parse(DS_downloadData.Tables[0].Rows.Count.ToString());//返回行数
                                }
                                #endregion
                                //UpdateWeb_skyd_fjrb_shsc(int.Parse(rb[0].ToString()));
                            }
                        }
                    }
                    return(dlsum);
                }
                catch (Exception ee)
                {
                    errorInfo = ee.Message.ToString();
                    postion   = "向本地Qskyd_mainrecord插入数据之后到修改远程服务器下载数据的过程之中";
                    Common.WriteLog(errorInfo, postion);
                }
                #endregion
            }
            return(dlsum);
        }