Exemplo n.º 1
0
 public InvoiceElementIntent2() {
     this.code = new CVImpl();
     this.unitQuantity = new PQImpl();
     this.unitPriceAmt = new RTOImpl<Money, PhysicalQuantity>();
     this.netAmt = new MOImpl();
     this.factorNumber = new INTImpl();
 }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        rb             = GetComponent <Rigidbody>();
        rbOriginalMass = rb.mass;
        col            = GetComponent <CapsuleCollider>();
        //GetComponent<LineRenderer>().enabled = false; // Hide "Scarf"
        currentSpeed = Speed;
        isAiming     = false;

        // Search for all existing moveable and grapple objects and put them in a dictionary
        GameObject[] foundMoveableObjects = GameObject.FindGameObjectsWithTag("Moveable");
        GameObject[] foundGrappleObjects  = GameObject.FindGameObjectsWithTag("Grapple");
        tkObjects = new Dictionary <GameObject, Material>();

        foreach (GameObject MO in foundMoveableObjects)
        {
            tkObjects.Add(MO, MO.GetComponent <MeshRenderer>().material);
        }
        foreach (GameObject GO in foundGrappleObjects)
        {
            tkObjects.Add(GO, GO.GetComponent <MeshRenderer>().material);
        }

        Crosshairs.enabled = false;
        Cursor.visible     = false;
        Cursor.lockState   = CursorLockMode.Confined;
        distanceGround     = GetComponent <CapsuleCollider>().bounds.extents.y;
        haveLetGoOfMouse   = true;
        GrappleSpeed       = 0.05f;
        stowedObject       = false;
        spawnPosition      = transform.position;
    }
Exemplo n.º 3
0
        private void AddDataRow(InvReceive rec)
        {
            InventoryFacade _facade = new InventoryFacade(this.DataProvider);

            MO mo = _facade.GetMOPlanQtyActQty(rec.MoCode);

            decimal MOPlanQty = 0;
            decimal MOActQty  = 0;

            if (mo != null)
            {
                MOPlanQty = mo.MOPlanQty;
                MOActQty  = mo.MOActualQty;
            }

            this._tmpTable.Rows.Add(new object[] { false,
                                                   rec.MoCode,
                                                   rec.RecNo,
                                                   rec.RecSeq,
                                                   rec.ModelCode,
                                                   rec.ItemCode,
                                                   rec.ItemDesc,
                                                   rec.PlanQty,
                                                   rec.ActQty,
                                                   MOPlanQty,
                                                   MOActQty });
            this._tmpTable.AcceptChanges();
            ActivateRow(rec.RecSeq.ToString());
        }
Exemplo n.º 4
0
 private void ShowTemp()
 {
     TempListBox.Items.Clear();
     try
     {
         double CPUtprt = 0;
         MOS = new ManagementObjectSearcher("root\\WMI", "SELECT * FROM MSAcpi_ThermalZoneTemperature");
         foreach (ManagementObject MO in MOS.Get())
         {
             double t, kel, cel, far;
             double.TryParse(MO["CurrentTemperature"].ToString(), out t);
             kel     = t / 10;
             cel     = kel - 273.15;
             far     = cel * 9 / 5 + 32;
             CPUtprt =
                 Convert.ToDouble(Convert.ToDouble(MO.GetPropertyValue("CurrentTemperature".ToString())) - 2732) / 6.96;
             //TempListBox.Items.Add(" CPU: " + CPUtprt.ToString() + " *C");
             TempListBox.Items.Add(" CPU: " + cel.ToString() + " *C");
         }
     }
     catch (ManagementException ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            z++;
        }
        if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            z--;
        }
        z = Mathf.Clamp(z, 0, Grid.worldsize.z);

        switch (TI)
        {
        case MO.Z:

            if (Input.GetKeyDown(KeyCode.B))
            {
                TI = MO.Z;
            }

            break;

        case MO.NO_Z:

            if (Input.GetKeyDown(KeyCode.B))
            {
                TI = MO.NO_Z;
            }

            break;
        }
        UpdateMouseInput();
    }
