Esempio n. 1
0
        /// <summary>
        /// 门店上传散客房间到中心服务器
        /// </summary>
        /// <returns></returns>
        public static int UpLoad_Qskyd_fjrb()
        {
            int    i = 0;
            string s = common_app.get_failure;

            Model.Qskyd_fjrb M_Qskyd_fjrb  = new Model.Qskyd_fjrb();
            BLL.Qskyd_fjrb   B_Qskyd_fjrb  = new BLL.Qskyd_fjrb();
            BLL.Fwx_other    B_Fwx_other   = new BLL.Fwx_other();
            DataSet          DS_Qskyd_fjrb = new  DataSet();
            DataSet          DS_Fwx_other  = new DataSet();

            DS_Qskyd_fjrb = B_Qskyd_fjrb.GetList("1=1");
            DS_Fwx_other  = B_Fwx_other.GetList("1=1");
            if (DS_Qskyd_fjrb != null && DS_Qskyd_fjrb.Tables[0].Rows.Count > 0)
            {
                object[] args = new object[2];
                args[0] = DS_Fwx_other;
                args[1] = DS_Qskyd_fjrb;
                object result = jdgl_res_head_app.DynamicWebServiceCall.InvokeWebService(url, "Qskyd_fjrb_temp_ADD", args);
                if (result.ToString() == common_file.common_app.get_suc)
                {
                    Common_Shsc.Updatshsc(DS_Qskyd_fjrb, "Qskyd_fjrb");
                    Common_Shsc.Updatshsc(DS_Fwx_other, "Fwx_other");
                    i += Common_Shsc.GetRowCount(DS_Qskyd_fjrb);
                    i += Common_Shsc.GetRowCount(DS_Fwx_other);
                    Common.AddMsg(DS_Qskyd_fjrb, "上传房间类别");
                    Common.AddMsg(DS_Fwx_other, "上传维修房");
                }
            }
            return(i++);
        }
