Exemplo n.º 1
0
        //用于网上预定门店确认后,向中心服务器表:Qttyd_ydzxqr  插入数据,并修改本地Qttyd_ydzxqr表的shsc为1
        public static string InsertToQttyd_ydzxqr()
        {
            string ss = common_app.get_failure;

            Model.Qyqskyd_ydzxqr M_Qyqskyd_ydzxqr = new Model.Qyqskyd_ydzxqr();
            BLL.Qyqskyd_ydzxqr   B_Qyqskyd_ydzxqr = new BLL.Qyqskyd_ydzxqr();
            DataSet DS_UploadData = B_Qyqskyd_ydzxqr.GetList(" shsc='0'  ");

            if (DS_UploadData != null && DS_UploadData.Tables[0].Rows.Count > 0)
            {
                try
                {
                    //调用webservices(整体成功后才修改本地的状态)
                    url = common_file.Common.ReadXML("add", "url") + "/Qyddj/Qyddj_app.asmx";
                    object[] obj = new object[1];
                    obj[0] = DS_UploadData;
                    object result = jdgl_res_head_app.DynamicWebServiceCall.InvokeWebService(url, "Qyqskyd_ydzxqr_ad", obj);
                    if (result.ToString() == common_app.get_suc)
                    {
                        Common_Shsc.Updatshsc(DS_UploadData, "Qyqskyd_ydzxqr");//修改本地shsc=1
                    }
                }
                //错误生成之后,写错误日志,执行重启操作
                catch (Exception ee)
                {
                    //开始写日志
                    errorInfo = ee.Message.ToString();
                    postion   = "向中心服务器表:Qttyd_ydzxqr 插入数据之后的过程";
                    Common.WriteLog(errorInfo, postion);
                }
            }
            return(ss);
        }
Exemplo n.º 2
0
        //门店下载网上预定确定后添加到该表
        public string Qyqskyd_ydzxqr_ad(DataSet DS_Qyqskyd_ydzxqr_downloadData)
        {
            string ss = common_file.common_app.get_failure;

            BLL.Qyqskyd_ydzxqr   B_Qyqskyd_ydzxqr = new BLL.Qyqskyd_ydzxqr();
            Model.Qyqskyd_ydzxqr M_Qyqskyd_ydzxqr = new Model.Qyqskyd_ydzxqr();
            foreach (DataRow dr in DS_Qyqskyd_ydzxqr_downloadData.Tables[0].Rows)
            {
                SqlParameter[] parameters =
                {
                    new SqlParameter("@lsbh", SqlDbType.VarChar,   100),
                    new SqlParameter("@qrzt", SqlDbType.VarChar,    50),
                    new SqlParameter("@qrsj", SqlDbType.DateTime),
                    new SqlParameter("@qryy", SqlDbType.VarChar,   200),
                    new SqlParameter("@czy",  SqlDbType.VarChar,    50),
                    new SqlParameter("@shsc", SqlDbType.Bit,         1),
                    new SqlParameter("@scsj", SqlDbType.DateTime),
                    new SqlParameter("@fjrb", SqlDbType.VarChar,    50),
                    new SqlParameter("@qymc", SqlDbType.VarChar,    50),
                    new SqlParameter("@yydh", SqlDbType.VarChar, 50)
                };
                parameters[0].Value = dr["lsbh"];
                parameters[1].Value = dr["qrzt"];
                parameters[2].Value = Convert.ToDateTime(dr["qrsj"]);
                parameters[3].Value = dr["qryy"];
                parameters[4].Value = dr["czy"];
                parameters[5].Value = true;
                parameters[6].Value = Convert.ToDateTime(dr["scsj"]);
                parameters[7].Value = dr["fjrb"];
                parameters[8].Value = dr["qymc"];
                parameters[9].Value = dr["yydh"];


                int result = SqlHelper.ExecuteNonQuery(CommandType.StoredProcedure, "Qyqskyd_ydzxqr_ADD", parameters);
                //成功继续
                if (result > 0)
                {
                    ss = common_file.common_app.get_suc;
                    continue;
                }
                //否则中断
                else
                {
                    ss = common_file.common_app.get_failure;
                    break;
                }
            }
            return(ss);
        }