コード例 #1
0
        public SectionMigrated Migrate(string sectionName)
        {
            if (_currentConfiguration == null)
            {
                throw new MigrationException("Initialize must be called before get Migrate is invoked, in order to load the proper configuration", null);
            }

            var section = _currentConfiguration.Sections[sectionName];
            //TODO if null
            var         xmlDetails  = GetXmlDetails(section);
            JsonDetails jsonDetails = xmlDetails == null ? null : GetJsonDetails(xmlDetails);

            return(new SectionMigrated()
            {
                JsonDetails = jsonDetails,
                XmlDetails = xmlDetails,
                SectionName = sectionName,
                SectionTypeName = section.SectionInformation.Type
                                  //TODO add error result property?
            });
        }
コード例 #2
0
        /// <summary>
        /// 根据分组,查询待装车信息
        /// </summary>
        /// <param name="groupNo"></param>
        /// <returns></returns>
        public List <SOHeaderEntity> Details(string groupNo)
        {
            List <SOHeaderEntity> list = new List <SOHeaderEntity>();

            try
            {
                #region 请求数据
                System.Text.StringBuilder loStr = new System.Text.StringBuilder();
                loStr.Append("groupNo=").Append(groupNo);
                string jsonQuery = WebWork.SendRequest(loStr.ToString(), WebWork.URL_Details);
                if (string.IsNullOrEmpty(jsonQuery))
                {
                    MsgBox.Warn(WebWork.RESULT_NULL);
                    //LogHelper.InfoLog(WebWork.RESULT_NULL);
                    return(list);
                }
                #endregion

                #region 正常错误处理

                JsonDetails bill = JsonConvert.DeserializeObject <JsonDetails>(jsonQuery);
                if (bill == null)
                {
                    //MsgBox.Warn(WebWork.JSON_DATA_NULL);
                    return(list);
                }
                if (bill.flag != 0)
                {
                    MsgBox.Warn(bill.error);
                    return(list);
                }
                #endregion

                #region 赋值数据
                foreach (JsonDetailsResult jbr in bill.result)
                {
                    SOHeaderEntity asnEntity = new SOHeaderEntity();
                    #region 0-10
                    asnEntity.Address      = jbr.address;
                    asnEntity.BillID       = Convert.ToInt32(jbr.billId);
                    asnEntity.BillNO       = jbr.billNo;
                    asnEntity.BillType     = jbr.billType;
                    asnEntity.BillTypeName = jbr.billTypeName;
                    asnEntity.BoxNum       = Convert.ToInt32(jbr.boxNum);
                    asnEntity.CaseBoxNum   = Convert.ToInt32(jbr.caseBoxNum);
                    asnEntity.Consignee    = jbr.contact;
                    asnEntity.ContractNO   = jbr.contractNo;
                    asnEntity.CustomerName = jbr.cName;
                    #endregion
                    #region 11-20
                    asnEntity.DelayMark         = Convert.ToInt32(jbr.delayMark);
                    asnEntity.FromWarehouse     = jbr.fromWhCode;
                    asnEntity.FromWarehouseName = jbr.fromWhName;
                    asnEntity.OrderSort         = Convert.ToInt32(jbr.orderSort);
                    asnEntity.OutstoreType      = jbr.outStoreType;
                    asnEntity.OutstoreTypeName  = jbr.outStoreTypeName;
                    asnEntity.PickZnType        = jbr.pickZnType;
                    asnEntity.PickZnTypeName    = jbr.pickZnTypeName;
                    asnEntity.Remark            = jbr.remark;
                    asnEntity.RowForeColor      = Convert.ToInt32(jbr.rowColor);
                    #endregion
                    #region 21-30
                    asnEntity.SalesMan     = jbr.salesMan;
                    asnEntity.ShipNO       = jbr.shipNo;
                    asnEntity.ShTel        = jbr.phone;
                    asnEntity.Status       = jbr.billState;
                    asnEntity.StatusName   = jbr.statusName;
                    asnEntity.VehicleNO    = jbr.vehicleNo;
                    asnEntity.WmsRemark    = jbr.wmsRemark;
                    asnEntity.XCoor        = Convert.ToDecimal(jbr.xCoor);
                    asnEntity.YCoor        = Convert.ToDecimal(jbr.yCoor);
                    asnEntity.CustomerCode = jbr.cCode;
                    //asnEntity.FromWarehouseName = jbr.wh_name;
                    #endregion

                    #region
                    try
                    {
                        if (!string.IsNullOrEmpty(jbr.closeDate))
                        {
                            asnEntity.CloseDate = Convert.ToDateTime(jbr.closeDate);
                        }
                    }
                    catch (Exception msg)
                    {
                        MsgBox.Warn(msg.Message);
                        //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg);
                    }
                    #endregion

                    #region
                    try
                    {
                        if (!string.IsNullOrEmpty(jbr.createDate))
                        {
                            asnEntity.CreateDate = Convert.ToDateTime(jbr.createDate);
                        }
                    }
                    catch (Exception msg)
                    {
                        MsgBox.Warn(msg.Message);
                        //LogHelper.errorLog("FrmVehicle+QueryNotRelatedBills", msg);
                    }
                    #endregion

                    list.Add(asnEntity);
                }
                return(list);

                #endregion
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
            return(list);
        }
コード例 #3
0
 public async Task <bool> Delete(JsonDetails entity)
 {
     _db.jsonDetails.Remove(entity);
     return(await Save());
 }
コード例 #4
0
 public async Task <bool> Update(JsonDetails entity)
 {
     _db.jsonDetails.Update(entity);
     return(await Save());
 }
コード例 #5
0
        public async Task <bool> Create(JsonDetails entity)
        {
            await _db.jsonDetails.AddAsync(entity);

            return(await Save());
        }