Esempio n. 2
0
        //2012.5.11本地传到远程的Qskyd_fjrb_temp然后在添加到Qskyd_fjrb表
        //1.如果有相同的lsbh就修改,否者添加。
        //2.最后和Qskyd_fjrb_temp这张表对比,如果Qskyd_fjrb not in(lsbh)的条件就删除
        //这样做是怕本的删除了远程有可能还有这条记录在
        public static string Add_Qskyd_fjrb(DataSet DS_Qskyd_fjrb, string yydh)
        {
            // id,yydh,qymc,lsbh,krxm,sktt,yddj,fjrb,fjbh,ddsj,lksj,lzfs,shqh,fjjg,sjfjjg,yh,yhbl,bz,is_top,
            //is_select,shsc,czy,czsj,cznr,sdcz,fjbm,jcje
            string s = common_file.common_app.get_failure;

            if (DS_Qskyd_fjrb != null && DS_Qskyd_fjrb.Tables[0].Rows.Count > 0)
            {
                Model.Qskyd_fjrb M_Qskyd_fjrb = new Model.Qskyd_fjrb();
                BLL.Qskyd_fjrb   B_Qskyd_fjrb = new BLL.Qskyd_fjrb();
                string           strlsbh_ds   = ""; //记录总的lsbh以“,”号隔开
                foreach (DataRow dr in DS_Qskyd_fjrb.Tables[0].Rows)
                {
                    string strLsbh = dr["lsbh"].ToString();
                    M_Qskyd_fjrb.lsbh      = dr["lsbh"].ToString();
                    M_Qskyd_fjrb.yydh      = dr["yydh"].ToString();
                    M_Qskyd_fjrb.qymc      = dr["qymc"].ToString();
                    M_Qskyd_fjrb.krxm      = dr["krxm"].ToString();
                    M_Qskyd_fjrb.sktt      = dr["sktt"].ToString();
                    M_Qskyd_fjrb.yddj      = dr["yddj"].ToString();
                    M_Qskyd_fjrb.fjrb      = dr["fjrb"].ToString();
                    M_Qskyd_fjrb.fjbh      = dr["fjbh"].ToString();
                    M_Qskyd_fjrb.ddsj      = Convert.ToDateTime(dr["ddsj"].ToString());
                    M_Qskyd_fjrb.lksj      = Convert.ToDateTime(dr["lksj"].ToString());
                    M_Qskyd_fjrb.lzfs      = Convert.ToDecimal(dr["lzfs"].ToString());
                    M_Qskyd_fjrb.shqh      = dr["shqh"].ToString();
                    M_Qskyd_fjrb.fjjg      = Convert.ToDecimal(dr["fjjg"].ToString());
                    M_Qskyd_fjrb.sjfjjg    = Convert.ToDecimal(dr["sjfjjg"].ToString());
                    M_Qskyd_fjrb.yh        = "";
                    M_Qskyd_fjrb.yhbl      = 0;
                    M_Qskyd_fjrb.bz        = "";
                    M_Qskyd_fjrb.is_top    = false;
                    M_Qskyd_fjrb.is_select = false;
                    M_Qskyd_fjrb.shsc      = true;
                    M_Qskyd_fjrb.czy       = dr["czy"].ToString();
                    M_Qskyd_fjrb.czsj      = Convert.ToDateTime(dr["czsj"].ToString());
                    M_Qskyd_fjrb.cznr      = dr["cznr"].ToString();

                    //如果有相同lsbh就修改,,然后添加。
                    DataSet ds = B_Qskyd_fjrb.GetList("lsbh='" + strLsbh + "' and fjrb='" + dr["fjrb"].ToString() + "'");

                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        int fid = Convert.ToInt32(ds.Tables[0].Rows[0]["id"].ToString());
                        M_Qskyd_fjrb.id = fid;
                        if (B_Qskyd_fjrb.Update(M_Qskyd_fjrb))
                        {
                            s = common_file.common_app.get_suc;
                        }
                    }
                    else
                    {
                        //添加到Qskyd_fjrb表里
                        if (B_Qskyd_fjrb.Add(M_Qskyd_fjrb) > 0)
                        {
                            s = common_file.common_app.get_suc;
                        }
                    }

                    strlsbh_ds += "'" + strLsbh + "'" + ",";  //累加lsbh以“,”号相隔
                }
                s = common_file.common_app.get_suc;
                //相反不相等的话就删除,防止本地删除中央服务器还没有删除lsbh not in
                if (strlsbh_ds.Length != 0)
                {
                    strlsbh_ds = strlsbh_ds.Remove(strlsbh_ds.Length - 1, 1);//删除最后一个,号
                    string strsql = "delete from Qskyd_fjrb where lsbh not in(" + strlsbh_ds + ") and yydh='" + yydh + "'";

                    DbHelperSQL.Exists(strsql);
                    s = common_file.common_app.get_suc;
                }
            }
            return(s);
        }