Exemplo n.º 6
0
 public InvoiceIdentifier()
 {
     this.id  = new SETImpl <II, Identifier>(typeof(IIImpl));
     this.amt = new MOImpl();
     this.pertinentInformationProviderBillingTaxAccount = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Claims.Ficr_mt600201ca.TaxAccountOfProvider>();
     this.reasonOfInvoiceElementChoice = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Claims.Ficr_mt600201ca.IInvoiceElementChoice>();
 }
Exemplo n.º 7
0
 public PaymentRequest()
 {
     this.id  = new SETImpl <II, Identifier>(typeof(IIImpl));
     this.amt = new MOImpl();
     this.pertinentInformationProviderBillingTaxAccount = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Claims.Merged.ProviderBillingTaxAccount>();
     this.reasonOfInvoiceElementChoice = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Claims.Ficr_mt600201ca.IInvoiceElementChoice>();
 }
Exemplo n.º 8
0
        private void Map_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            PointLatLng point = Map.FromLocalToLatLng((int)e.GetPosition(Map).X, (int)e.GetPosition(Map).Y);

            if (Mouset1.IsChecked == true)
            {
                var pointMarker = new GMapMarker(point)
                {
                    Shape = new Image
                    {
                        Width  = 8,
                        Height = 8,
                        Source = new BitmapImage(new Uri("pack://application:,,,/Resources/Mark.png"))
                    }
                };
                Map.Markers.Add(pointMarker);
                PointCol.Add(point, pointMarker);
            }
            else if (Mouset2.IsChecked == true)
            {
                //поиск ближайших
                lb_search.Items.Clear();
                MOCollection.Sort((x, y) => x.GetDistance(point).CompareTo(y.GetDistance(point)));

                foreach (MapObject MO in MOCollection)
                {
                    lb_search.Items.Add((int)MO.GetDistance(point) + "Метров до " + MO.Title + " ");
                }
            }
        }
Exemplo n.º 9
0
        protected void cmdSave_ServerClick(object sender, System.EventArgs e)
        {
            if (this.ValidateInput())
            {
                if (_facade == null)
                {
                    _facade = new MOFacade(base.DataProvider);
                }
                MO mo = (MO)GetEditObject();


                if (this._facade.IsMOStatusChanged(mo))
                {
                    this._facade.MOStatusChanged(mo);
                }
                else
                {
                    this._facade.UpdateMOInformation(mo, FormatHelper.CleanString(this.drpRouteEdit.SelectedValue));
                }



                Response.Redirect(this.MakeRedirectUrl("FMOMP.aspx"));
            }
        }
Exemplo n.º 10
0
 public PaymentIntent()
 {
     this.effectiveTime = new TSImpl();
     this.amt           = new MOImpl();
     this.pertinentInformationAdjudicatorBillingTaxAccount = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Claims.Merged.AdjudicatorBillingTaxAccount>();
     this.reasonOf = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Claims.Ficr_mt610201ca.PaymentIntentReason>();
 }
Exemplo n.º 11
0
 //检查工单Domain的非空字段信息
 private void CheckMODomain(MO mo)
 {
     if (string.IsNullOrEmpty(mo.MOCode))
     {
         mo.EAttribute6 += ";" + this.languageComponent1.GetString("$Error_MOCODE_Is_Null");
     }
     if (string.IsNullOrEmpty(mo.ItemCode))
     {
         mo.EAttribute6 += ";" + this.languageComponent1.GetString("$Error_ItemCode_NotExist");
     }
     if (string.IsNullOrEmpty(mo.MOType))
     {
         mo.EAttribute6 += ";" + this.languageComponent1.GetString("$Error_MoType_NotExist");
     }
     if (string.IsNullOrEmpty(mo.MOPlanQty.ToString()))
     {
         mo.EAttribute6 += ";" + this.languageComponent1.GetString("$Error_MoPlanQty_NotExist");
     }
     if (string.IsNullOrEmpty(mo.MOPlanEndDate.ToString()))
     {
         mo.EAttribute6 += ";" + this.languageComponent1.GetString("$Error_MoPlanEndDate_NotExist");
     }
     if (string.IsNullOrEmpty(mo.MOPlanStartDate.ToString()))
     {
         mo.EAttribute6 += ";" + this.languageComponent1.GetString("$Error_MoPlanStartDate_NotExist");
     }
     if (string.IsNullOrEmpty(mo.BOMVersion.ToString()))
     {
         mo.EAttribute6 += ";" + this.languageComponent1.GetString("$Error_BOM_NotExist");
     }
 }
