コード例 #1
0
 /// <remarks/>
 public void partQueryAsync(string RequestUser, string RequestTime, string RequestType, string update_date, clientInfo clientInfo)
 {
     this.partQueryAsync(RequestUser, RequestTime, RequestType, update_date, clientInfo, null);
 }
コード例 #2
0
 /// <remarks/>
 public void partQueryAsync(string RequestUser, string RequestTime, string RequestType, string update_date, clientInfo clientInfo, object userState)
 {
     if ((this.partQueryOperationCompleted == null))
     {
         this.partQueryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnpartQueryOperationCompleted);
     }
     this.InvokeAsync("partQuery", new object[] {
         RequestUser,
         RequestTime,
         RequestType,
         update_date,
         clientInfo
     }, this.partQueryOperationCompleted, userState);
 }
コード例 #3
0
        public Result partQuery([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_date, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] clientInfo clientInfo)
        {
            object[] results = this.Invoke("partQuery", new object[] {
                RequestUser,
                RequestTime,
                RequestType,
                update_date,
                clientInfo
            });

            return((Result)(results[0]));
        }
コード例 #4
0
        /// <summary> 配件信息同步
        /// </summary>
        /// <param name="updateTime">最后更新时间</param>
        /// <returns>返回同步配件信息条数,如为-1,同步失败</returns>
        public static int LoadPart(string updateTime)
        {
            ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;

            QueryPart.clientInfo clientInfo = new QueryPart.clientInfo();
            clientInfo.clientID  = GlobalStaticObj_Servier.Instance.ClientID;
            clientInfo.serviceID = "partQuery";
            QueryPart.partQueryService serv = new QueryPart.partQueryService();
            string dtNow = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            QueryPart.Result result = serv.partQuery(GlobalStaticObj_Servier.Instance.ClientID, dtNow, "QUERY", updateTime, clientInfo);
            if (result.state == "F")
            {
                return(-1);
            }
            QueryPart.part[] partArr = result.Details;
            if (partArr.Length == 0)
            {
                return(0);
            }

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

            foreach (QueryPart.part item in partArr)
            {
                SysSQLString sysSQLString = new SysSQLString();
                sysSQLString.cmdType = CommandType.Text;
                sysSQLString.Param   = new Dictionary <string, string>();
                StringBuilder strSql         = new StringBuilder();
                bool          isContactExist = DBHelper.IsExist("判断配件信息是否存在", "tb_parts", "car_parts_code='" + item.car_parts_code + "'");
                if (isContactExist)
                {
                    #region 更新语句
                    strSql.Append(" update tb_parts set ");
                    strSql.Append(" parts_name = @parts_name , ");
                    strSql.Append(" sales_unit_code = @sales_unit_code , ");
                    strSql.Append(" sales_unit_name = @sales_unit_name , ");
                    strSql.Append(" model = @model , ");
                    strSql.Append(" status = @status , ");
                    strSql.Append(" retail = @retail , ");
                    strSql.Append(" price3a = @price3a , ");
                    strSql.Append(" price2a = @price2a , ");
                    strSql.Append(" replaced = @replaced , ");
                    strSql.Append(" base_unit_code = @base_unit_code , ");
                    strSql.Append(" base_unit_name = @base_unit_name , ");
                    strSql.Append(" sales_unit_quantity = @sales_unit_quantity , ");
                    strSql.Append(" base_unit_quantity = @base_unit_quantity , ");
                    strSql.Append(" update_time = @update_time ");
                    strSql.Append(" where car_parts_code=@car_parts_code;  ");
                    #endregion
                }
                else
                {
                    #region 插入语句
                    strSql.Append(" insert into tb_parts(");
                    strSql.Append("parts_id,parts_name,sales_unit_code,data_source,sales_unit_name,model,retail,price3a,price2a,status,enable_flag,replaced,base_unit_code,base_unit_name,sales_unit_quantity,base_unit_quantity,create_by,create_time,update_by,update_time");
                    strSql.Append(") values (");
                    strSql.Append("@parts_id,@parts_name,@sales_unit_code,@data_source,@sales_unit_name,@model,@retail,@price3a,@price2a,@status,@enable_flag,@replaced,@base_unit_code,@base_unit_name,@sales_unit_quantity,@base_unit_quantity,@create_by,@create_time,@update_by,@update_time");
                    strSql.Append(");  ");
                    #endregion
                    sysSQLString.Param.Add("parts_id", Guid.NewGuid().ToString());
                    sysSQLString.Param.Add("create_by", GlobalStaticObj_Servier.Instance.UserID);
                    sysSQLString.Param.Add("create_time", nowTicks);
                }
                #region 参数项 9
                sysSQLString.sqlString = strSql.ToString();
                sysSQLString.Param.Add("parts_name", item.parts_name);
                sysSQLString.Param.Add("sales_unit_code", item.unit_code);
                sysSQLString.Param.Add("sales_unit_name", item.unit_name);
                sysSQLString.Param.Add("model", item.model);
                sysSQLString.Param.Add("status", item.status);
                sysSQLString.Param.Add("retail", item.retail);
                sysSQLString.Param.Add("price3a", item.price3a);
                sysSQLString.Param.Add("price2a", item.price2a);
                //sysSQLString.Param.Add("replaced", item.partReplace);替代关系处理
                sysSQLString.Param.Add("base_unit_code", item.basic_unit_code);
                sysSQLString.Param.Add("base_unit_name", item.basic_unit_name);
                sysSQLString.Param.Add("sales_unit_quantity", item.unit_name_quantity);
                sysSQLString.Param.Add("base_unit_quantity", item.basic_unit_quantity);
                sysSQLString.Param.Add("enable_flag", ((int)DataSources.EnumEnableFlag.USING).ToString());
                sysSQLString.Param.Add("data_source", ((int)DataSources.EnumDataSources.YUTONG).ToString());
                sysSQLString.Param.Add("update_by", GlobalStaticObj_Servier.Instance.ClientID);
                sysSQLString.Param.Add("update_time", nowTicks);
                #endregion
                list.Add(sysSQLString);

                foreach (QueryPart.replaceDetail item0 in item.partReplace)
                {
                    SysSQLString sysSQLString0 = new SysSQLString();
                    sysSQLString0.cmdType = CommandType.Text;
                    sysSQLString0.Param   = new Dictionary <string, string>();
                    StringBuilder strSql0         = new StringBuilder();
                    bool          isContactExist0 = DBHelper.IsExist("判断配件替代信息是否存在", "tb_parts_replace", "repl_parts_code='" + item0.repl_parts_code + "'");
                    if (isContactExist0)
                    {
                        #region 更新语句
                        strSql0.Append(" update tb_parts_replace set ");
                        strSql0.Append(" repl_parts_status = @repl_parts_status , ");
                        strSql0.Append(" repl_remark = @repl_remark , ");
                        strSql0.Append(" change = @change ");
                        strSql0.Append(" update_time = @update_time ");
                        strSql0.Append(" where repl_parts_code=@repl_parts_code;  ");
                        #endregion
                    }
                    else
                    {
                        #region 插入语句
                        strSql0.Append(" insert into tb_parts_replace(");
                        strSql0.Append("replace_id,repl_parts_status,repl_remark,change,create_by,create_time,update_by,update_time");
                        strSql0.Append(") values (");
                        strSql0.Append("@replace_id,@repl_parts_status,@repl_remark,@change,@create_by,@create_time,@update_by,@update_time");
                        strSql0.Append("); ");
                        #endregion
                        sysSQLString0.Param.Add("replace_id", Guid.NewGuid().ToString());
                        sysSQLString0.Param.Add("create_by", GlobalStaticObj_Servier.Instance.UserID);
                        sysSQLString0.Param.Add("create_time", nowTicks);
                    }
                    #region
                    sysSQLString0.sqlString = strSql0.ToString();
                    sysSQLString0.Param.Add("repl_parts_status", item0.repl_parts_status);
                    sysSQLString0.Param.Add("repl_remark", item0.repl_remark);
                    sysSQLString0.Param.Add("change", item0.change);
                    sysSQLString0.Param.Add("repl_parts_code", item0.repl_parts_code);
                    sysSQLString0.Param.Add("update_by", GlobalStaticObj_Servier.Instance.ClientID);
                    sysSQLString0.Param.Add("update_time", nowTicks);
                    #endregion
                    list.Add(sysSQLString0);
                }
            }
            bool flag = DBHelper.BatchExeSQLStringMultiByTrans("宇通:同步车型", list);
            if (!flag)
            {
                return(-1);
            }
            return(partArr.Length);
        }