Esempio n. 3
0
        public void delete_fjrb(DataGridViewSummary dg_fjrb, Model.Qskyd_fjrb M_Qskyd_fjrb, BLL.Qskyd_fjrb B_Qskyd_fjrb)
        {
            common_file.common_app.get_czsj();
            if (dg_fjrb.Rows.Count > 0 && dg_fjrb.Rows[0].Cells["id"].Value != null && dg_fjrb.Rows[0].Cells["id"].Value.ToString() != string.Empty)
            {
                if (dg_fjrb.CurrentRow.Index >= 0 || dg_fjrb.Rows.Count > 0)
                {
                    if (common_file.common_app.message_box_show_select(common_file.common_app.message_title, "你真的要删除所选的记录吗?") == true)
                    {
                        string id = dg_fjrb.Rows[dg_fjrb.CurrentRow.Index].Cells["id"].Value.ToString();
                        M_Qskyd_fjrb = B_Qskyd_fjrb.GetModel(int.Parse(id));
                        if (M_Qskyd_fjrb != null)
                        {
                            if (M_Qskyd_fjrb.fjbh == "" && M_Qskyd_fjrb.fjrb == "")
                            {
                                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,当前记录只能修改!");
                                return;
                            }
                            if (M_Qskyd_fjrb.fjbh != "" && M_Qskyd_fjrb.fjrb != "")
                            {
                                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,排房记录不能在此删除!若要删除,请到主单去操作!");
                                return;
                            }
                            if (M_Qskyd_fjrb.fjbh == "" && M_Qskyd_fjrb.fjrb != "")
                            {
                                BLL.Common B_Common = new Hotel_app.BLL.Common();
                                DataSet    ds_temp  = B_Common.GetList("select * from Qskyd_fjrb", "lsbh='" + M_Qskyd_fjrb.lsbh + "'");
                                if (ds_temp != null && ds_temp.Tables[0].Rows.Count > 1)
                                {
                                    common_file.common_app.get_czsj();
                                    string   url  = common_file.common_app.service_url + "Qyddj/Qyddj_app.asmx";
                                    object[] args = new object[26];
                                    args[0]  = 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]  = M_Qskyd_fjrb.fjrb;
                                    args[8]  = M_Qskyd_fjrb.fjbh;
                                    args[9]  = M_Qskyd_fjrb.ddsj;
                                    args[10] = M_Qskyd_fjrb.lksj;
                                    args[11] = M_Qskyd_fjrb.lzfs;
                                    args[12] = M_Qskyd_fjrb.shqh;
                                    args[13] = M_Qskyd_fjrb.fjjg;
                                    args[14] = M_Qskyd_fjrb.sjfjjg;
                                    args[15] = M_Qskyd_fjrb.yh;
                                    args[16] = M_Qskyd_fjrb.yhbl;
                                    args[17] = M_Qskyd_fjrb.bz;
                                    args[18] = common_file.common_app.czy;
                                    args[19] = DateTime.Now;
                                    args[20] = common_file.common_app.chinese_delete;
                                    args[21] = M_Qskyd_fjrb.yddj;//有三种状态,一种预订、一种登记、一种预订转登记
                                    args[22] = common_file.common_app.get_delete;
                                    args[23] = common_file.common_app.xxzs;
                                    args[24] = "";
                                    args[25] = decimal.Parse("0");

                                    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 == common_file.common_app.get_suc)
                                    {
                                        dg_fjrb.Rows.Remove(dg_fjrb.CurrentRow);
                                        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, "操作失败!");
                                    }
                                }
                                else
                                {
                                    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, "你好,找不到相应的记录!");
                        }
                    }
                }

                else
                {
                    //提示
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, "你好,你没有选择任何信息!");
                }
            }
            Cursor.Current = Cursors.Default;
        }