Exemplo n.º 12
0
        /// <summary>
        /// Parse an object from stream <paramref name="s"/>
        /// </summary>
        /// <param name="s">The stream to read from</param>
        /// <returns>The parsed object</returns>
        public object Parse(System.Xml.XmlReader s, DatatypeFormatterParseResult result)
        {
            PDVFormatter pdvFormatter = new PDVFormatter();
            MO           retVal       = pdvFormatter.Parse <MO>(s, result);

            if (s.GetAttribute("currency") != null)
            {
                retVal.Currency = s.GetAttribute("currency");
            }

            // Precision is not supported in R1, but is still useful to have so
            // we will report the precision of the data that was on the wire
            string valStr = s.GetAttribute("value");

            if (valStr != null && valStr.Contains("."))
            {
                retVal.Precision = valStr.Length - valStr.IndexOf(".") - 1;
            }
            else
            {
                retVal.Precision = 0;
            }


            // Validate
            ANYFormatter fmtr     = new ANYFormatter();
            string       pathName = s is XmlStateReader ? (s as XmlStateReader).CurrentPath : s.Name;

            fmtr.Validate(retVal, pathName, result);

            return(retVal);
        }
Exemplo n.º 13
0
    public static bool TryParseMode(this string mode, out MO value)
    {
        var found = _lookup.ContainsKey(mode);

        value = found ? _lookup[mode] : default(MO);
        return(found);
    }
Exemplo n.º 14
0
 public InvoiceElementGroup()
 {
     this.id     = new IIImpl();
     this.code   = new CVImpl();
     this.netAmt = new MOImpl();
     this.referenceAdjudicatedInvoiceElementGroup = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Claims.Merged.AdjudicationResultIdentifier>();
 }
Exemplo n.º 15
0
 public AdjudicationResultIdentifier()
 {
     this.id         = new IIImpl();
     this.code       = new CVImpl();
     this.statusCode = new CSImpl();
     this.netAmt     = new MOImpl();
 }
