Esempio n. 1
0
 /// <remarks/>
 public void prodImprovementQueryAsync(string RequestUser, string RequestTime, string RequestType, string update_time, clientInfo clientInfo)
 {
     this.prodImprovementQueryAsync(RequestUser, RequestTime, RequestType, update_time, clientInfo, null);
 }
Esempio n. 2
0
 /// <remarks/>
 public void prodImprovementQueryAsync(string RequestUser, string RequestTime, string RequestType, string update_time, clientInfo clientInfo, object userState)
 {
     if ((this.prodImprovementQueryOperationCompleted == null))
     {
         this.prodImprovementQueryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnprodImprovementQueryOperationCompleted);
     }
     this.InvokeAsync("prodImprovementQuery", new object[] {
         RequestUser,
         RequestTime,
         RequestType,
         update_time,
         clientInfo
     }, this.prodImprovementQueryOperationCompleted, userState);
 }
Esempio n. 3
0
        public Result prodImprovementQuery([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string RequestUser, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string RequestTime, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string RequestType, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string update_time, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] clientInfo clientInfo)
        {
            object[] results = this.Invoke("prodImprovementQuery", new object[] {
                RequestUser,
                RequestTime,
                RequestType,
                update_time,
                clientInfo
            });

            return((Result)(results[0]));
        }