Esempio n. 4
0
        //2012.5.11本地传到远程的Qskyd_fjrb_temp然后在添加到Qskyd_fjrb表
        //1.如果有相同的lsbh就修改,否者添加。
        //2.最后和Qskyd_fjrb_temp这张表对比,如果Qskyd_fjrb not in(lsbh)的条件就删除
        //这样做是怕本的删除了远程有可能还有这条记录在
        public static string Add_Qskyd_fjrb(DataSet DS_Qskyd_fjrb, string yydh)
        {
            // id,yydh,qymc,lsbh,krxm,sktt,yddj,fjrb,fjbh,ddsj,lksj,lzfs,shqh,fjjg,sjfjjg,yh,yhbl,bz,is_top,
            //is_select,shsc,czy,czsj,cznr,sdcz,fjbm,jcje
            string s = common_file.common_app.get_failure;

            if (DS_Qskyd_fjrb != null && DS_Qskyd_fjrb.Tables[0].Rows.Count > 0)
            {
                string strsql_03 = "delete from Qskyd_fjrb where isok=1 and yydh='" + yydh + "'";
                DbHelperSQL.ExecuteSql(strsql_03);
                Model.Qskyd_fjrb M_Qskyd_fjrb = new Model.Qskyd_fjrb();
                BLL.Qskyd_fjrb   B_Qskyd_fjrb = new BLL.Qskyd_fjrb();
                foreach (DataRow dr in DS_Qskyd_fjrb.Tables[0].Rows)
                {
                    string strLsbh = dr["lsbh"].ToString();
                    M_Qskyd_fjrb.lsbh      = dr["lsbh"].ToString();
                    M_Qskyd_fjrb.yydh      = dr["yydh"].ToString();
                    M_Qskyd_fjrb.qymc      = dr["qymc"].ToString();
                    M_Qskyd_fjrb.krxm      = dr["krxm"].ToString();
                    M_Qskyd_fjrb.sktt      = dr["sktt"].ToString();
                    M_Qskyd_fjrb.yddj      = dr["yddj"].ToString();
                    M_Qskyd_fjrb.fjrb      = dr["fjrb"].ToString();
                    M_Qskyd_fjrb.fjbh      = dr["fjbh"].ToString();
                    M_Qskyd_fjrb.ddsj      = Convert.ToDateTime(dr["ddsj"].ToString());
                    M_Qskyd_fjrb.lksj      = Convert.ToDateTime(dr["lksj"].ToString());
                    M_Qskyd_fjrb.lzfs      = Convert.ToDecimal(dr["lzfs"].ToString());
                    M_Qskyd_fjrb.shqh      = dr["shqh"].ToString();
                    M_Qskyd_fjrb.fjjg      = Convert.ToDecimal(dr["fjjg"].ToString());
                    M_Qskyd_fjrb.sjfjjg    = Convert.ToDecimal(dr["sjfjjg"].ToString());
                    M_Qskyd_fjrb.yh        = "";
                    M_Qskyd_fjrb.yhbl      = 0;
                    M_Qskyd_fjrb.bz        = "";
                    M_Qskyd_fjrb.is_top    = false;
                    M_Qskyd_fjrb.is_select = false;
                    M_Qskyd_fjrb.shsc      = true;
                    M_Qskyd_fjrb.czy       = dr["czy"].ToString();
                    M_Qskyd_fjrb.czsj      = Convert.ToDateTime(dr["czsj"].ToString());
                    M_Qskyd_fjrb.cznr      = dr["cznr"].ToString();


                    M_Qskyd_fjrb.isok = true;
                    //如果有相同lsbh就修改,,然后添加。
                    DataSet ds = B_Qskyd_fjrb.GetList("lsbh='" + strLsbh + "' and fjrb='" + dr["fjrb"].ToString() + "' and fjbh='" + dr["fjbh"].ToString() + "' and lzfs='" + dr["lzfs"].ToString() + "' and ddsj='" + dr["ddsj"] + "' and lksj='" + dr["lksj"] + "' and isok=0 ");
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        int    fid       = Convert.ToInt32(ds.Tables[0].Rows[0]["id"].ToString());
                        string strsql_01 = "update Qskyd_fjrb set isok=1 where id=" + fid + "";
                        if (DbHelperSQL.ExecuteSql(strsql_01) > 0)
                        {
                            M_Qskyd_fjrb.id = fid;
                            B_Qskyd_fjrb.Update(M_Qskyd_fjrb);
                            s = common_file.common_app.get_suc;
                        }
                    }
                    else
                    {
                        //添加到Qskyd_fjrb表里
                        if (B_Qskyd_fjrb.Add(M_Qskyd_fjrb) > 0)
                        {
                            s = common_file.common_app.get_suc;
                        }
                    }
                }
                string strsql = "delete from Qskyd_fjrb where isok=0 and yydh='" + yydh + "'";
                DbHelperSQL.ExecuteSql(strsql);

                string strsql_02 = "update Qskyd_fjrb set isok=0 where yydh='" + yydh + "'";
                DbHelperSQL.ExecuteSql(strsql_02);
                s = common_file.common_app.get_suc;
            }
            return(s);
        }
Esempio n. 5
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);
        }