Exemplo n.º 16
0
        /// <summary>
        /// Get an ArrayList of all Subfolders
        /// </summary>
        /// <param name="Path"></param>
        /// <returns></returns>
        public ArrayList SubFolders(string Path)
        {
            lock (oWMIProvider)
            {
                ArrayList result = new ArrayList();
                try
                {
                    WMIProvider oProv = new WMIProvider(oWMIProvider.mScope.Clone());
                    oProv.mScope.Path.NamespacePath = @"root\cimv2";
                    ManagementObjectCollection MOC = oProv.ExecuteQuery(@"Associators of {Win32_Directory.Name='" + Path + @"'} where AssocClass=Win32_Subdirectory ResultRole=PartComponent");

                    foreach (ManagementObject MO in MOC)
                    {
                        try
                        {
                            result.Add(MO.GetPropertyValue("Name").ToString().ToLower());
                        }
                        catch { }
                    }
                    return(result);
                }
                catch { }

                return(result);
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// Delete a Folder with all Subfolders and Files
        /// </summary>
        /// <param name="Path"></param>
        public void DeleteFolder(string Path)
        {
            if (!string.IsNullOrEmpty(Path))
            {
                try
                {
                    ManagementObjectCollection MOC;

                    //Delete all Subfolders
                    foreach (string sSub in SubFolders(Path))
                    {
                        DeleteFolder(sSub);
                    }
                    WMIProvider oProv = new WMIProvider(oWMIProvider.mScope.Clone());
                    oProv.mScope.Path.NamespacePath = @"root\cimv2";
                    string FolderPath = Path.Replace(@"\", @"\\");
                    //ManagementObjectCollection MOC = oWMIProvider.ExecuteQuery("SELECT * FROM Win32_Directory WHERE Drive like '" + (FolderPath.Split('\\'))[0] + "' and Path like '" + (CachePath.Split(':'))[1] + @"\\' and FileType = 'File Folder'");
                    MOC = oProv.ExecuteQuery("SELECT * FROM Win32_Directory WHERE Name = '" + FolderPath + "'");

                    //Delete the root Folder
                    foreach (ManagementObject MO in MOC)
                    {
                        try
                        {
                            ManagementBaseObject inParams = MO.GetMethodParameters("DeleteEx");
                            ManagementBaseObject result   = MO.InvokeMethod("DeleteEx", inParams, null);
                        }
                        catch { }
                    }
                }
                catch { }
            }
        }
Exemplo n.º 18
0
 public TypeOfSummary()
 {
     this.code          = new CDImpl();
     this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >();
     this.netAmt        = new MOImpl();
     this.referenceAdjudicatedInvoiceElementGroup = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_05_00.Claims.Merged.AdjudicationResultIdentifier>();
 }
Exemplo n.º 19
0
        /// <summary>
        /// Send a stop command to a Service and wait until the Service is stopped
        /// </summary>
        /// <param name="ServiceName"></param>
        /// <returns>Returns an ArrayList of Services which has stopped because of service dependencies </returns>
        public ArrayList StopService(string ServiceName)
        {
            try
            {
                ManagementObjectCollection Dependencies;
                ManagementObject           Service;
                WMIProvider oProv = new WMIProvider(oWMIProvider.mScope.Clone());
                oProv.mScope.Path.NamespacePath       = @"root\cimv2";
                oProv.mScope.Options.EnablePrivileges = true;
                Service      = oProv.GetObject("Win32_Service.Name='" + ServiceName + "'");
                Dependencies = oProv.ExecuteQuery("Associators of {Win32_Service.Name='" + ServiceName + "'} Where AssocClass=Win32_DependentService Role=Antecedent");

                ArrayList Result = new ArrayList();
                foreach (ManagementObject MO in Dependencies)
                {
                    if (MO.GetPropertyValue("State").ToString().ToLower() == "running")
                    {
                        Result.AddRange(StopService(MO.GetPropertyValue("Name").ToString()));
                    }
                }
                Result.Add(ServiceName);
                bStopService(Service);
                return(Result);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Exemplo n.º 20
0
        protected override void Grid_ClickCell(GridRecord row, string commandName)
        {
            if (_facade == null)
            {
                _facade = new MOFacade(base.DataProvider);
            }
            #region 保留编辑工单信息
            MO mo = (MO)(this._facade.GetMO(row.Items.FindItemByKey("Mo_MOCode").Text.Trim()));
            //this.drpMoStatusQuery.SelectedValue = mo.MOStatus ;
            this.drpMoStatusQuery.SelectedValue = string.Empty;
            this.txtMoCodeQuery.Text            = mo.MOCode;
            SetSearchSession();
            #endregion

            if (commandName == "Edit")
            {
                Response.Redirect(this.MakeRedirectUrl("FMOEP.aspx", new string[] { "ACT", "MOCode" }, new string[] { "EDIT", mo.MOCode }));
            }
            else if (commandName == "MO2RouteEdit")
            {
                Response.Redirect(this.MakeRedirectUrl("FMO2RouteSP.aspx", new string[] { "MOCode" }, new string[] { mo.MOCode }));
            }
            else if (commandName == "MOConfirm")
            {
                Response.Redirect(this.MakeRedirectUrl("FMOConfirmMP.aspx", new string[] { "MOCode", "OrgID" }, new string[] { mo.MOCode, mo.OrganizationID.ToString() }));
            }
            else if (commandName == "MOTail")
            {
                Response.Redirect(this.MakeRedirectUrl("FMOTailMP.aspx", new string[] { "MOCode" }, new string[] { mo.MOCode }));
            }
            else if (commandName == "MOStorgeConfirm")
            {
                Response.Redirect(this.MakeRedirectUrl("FMOStorgeConfirmMP.aspx", new string[] { "MOCode", "OrgID" }, new string[] { mo.MOCode, mo.OrganizationID.ToString() }));
            }
        }
Exemplo n.º 21
0
        public void ChangeIPto(string ipAddress, string subnetMask)
        {
            IPAddress                  GTW = getDefaultGateway();
            ManagementClass            MC  = new ManagementClass("Win32_NetworkAdapterConfiguration");
            ManagementObjectCollection MOC = MC.GetInstances();

            foreach (ManagementObject MO in MOC)
            {
                if ((bool)MO["IPEnabled"])
                {
                    try
                    {
                        ManagementBaseObject setIP;
                        ManagementBaseObject newIP = MO.GetMethodParameters("EnableStatic");
                        newIP["IPAddress"]  = new string[] { ipAddress };
                        newIP["SubnetMask"] = new string[] { subnetMask };
                        setIP = MO.InvokeMethod("EnableStatic", newIP, null);
                        setGateway(GTW.ToString());
                    }
                    catch (Exception a)
                    {
                        System.Windows.MessageBox.Show(a.ToString());
                    }
                }
            }
        }
Exemplo n.º 22
0
        public MO CreateNewMO()
        {
            MO mo = new MO();

            mo.MOStatus = MOManufactureStatus.MOSTATUS_INITIAL;
            return(mo);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Delete multiple Files
        /// </summary>
        /// <param name="Drive">Disk Drive like 'c:'</param>
        /// <param name="Path">Path like '\\windows\\'</param>
        /// <param name="Filename">Filename like 'kb%'</param>
        /// <param name="Extension">Extension like 'log'</param>
        public void DeleteFiles(string Drive, string Path, string Filename, string Extension)
        {
            try
            {
                ManagementObjectCollection MOC;

                if (!Path.EndsWith(@"\"))
                {
                    Path = Path + @"\";
                }

                WMIProvider oProv = new WMIProvider(oWMIProvider.mScope.Clone());
                oProv.mScope.Path.NamespacePath = @"root\cimv2";
                string FolderPath = Path.Replace(@"\", @"\\");
                //ManagementObjectCollection MOC = oWMIProvider.ExecuteQuery("SELECT * FROM Win32_Directory WHERE Drive like '" + (FolderPath.Split('\\'))[0] + "' and Path like '" + (CachePath.Split(':'))[1] + @"\\' and FileType = 'File Folder'");
                MOC = oProv.ExecuteQuery(string.Format("SELECT * FROM CIM_DataFile WHERE Drive = '{0}' and Path = '{1}' and Filename like '{2}' and Extension like '{3}'", new object[] { Drive, FolderPath, Filename, Extension }));

                //Delete the root Folder
                foreach (ManagementObject MO in MOC)
                {
                    try
                    {
                        ManagementBaseObject inParams = MO.GetMethodParameters("Delete");
                        ManagementBaseObject result   = MO.InvokeMethod("Delete", inParams, null);
                    }
                    catch { }
                }
            }
            catch { }
        }
Exemplo n.º 24
0
        public virtual void TestParseNullNode()
        {
            XmlNode node = CreateNode("<something nullFlavor=\"NI\" />");
            MO      mo   = (MO) new MoElementParser().Parse(CreateContext(), node, null);

            Assert.IsNull(mo.Value, "null result");
            Assert.AreEqual(Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor.NO_INFORMATION, mo.NullFlavor, "null flavor");
        }
Exemplo n.º 25
0
 public AdjudicatedResultsGroup()
 {
     this.id            = new IIImpl();
     this.code          = new CVImpl();
     this.effectiveTime = new IVLImpl <TS, Interval <PlatformDate> >();
     this.netAmt        = new MOImpl();
     this.summaryAdjudResultsGroupSummaryData = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2007_v02_r02.Claims.Merged.SummaryDetails>();
 }
Exemplo n.º 26
0
 public AdjudicatedInvoiceElementGroup()
 {
     this.code       = new CVImpl();
     this.statusCode = new CSImpl();
     this.netAmt     = new MOImpl();
     this.coverage   = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Common.Coct_mt680000ca.AdjudicatedInvoiceCoverage>();
     this.componentAdjudicatedInvoiceElementChoice = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_02.Common.Coct_mt680000ca.IAdjudicatedInvoiceElementChoice>();
 }
Exemplo n.º 27
0
 public AdjudicatedInvoiceElementGroup()
 {
     this.id         = new IIImpl();
     this.code       = new CVImpl();
     this.statusCode = new CSImpl();
     this.netAmt     = new MOImpl();
     this.component  = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Claims.Ficr_mt510201ca.Component>();
 }
Exemplo n.º 28
0
        public void R2MOBasicSerializationTest()
        {
            MO     inti        = new MO((decimal)1.304, "CAD");
            string expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" currency=""CAD"" value=""1.304""/>";
            string actualXml   = R2SerializationHelper.SerializeAsString(inti);

            R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
        }
Exemplo n.º 29
0
 public AdjudicatedInvoiceElementDetail()
 {
     this.id           = new SETImpl <II, Identifier>(typeof(IIImpl));
     this.code         = new CVImpl();
     this.unitQuantity = new PQImpl();
     this.unitPriceAmt = new RTOImpl <Money, PhysicalQuantity>();
     this.netAmt       = new MOImpl();
     this.factorNumber = new REALImpl();
 }
Exemplo n.º 30
0
 public FinancialTransactionIntent()
 {
     this.id            = new IIImpl();
     this.statusCode    = new CSImpl();
     this.effectiveTime = new TSImpl();
     this.amt           = new MOImpl();
     this.pertinentInformationAdjudicatorBillingTaxAccount = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Claims.Merged.AdjudicatorBillingTaxAccount>();
     this.reasonOf = new List <Ca.Infoway.Messagebuilder.Model.Pcs_mr2009_r02_04_03.Claims.Ficr_mt510201ca.Reason2>();
 }
Exemplo n.º 31
0
        public void EV_1088_MOToStringLocalizationTest()
        {
            // Setup
            var defaultCulture = EverestFrameworkContext.CurrentCulture;
            EverestFrameworkContext.CurrentCulture = new System.Globalization.CultureInfo("fr-FR", false);

            // Graph 
            MO test = new MO((decimal)1.20, "CAD");
            test.Precision = 2;
            Assert.AreEqual("1,20 CAD", test.ToString());
            // Teardown
            EverestFrameworkContext.CurrentCulture = defaultCulture;
        }
Exemplo n.º 32
0
 public void R2MOExpressionSerializationTest()
 {
     MO inti = new MO(0, "CAD")
     {
         NullFlavor = NullFlavor.Derived,
         Expression = new ED(
             System.Text.Encoding.UTF8.GetBytes("i = (10 + 2) / 2 + 2)"),
             "application/mathml+xml"
         )
     };
     string expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" currency=""CAD"" nullFlavor=""DER""><expression mediaType=""application/mathml+xml""><data>aSA9ICgxMCArIDIpIC8gMiArIDIp</data></expression></test>";
     string actualXml = R2SerializationHelper.SerializeAsString(inti);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Exemplo n.º 33
0
        static public List<MO> GetAvailableMO(SqlConnection connect,
                                                                  Log log, 
                                                                  ProductInfo prodInfo, 
                                                                   int startDateoffset,
                                                                   int udtOffset )
        {
            List<MO> ret = new List<MO>();

            DateTime now = DateTime.Now;
            DateTime startDate = now.AddDays(startDateoffset);
            DateTime udtDate = now.AddDays(udtOffset);

            SqlCommand dbCmd = connect.CreateCommand();
            dbCmd.CommandType = CommandType.Text;
            dbCmd.CommandText = @"select MO, (Qty-Print_Qty) as qty  from MO 
                                                          where Model=@model and 
                                                                     StartDate>=@StartDate and
                                                                     Qty>Print_Qty and
                                                                      Status ='H'  and  
                                                                     Udt>=@UpdateTime
                                                         order by StartDate, Udt";
            SQLHelper.createInputSqlParameter(dbCmd, "@model", 15, prodInfo.Model);
            SQLHelper.createInputSqlParameter(dbCmd, "@StartDate", 1, startDate);
            SQLHelper.createInputSqlParameter(dbCmd, "@UpdateTime", udtDate);


            log.write(LogType.Info, 0, "SQL", "GetAvailableMO", dbCmd.CommandText);
            log.write(LogType.Info, 0, "SQL", "@model", prodInfo.Model);
            log.write(LogType.Info, 0, "SQL", "@StartDate", startDate.ToString());
            log.write(LogType.Info, 0, "SQL", "@UpdateTime", udtDate.ToString());

            SqlDataReader sdr = dbCmd.ExecuteReader();
            while (sdr.Read())
            {
                MO mo = new MO();
                mo.MOId = sdr.GetString(0).Trim();
                mo.Qty = sdr.GetInt32(1);

                ret.Add(mo);
            }
            sdr.Close();
            return ret;
        }
Exemplo n.º 34
0
 public void R2MOPrecisionParseTest()
 {
     MO inti = new MO((decimal)1.300, "CAD") { Precision = 3 };
     string actualXml = R2SerializationHelper.SerializeAsString(inti);
     MO int2 = R2SerializationHelper.ParseString<MO>(actualXml);
     Assert.AreEqual(inti, int2);
 }
Exemplo n.º 35
0
 public void R2MONullFlavorSerializationTest()
 {
     MO inti = new MO(48, "CAD")
     {
         NullFlavor = NullFlavor.Invalid
     };
     string expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" nullFlavor=""INV""/>";
     string actualXml = R2SerializationHelper.SerializeAsString(inti);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Exemplo n.º 36
0
 public void MOValueCurrencyNullNullFlavorTest()
 {
     MO mo = new MO();
     mo.NullFlavor = null;
     mo.Value = (decimal)2.34;
     mo.Currency = "cdn";
     Assert.IsTrue(mo.Validate());
 }
Exemplo n.º 37
0
        public void R2MOExpressionParseTest()
        {
            MO inti = new MO()
            {
                Currency = "CAD",
                NullFlavor = NullFlavor.Derived,
                Expression = new ED(
                    System.Text.Encoding.UTF8.GetBytes("i = (10 + 2) / 2 + 2)"),
                    "application/mathml+xml"
                )
            };
            string actualXml = R2SerializationHelper.SerializeAsString(inti);
            MO int2 = R2SerializationHelper.ParseString<MO>(actualXml);
            Assert.AreEqual(inti, int2);

        }
Exemplo n.º 38
0
 public void MOValueCurrencyNullFlavorTest()
 {
     MO mo = new MO();
     mo.Value = (decimal)2.34;
     mo.Currency = "cdn";
     mo.NullFlavor = NullFlavor.Other;
     Assert.IsFalse(mo.Validate());
 }
Exemplo n.º 39
0
 public void MONullNullFlavorCurrencyValueTest()
 {
     MO mo = new MO();
     mo.Value = null;
     mo.Currency = null;
     mo.NullFlavor = null;
     Assert.IsFalse(mo.Validate());
 }
Exemplo n.º 40
0
 public void MONullFlavorNullCurrencyValueTest()
 {
     MO mo = new MO();
     mo.Currency = null;
     mo.Value = null;
     mo.NullFlavor = NullFlavor.Other;
     Assert.IsTrue(mo.Validate());
 }
Exemplo n.º 41
0
 public void MOValueNullNullFlavorCurrencyTest()
 {
     MO mo = new MO();
     mo.NullFlavor = null;
     mo.Currency = null;
     mo.Value = (decimal)2.45;
     Assert.IsFalse(mo.Validate());
 }
Exemplo n.º 42
0
 public void MOCurrencyNullValueNullFlavorTest()
 {
     MO mo = new MO();
     mo.NullFlavor = null;
     mo.Value = null;
     mo.Currency = "cdn";
     Assert.IsFalse(mo.Validate());
 }
Exemplo n.º 43
0
 public void R2MOBasicSerializationTest()
 {
     MO inti = new MO((decimal)1.304, "CAD"); 
     string expectedXml = @"<test xmlns=""urn:hl7-org:v3"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" currency=""CAD"" value=""1.304""/>";
     string actualXml = R2SerializationHelper.SerializeAsString(inti);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Exemplo n.º 44
0
        internal static MO CreateMO(UseContext context)
        {
            Tracer.Trace("Creating MO", context);

            MO result = new MO();

            result.Value = 1000000001;
            result.Currency = "CAD";

            return result;
        }