Esempio n. 4
0
        /// <summary> 产品改进号信息同步
        /// </summary>
        /// <param name="updateTime">最后更新时间</param>
        /// <returns>返回产品改进号条数,如为-1,同步失败</returns>
        public static int LoadProdImprovement(string updateTime)
        {
            ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;

            QueryProdImprovement.clientInfo clientInfo = new QueryProdImprovement.clientInfo();
            clientInfo.clientID  = GlobalStaticObj_Servier.Instance.ClientID;
            clientInfo.serviceID = "prodImprovementQuery";
            QueryProdImprovement.prodImprovementQueryService serv = new  QueryProdImprovement.prodImprovementQueryService();
            QueryProdImprovement.Result result = serv.prodImprovementQuery(GlobalStaticObj_Servier.Instance.ClientID, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "QUERY", updateTime, clientInfo);
            if (result.state == "F")
            {
                return(-1);
            }
            QueryProdImprovement.prodImprovement[] ProdArr = result.Details;
            if (ProdArr.Length == 0)
            {
                return(0);
            }

            string nowTicks          = Common.LocalDateTimeToUtcLong(DateTime.Now).ToString();
            List <SysSQLString> list = new List <SysSQLString>();

            foreach (QueryProdImprovement.prodImprovement item in ProdArr)
            {
                SysSQLString sysSQLString = new SysSQLString();
                sysSQLString.cmdType = CommandType.Text;
                sysSQLString.Param   = new Dictionary <string, string>();
                StringBuilder strSql         = new StringBuilder();
                bool          isContactExist = DBHelper.IsExist("判断产品改进号是否存在", "tb_product_no", "service_code='" + item.service_code + "'");
                if (isContactExist)
                {
                    #region 更新语句
                    strSql.Append(" update tb_product_no set ");
                    strSql.Append(" activities = @activities , ");
                    strSql.Append(" service_type = @service_type , ");
                    strSql.Append(" sart_date = @sart_date , ");
                    strSql.Append(" begin_date = @begin_date , ");
                    strSql.Append(" end_date = @end_date , ");
                    strSql.Append(" service_memo = @service_memo , ");
                    strSql.Append(" update_time = @update_time ");
                    strSql.Append(" where service_code=@service_code;  ");
                    #endregion
                }
                else
                {
                    #region 插入语句
                    strSql.Append(" insert into tb_product_no(");
                    strSql.Append("p_no_id,activities,service_type,sart_date,begin_date,end_date,service_memo,service_code,create_by,create_time,update_by,update_time");
                    strSql.Append(") values (");
                    strSql.Append("@p_no_id,@activities,@service_type,@sart_date,@begin_date,@end_date,@service_memo,@service_code,@create_by,@create_time,@update_by,@update_time");
                    strSql.Append(");  ");
                    #endregion
                    sysSQLString.Param.Add("p_no_id", Guid.NewGuid().ToString());
                    sysSQLString.Param.Add("create_by", GlobalStaticObj_Servier.Instance.ClientID);
                    sysSQLString.Param.Add("create_time", nowTicks);
                }
                #region 参数项 9
                sysSQLString.sqlString = strSql.ToString();
                sysSQLString.Param.Add("activities", item.activities);
                sysSQLString.Param.Add("service_code", item.service_code);
                sysSQLString.Param.Add("service_type", item.service_type);
                sysSQLString.Param.Add("sart_date", Common.LocalDateTimeToUtcLong(DateTime.Parse(string.IsNullOrEmpty(item.sart_date) ? DateTime.MinValue.ToString() : item.sart_date.ToString())).ToString());
                sysSQLString.Param.Add("begin_date", Common.LocalDateTimeToUtcLong(DateTime.Parse(item.begin_date)).ToString());
                sysSQLString.Param.Add("end_date", Common.LocalDateTimeToUtcLong(DateTime.Parse(item.end_date)).ToString());
                sysSQLString.Param.Add("service_memo", item.service_memo);
                sysSQLString.Param.Add("update_by", GlobalStaticObj_Servier.Instance.ClientID);
                sysSQLString.Param.Add("update_time", nowTicks);
                #endregion
                list.Add(sysSQLString);

                foreach (QueryProdImprovement.BusDetail item0 in item.BusDetails)
                {
                    SysSQLString sysSQLString0 = new SysSQLString();
                    sysSQLString0.cmdType = CommandType.Text;
                    sysSQLString0.Param   = new Dictionary <string, string>();
                    StringBuilder strSql0         = new StringBuilder();
                    bool          isContactExist0 = DBHelper.IsExist("判断产品改进号车辆信息是否存在", "tb_product_no_vehicle", "vehicle_code='" + item0.vehicle_code + "'");
                    if (isContactExist0)
                    {
                        #region 更新语句
                        strSql0.Append(" update tb_product_no_vehicle set ");
                        strSql0.Append(" account_code = @account_code , ");
                        strSql0.Append(" server_station = @server_station , ");
                        strSql0.Append(" update_time = @update_time ");
                        strSql0.Append(" where vehicle_code=@vehicle_code;  ");
                        #endregion
                    }
                    else
                    {
                        #region 插入语句
                        strSql0.Append(" insert into tb_product_no_vehicle(");
                        strSql0.Append("p_no_v_id,account_code,server_station,create_by,create_time,update_by,update_time");
                        strSql0.Append(") values (");
                        strSql0.Append("@p_no_v_id,@account_code,@server_station,@create_by,@create_time,@update_by,@update_time");
                        strSql0.Append("); ");
                        #endregion
                        sysSQLString0.Param.Add("p_no_v_id", Guid.NewGuid().ToString());
                        sysSQLString0.Param.Add("create_by", GlobalStaticObj_Servier.Instance.ClientID);
                        sysSQLString0.Param.Add("create_time", nowTicks);
                    }
                    #region
                    sysSQLString0.sqlString = strSql0.ToString();
                    sysSQLString0.Param.Add("account_code", item0.account_code);
                    sysSQLString0.Param.Add("server_station", item0.server_station);
                    sysSQLString0.Param.Add("update_by", GlobalStaticObj_Servier.Instance.ClientID);
                    sysSQLString0.Param.Add("update_time", nowTicks);
                    #endregion
                    list.Add(sysSQLString0);
                }

                foreach (QueryProdImprovement.PartDetail item1 in item.PartDetails)
                {
                    SysSQLString sysSQLString1 = new SysSQLString();
                    sysSQLString1.cmdType = CommandType.Text;
                    sysSQLString1.Param   = new Dictionary <string, string>();
                    StringBuilder strSql1         = new StringBuilder();
                    bool          isContactExist1 = DBHelper.IsExist("判断产品改进号配件信息是否存在", "tb_product_no_part", "part_code='" + item1.part_code + "'");
                    if (isContactExist1)
                    {
                        #region 更新语句
                        strSql1.Append(" update tb_product_no_part set ");
                        strSql1.Append(" quantity = @quantity , ");
                        strSql1.Append(" uint = @uint , ");
                        strSql1.Append(" update_time = @update_time ");
                        strSql1.Append(" where part_code=@part_code;  ");
                        #endregion
                    }
                    else
                    {
                        #region 插入语句
                        strSql1.Append(" insert into tb_product_no_part(");
                        strSql1.Append("p_no_part_id,part_code,quantity,uint,create_by,create_time,update_by,update_time");
                        strSql1.Append(") values (");
                        strSql1.Append("@p_no_part_id,@part_code,@quantity,@uint,@create_by,@create_time,@update_by,@update_time");
                        strSql1.Append("); ");
                        #endregion
                        sysSQLString1.Param.Add("p_no_part_id", Guid.NewGuid().ToString());
                        sysSQLString1.Param.Add("create_by", GlobalStaticObj_Servier.Instance.ClientID);
                        sysSQLString1.Param.Add("create_time", nowTicks);
                    }
                    #region
                    sysSQLString1.sqlString = strSql1.ToString();
                    sysSQLString1.Param.Add("part_code", item1.part_code);
                    sysSQLString1.Param.Add("quantity", item1.quantity);
                    sysSQLString1.Param.Add("uint", item1.@uint);
                    sysSQLString1.Param.Add("update_by", GlobalStaticObj_Servier.Instance.ClientID);
                    sysSQLString1.Param.Add("update_time", nowTicks);
                    #endregion
                    list.Add(sysSQLString1);
                }
            }
            bool flag = DBHelper.BatchExeSQLStringMultiByTrans("宇通:同步车型", list);
            if (!flag)
            {
                return(-1);
            }
            return(ProdArr.Length);
        }