Example #1
0
        /// <summary>
        /// 发送数据到U9
        /// </summary>
        /// <param name="count">扎数</param>
        /// <param name="Weight">重量</param>
        /// <param name="ExtensionField2">堆位</param>
        /// <param name="ExtensionField3">过磅单号</param>
        /// <param name="ShipmentNumber">采购单</param>
        /// <param name="DepartmentCode">部门代码</param>
        public static bool sendDate(int count, double Weight, string ExtensionField2, string ExtensionField3, string ShipmentNumber, string DepartmentCode)
        {
            try
            {
                LWU9WebReference.LooseWastePaperManagement_v001 lw = new EMEWEQUALITY.LWU9WebReference.LooseWastePaperManagement_v001();

                string OrganizationID = Common.OrganizationID;//公司代号
                LoosePaperTruckLoadU9Type TruckLoad = new LoosePaperTruckLoadU9Type();
                WeightType wt = new WeightType();
                wt.Value = Convert.ToDecimal(Weight);
                WeightUnitType wut = WeightUnitType.kg;

                Weight                        = (double)Weight / (double)1000;
                TruckLoad.Count               = count;           //扎数
                TruckLoad.Weight              = Weight;          //重量
                TruckLoad.ExtensionField2     = ExtensionField2; //堆位
                TruckLoad.ExtensionField3     = ExtensionField3; //过磅单号
                TruckLoad.WorkshopMachineID   = "201311111111";
                TruckLoad.DepartmentCode      = DepartmentCode;  //部门代码
                TruckLoad.BusinessDate        = DateTime.Now;
                TruckLoad.TruckLoadDocumentID = "10";

                RequestHeaderType rht = new RequestHeaderType();
                rht.SourceID     = Common.SourceID;
                lw.Url           = Common.SendURL;
                lw.RequestHeader = rht;//数据源(发起请求应用名)
                LoosePaperContainerShareU9Type[] Distribution = new LoosePaperContainerShareU9Type[1];
                LoosePaperContainerShareU9Type   lpc          = new LoosePaperContainerShareU9Type();
                //必填
                lpc.ContainerID                      = "30";
                lpc.IsGettingShare                   = true;
                lpc.PONumber                         = "20";
                lpc.ShipmentNumber                   = ShipmentNumber;//采购单
                lpc.UnloadPlatform                   = "备注";
                lpc.Memo                             = "20.质检纸";
                lpc.TypeOfWeighedWastePaper          = TypeOfWeighedWastePaperType.BaleLocal;//纸种
                lpc.TypeOfWeighedWastePaperSpecified = true;

                Distribution[0] = lpc;
                string DistributionMemo = "cs1";

                System.Xml.XmlAttribute[] AnyAttr = new System.Xml.XmlAttribute[0];
                lpc.AnyAttr = AnyAttr;

                ReplyMessageType message = lw.RegisterLoosePaperDistribution(OrganizationID, TruckLoad, DistributionMemo, Distribution, AnyAttr);
                if (message.ResultCode.ToString() == "Successful")
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return(false);
            }
        }
Example #2
0
        /// <summary>
        /// Converts weights from kg to lbs or lbs to kg.
        /// </summary>
        /// <param name="weight">Weight to convert.</param>
        /// <param name="fromUnits">The units that the weights is in.</param>
        /// <param name="toUnits">The units to convert the weights to.</param>
        /// <returns>A weights in the specified unit of measurement.</returns>
        public static double CovertWeight(double weight, WeightUnitType fromUnits, WeightUnitType toUnits)
        {
            if (fromUnits == toUnits || double.IsNaN(weight))
            {
                return(weight);
            }

            //Convert the distance to kilograms
            if (fromUnits == WeightUnitType.Pound)
            {
                weight *= 0.45359237;
            }

            if (toUnits == WeightUnitType.Pound)
            {
                weight *= 2.20462262;
            }

            return(weight);
        }
Example #3
0
        public static Vitalsign CreateVitalsign(long patNum, int height   = 0, int weight            = 0, int bpSystolic = 0, int bpDiastolic = 0, DateTime date = default(DateTime),
                                                bool hasFollowUpPlan      = false, bool isIneligible = false, string documentation = "", bool childGotNutrition = false, bool childGotPhysCouns = false,
                                                WeightUnitType weightCode = default(WeightUnitType), string heightExamCode = "", string weightExamCode = "", string bmiExamCode = "", int ehrNotPerformedNum = 0,
                                                int pregDiseaseNum        = 0, int bmiPercentile = 0, int pulse = 0)
        {
            Vitalsign vitals = new Vitalsign();

            vitals.PatNum      = patNum;
            vitals.Height      = height;
            vitals.Weight      = weight;
            vitals.BpSystolic  = bpSystolic;
            vitals.BpDiastolic = bpDiastolic;
            if (date == default(DateTime))
            {
                vitals.DateTaken = DateTime.Today;
            }
            vitals.DateTaken         = date;
            vitals.HasFollowupPlan   = hasFollowUpPlan;
            vitals.IsIneligible      = isIneligible;
            vitals.Documentation     = documentation;
            vitals.ChildGotNutrition = childGotNutrition;
            vitals.ChildGotPhysCouns = childGotPhysCouns;
            if (weightCode == default(WeightUnitType))
            {
                weightCode = WeightUnitType.lb;
            }
            vitals.WeightCode         = weightCode.ToString();
            vitals.HeightExamCode     = heightExamCode;
            vitals.WeightExamCode     = weightExamCode;
            vitals.BMIExamCode        = bmiExamCode;
            vitals.EhrNotPerformedNum = ehrNotPerformedNum;
            vitals.PregDiseaseNum     = pregDiseaseNum;
            vitals.BMIPercentile      = bmiPercentile;
            vitals.Pulse = pulse;
            return(vitals);
        }