コード例 #1
0
ファイル: OrganismGenerator.cs プロジェクト: nkabbs/warg
        private Color GetOrganismColor(OrganismType o)
		{
            var r = 0;
            var g = 0;
            var b = 0;
            if (o == OrganismType.GRASS)
            {
                r = Rando.Next(50) + 10;
                g = Rando.Next(100) + 150;
                b = Rando.Next(50) + 10;
            }

            if (o == OrganismType.DEER)
            {
                r = Rando.Next(150) + 50;
                g = Rando.Next(75) + 20;
                b = Rando.Next(30) + 5;
            }

            if (o == OrganismType.WOLF)
            {
                r = Rando.Next(10) + 240;
                g = Rando.Next(10) + 240;
                b = Rando.Next(10) + 240;
            }

			return new Color(r,g,b);
		}
コード例 #2
0
        public void DeleteOrganismType(OrganismType organismTypeToBeDeleted)
        {
            //Validate Input
            if (organismTypeToBeDeleted == null)
            {
                throw (new ArgumentNullException("organismTypeToBeDeleted"));
            }

            // Validate Primary key value
            if (organismTypeToBeDeleted.OrganismTypeID.IsInvalidKey())
            {
                BusinessLayerHelper.ThrowErrorForInvalidDataKey("OrganismTypeID");
            }

            OnOrganismTypeSaving(organismTypeToBeDeleted);
            OnOrganismTypeDeleting(organismTypeToBeDeleted);

            if (organismTypeToBeDeleted.EntityState == EntityState.Detached)
            {
                _DatabaseContext.OrganismTypes.Attach(organismTypeToBeDeleted);
            }
            _DatabaseContext.OrganismTypes.DeleteObject(organismTypeToBeDeleted);
            int numberOfAffectedRows = _DatabaseContext.SaveChanges();

            if (numberOfAffectedRows == 0)
            {
                throw new DataNotUpdatedException("No OrganismType deleted!");
            }

            OnOrganismTypeDeleted(organismTypeToBeDeleted);
            OnOrganismTypeSaved(organismTypeToBeDeleted);
        }
コード例 #3
0
        public void DeleteOrganismTypes(List <int> organismTypeIDsToDelete)
        {
            //Validate Input
            foreach (int organismTypeID in organismTypeIDsToDelete)
            {
                if (organismTypeID.IsInvalidKey())
                {
                    BusinessLayerHelper.ThrowErrorForInvalidDataKey("OrganismTypeID");
                }
            }

            List <OrganismType> organismTypesToBeDeleted = new List <OrganismType>();

            foreach (int organismTypeID in organismTypeIDsToDelete)
            {
                OrganismType organismType = new OrganismType {
                    OrganismTypeID = organismTypeID
                };
                _DatabaseContext.OrganismTypes.Attach(organismType);
                _DatabaseContext.OrganismTypes.DeleteObject(organismType);
                organismTypesToBeDeleted.Add(organismType);
                OnOrganismTypeDeleting(organismType);
            }

            int numberOfAffectedRows = _DatabaseContext.SaveChanges();

            if (numberOfAffectedRows != organismTypeIDsToDelete.Count)
            {
                throw new DataNotUpdatedException("One or more organismType records have not been deleted.");
            }
            foreach (OrganismType organismTypeToBeDeleted in organismTypesToBeDeleted)
            {
                OnOrganismTypeDeleted(organismTypeToBeDeleted);
            }
        }
コード例 #4
0
        public virtual int CreateNewOrganismType(OrganismType newOrganismType)
        {
            // Validate Parameters
            if (newOrganismType == null)
            {
                throw (new ArgumentNullException("newOrganismType"));
            }

            // Apply business rules
            OnOrganismTypeSaving(newOrganismType);
            OnOrganismTypeCreating(newOrganismType);

            _DatabaseContext.OrganismTypes.AddObject(newOrganismType);
            int numberOfAffectedRows = _DatabaseContext.SaveChanges();

            if (numberOfAffectedRows == 0)
            {
                throw new DataNotUpdatedException("No organismType created!");
            }

            // Apply business workflow
            OnOrganismTypeCreated(newOrganismType);
            OnOrganismTypeSaved(newOrganismType);

            return(newOrganismType.OrganismTypeID);
        }
コード例 #5
0
        public void UpdateOrganismType(OrganismType updatedOrganismType)
        {
            // Validate Parameters
            if (updatedOrganismType == null)
            {
                throw (new ArgumentNullException("updatedOrganismType"));
            }

            // Validate Primary key value
            if (updatedOrganismType.OrganismTypeID.IsInvalidKey())
            {
                BusinessLayerHelper.ThrowErrorForInvalidDataKey("OrganismTypeID");
            }

            // Apply business rules
            OnOrganismTypeSaving(updatedOrganismType);
            OnOrganismTypeUpdating(updatedOrganismType);

            //attaching and making ready for parsistance
            if (updatedOrganismType.EntityState == EntityState.Detached)
            {
                _DatabaseContext.OrganismTypes.Attach(updatedOrganismType);
            }
            _DatabaseContext.ObjectStateManager.ChangeObjectState(updatedOrganismType, System.Data.EntityState.Modified);            //this line makes the code un-testable!
            int numberOfAffectedRows = _DatabaseContext.SaveChanges();

            if (numberOfAffectedRows == 0)
            {
                throw new DataNotUpdatedException("No organismType updated!");
            }

            //Apply business workflow
            OnOrganismTypeUpdated(updatedOrganismType);
            OnOrganismTypeSaved(updatedOrganismType);
        }
コード例 #6
0
    protected void FormViewOrganismType_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        TextBox txtOrganismType         = (TextBox)formViewOrganismType.FindControl("txtOrganismType");
        OrganismTypeActionStatus status = Validate(txtOrganismType.Text, actionType.update);

        if (status == OrganismTypeActionStatus.Success)
        {
            Type           myType = (typeof(OrganismType));
            PropertyInfo[] props  = myType.GetProperties();

            string[] arrNewValues = new string[e.NewValues.Keys.Count];
            e.NewValues.Keys.CopyTo(arrNewValues, 0);

            OrganismTypeBLL organismTypeBLL = new OrganismTypeBLL();
            OrganismType    organismType    = organismTypeBLL.GetOrganismTyeByOrganismTypeId2((int)e.Keys["OrganismTypeId"]);

            foreach (var prop in props)
            {
                if (("System.String,System.Int,System.DateTime,System.Guid").IndexOf((prop.PropertyType).FullName) >= 0) // Si la propiedad es de tipo Guid, String, Int o DateTime
                {
                    if (!arrNewValues.Contains(prop.Name))
                    {
                        e.NewValues[prop.Name] = prop.GetValue(organismType, null);
                    }
                }
            }
        }
        else
        {
            ltlMessage.Text = MessageFormatter.GetFormattedErrorMessage(GetErrorMessage(status));
            e.Cancel        = true;
        }
    }
コード例 #7
0
 public Organism(OrganismType type, int[,] m, int error, int age)
 {
     Type   = type;
     Error  = error;
     Age    = age;
     Matrix = SwarmIntSolver.DuplicateMatrix(m);
 }
コード例 #8
0
 /// <remarks/>
 public System.IAsyncResult BeginGetTopAnimals(string version, OrganismType tat, int num, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("GetTopAnimals", new object[] {
                 version,
                 tat,
                 num}, callback, asyncState);
 }
コード例 #9
0
 public Organism(OrganismType type, int[,] m, int error, int age)
 {
     Type   = type;
     Error  = error;
     Age    = age;
     Matrix = MatrixHelper.DuplicateMatrix(m);
 }
コード例 #10
0
    public string GetOrganismTypeName(int organismTypeID)
    {
        OrganismTypeBLL organismTypeBLL = new OrganismTypeBLL();
        OrganismType    organismType    = organismTypeBLL.GetOrganismTypeByOrganismTypeID(organismTypeID);

        return(organismType.OrganismTypeName);
    }
コード例 #11
0
 /*Notes -
  * DefineChromosomeLength - Should be run first to define the length since the next method assumes that the length was already defined (DefineChromosomePositions).
  *
  */
 #region Constructor
 /// <summary>
 /// The default nChr is 3 and the organism type is drosophila
 /// </summary>
 /// <param name="_nChr"></param>
 /// <param name="_type"></param>
 public DataGeneratorPresentor(int _nChr = 3, OrganismType _type = OrganismType.Drosophila)
 {
     go       = new GenomeOrganization();
     nChr     = _nChr;
     type     = _type;
     database = DatabaseProvider.GetDatabase();
     database.GenomeOrganization = go;
 }
コード例 #12
0
 /// <remarks/>
 public System.IAsyncResult BeginGetTopAnimals(string version, OrganismType tat, int num, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("GetTopAnimals", new object[] {
         version,
         tat,
         num
     }, callback, asyncState));
 }
コード例 #13
0
        public DataSet GetTopAnimals(string version, OrganismType tat, int num)
        {
            if ( num == 0 )
            {
                num = 3;
            }

            return ChartBuilder.GetTopAnimals(version, tat, num);
        }
コード例 #14
0
 public System.Data.DataSet GetTopAnimals(string version, OrganismType tat, int num)
 {
     object[] results = this.Invoke("GetTopAnimals", new object[] {
         version,
         tat,
         num
     });
     return((System.Data.DataSet)(results[0]));
 }
コード例 #15
0
        public DataSet GetTopAnimals(string version, OrganismType tat, int num)
        {
            if (num == 0)
            {
                num = 3;
            }

            return(ChartBuilder.GetTopAnimals(version, tat, num));
        }
コード例 #16
0
        public Organism(OrganismType organismType, string firstName, string secondName, string latFirstName, string latSecondName, Colour colour)
        {
            OrganismType  = organismType;
            FirstName     = firstName;
            SecondName    = secondName;
            LatFirstName  = latFirstName;
            LatSecondName = latSecondName;
            Colour        = colour;

            this.Photos = new List <Photo>();
        }
コード例 #17
0
 /// <remarks/>
 public void GetTopAnimalsAsync(string version, OrganismType tat, int num, object userState)
 {
     if ((this.GetTopAnimalsOperationCompleted == null))
     {
         this.GetTopAnimalsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetTopAnimalsOperationCompleted);
     }
     this.InvokeAsync("GetTopAnimals", new object[] {
         version,
         tat,
         num
     }, this.GetTopAnimalsOperationCompleted, userState);
 }
コード例 #18
0
        public OrganismType GetOrganismTyeByOrganismTypeId2(int organismTypeID)
        {
            //Validate Input
            if (organismTypeID.IsInvalidKey())
            {
                BusinessLayerHelper.ThrowErrorForInvalidDataKey("organismTyepID");
            }
            OrganismType organismType = (_DatabaseContext.OrganismTypes.FirstOrDefault(instance => instance.OrganismTypeID == organismTypeID));

            var ass = organismType.OrganismTypeName;

            return(organismType);
        }
コード例 #19
0
        public ActionResult Edit(OrganismType obj)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    dbActionResult resultAction = new dbActionResult();
                    resultAction = db.EditOrganismType(obj);
                    int id = resultAction.intResult;
                    if (id >= 0)
                    {
                        return(RedirectToAction("Index"));
                    }

                    if (id == -1)
                    {
                        db.DetachOrganismType(obj);
                        OrganismType oldObj = db.GetOrganismType(obj.OrganismTypeID);
                        ModelState.AddModelError("", "Ошибка параллельного доступа к данным. Если проблема повторится, обратитесь к системному администратору.");
                        if (oldObj.Code != obj.Code)
                        {
                            ModelState.AddModelError("Code", "Текущее значение: " + oldObj.Code.ToString());
                        }
                        if (oldObj.DescriptionEng != obj.DescriptionEng)
                        {
                            ModelState.AddModelError("DescriptionEng", "Текущее значение: " + oldObj.DescriptionEng.ToString());
                        }
                        if (oldObj.DescriptionRus.ToString() != obj.DescriptionRus.ToString())
                        {
                            ModelState.AddModelError("DescriptionRus", "Текущее значение: " + oldObj.DescriptionRus.ToString());
                        }
                        obj.Timestamp = oldObj.Timestamp;
                    }
                    if (id == -2)
                    {
                        ModelState.AddModelError("", resultAction.exData.Message.ToString() + " | " + resultAction.exData.GetType().ToString() + " | " +
                                                 "Невозможно сохранить изменения. Нажмите обновить страницу и повторить действия. Если проблема повторится, обратитесь к системному администратору.");
                    }
                }
            }

            catch (DataException ex)
            {
                ModelState.AddModelError("", ex.Message.ToString() + " | " + ex.GetType().ToString() + " | " + "Невозможно сохранить изменения. Попробуйте повторить действия. Если проблема повторится, обратитесь к системному администратору.");
            }

            return(View(obj));
        }
コード例 #20
0
 public ActionResult Create(OrganismType obj)
 {
     try
     {
         if (ModelState.IsValid)
         {
             int id = db.AddOrganismType(obj);
             return(RedirectToAction("Index"));
         }
     }
     catch (DataException ex)
     {
         ModelState.AddModelError("", ex.Message.ToString() + " Невозможно сохранить изменения. Попробуйте повторить действия. Если проблема повторится, обратитесь к системному администратору.");
     }
     return(RedirectToAction("Index"));
 }
コード例 #21
0
            public override IDeepCopyable CopyTo(IDeepCopyable other)
            {
                var dest = other as TargetComponent;

                if (dest == null)
                {
                    throw new ArgumentException("Can only copy to an object of the same type", "other");
                }

                base.CopyTo(dest);
                if (Target != null)
                {
                    dest.Target = (Hl7.Fhir.Model.Identifier)Target.DeepCopy();
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (Interaction != null)
                {
                    dest.Interaction = (Hl7.Fhir.Model.CodeableConcept)Interaction.DeepCopy();
                }
                if (Organism != null)
                {
                    dest.Organism = (Hl7.Fhir.Model.CodeableConcept)Organism.DeepCopy();
                }
                if (OrganismType != null)
                {
                    dest.OrganismType = (Hl7.Fhir.Model.CodeableConcept)OrganismType.DeepCopy();
                }
                if (Amount != null)
                {
                    dest.Amount = (Hl7.Fhir.Model.DataType)Amount.DeepCopy();
                }
                if (AmountType != null)
                {
                    dest.AmountType = (Hl7.Fhir.Model.CodeableConcept)AmountType.DeepCopy();
                }
                if (Source != null)
                {
                    dest.Source = new List <Hl7.Fhir.Model.ResourceReference>(Source.DeepCopy());
                }
                return(dest);
            }
コード例 #22
0
    private static void addTopOrganisms(OrganismType organismType, StringBuilder buffer)
    {
        DataSet dataSet = ChartBuilder.GetTopAnimals(ServerSettings.LatestVersion, organismType, 10);

        buffer.Append("<span class=\"SubTitle\">" + organismType + "</span>");
        buffer.Append("<ol type=\"1\" class=\"CritterList\">");

        if (dataSet != null) {
            if (dataSet.Tables.Contains("Species")) {
                DataTable speciesTable = dataSet.Tables["Species"];
                foreach (DataRow row in speciesTable.Rows) {
                    buffer.Append("<li>");
                    buffer.Append(Convert.ToString(row["Name"]) + " (" + Convert.ToString(row["Population"]) + ")");
                    buffer.Append("</li>");
                }
            }
        }

        buffer.Append("</ol>");
        buffer.Append("</span>");
    }
コード例 #23
0
ファイル: OrganismAddForm.cs プロジェクト: b0r3k/DBioPhoto
        private void addToDbButton_Click(object sender, EventArgs e)
        {
            // Get the values from the form, lowecase everything, create the instance of Organism
            OrganismType organismType  = (OrganismType)organismTypeComboBox.SelectedItem;
            string       firstName     = firstNameTextBox.Text.Trim().ToLower();
            string       secondName    = secondNameTextBox.Text.Trim().ToLower();
            string       latFirstName  = latFirstNameTextBox.Text.Trim().ToLower();
            string       latSecondName = latSecondNameTextBox.Text.Trim().ToLower();
            Colour       colour        = (Colour)colourComboBox.SelectedItem;

            _tryOrganism = new Organism(organismType, firstName, secondName, latFirstName, latSecondName, colour);

            // Add to ThreadPool task to TryAddPerson
            Task.Run(() => TryAddOrganismLocking(_tryOrganism));

            // Reset the form
            firstNameTextBox.Text     = "";
            secondNameTextBox.Text    = "";
            latFirstNameTextBox.Text  = "";
            latSecondNameTextBox.Text = "";
        }
コード例 #24
0
    protected void FormViewOrganism_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        TextBox              txtCommonName     = (TextBox)formViewOrganism.FindControl("txtCommonName");
        TextBox              txtScientificName = (TextBox)formViewOrganism.FindControl("txtScientificName");
        DropDownList         ddlOrganismType   = (DropDownList)formViewOrganism.FindControl("ddlOrganismType");
        OrganismActionStatus status            = Validate(txtCommonName.Text, txtScientificName.Text, Convert.ToInt32(ddlOrganismType.SelectedValue), actionType.update);

        if (status == OrganismActionStatus.Success)
        {
            Type           myType = (typeof(Organism));
            PropertyInfo[] props  = myType.GetProperties();

            string[] arrNewValues = new string[e.NewValues.Keys.Count];
            e.NewValues.Keys.CopyTo(arrNewValues, 0);

            OrganismBLL     organismBLL     = new OrganismBLL();
            OrganismTypeBLL organismTypeBLL = new OrganismTypeBLL();
            OrganismType    organismType    = organismTypeBLL.GetOrganismTypeByOrganismTypeID(Convert.ToInt32(ddlOrganismType.SelectedValue));
            Organism        organism        = organismBLL.GetOrganismByOrganismId2((int)e.Keys["OrganismId"]);

            foreach (var prop in props)
            {
                if (("System.String,System.Int32,System.Int,System.DateTime,System.Guid").IndexOf((prop.PropertyType).FullName) >= 0) // Si la propiedad es de tipo Guid, String, Int o DateTime
                {
                    if (!arrNewValues.Contains(prop.Name))
                    {
                        e.NewValues[prop.Name] = prop.GetValue(organism, null);
                    }
                }
            }

            e.NewValues["OrganismTypeID"]            = organismType.OrganismTypeID;
            Page.RouteData.Values["organismtype_id"] = organismType.OrganismTypeID.ToString();
        }
        else
        {
            ltlMessage.Text = MessageFormatter.GetFormattedErrorMessage(GetErrorMessage(status));
            e.Cancel        = true;
        }
    }
コード例 #25
0
        /*
         *  Member:     GetTopAnimals
         *  Purpose:    This class get the n top animal of a specific organism
         *  classification from the database and returns their information as
         *  a DataSet
         */
        public static DataSet GetTopAnimals(string version, OrganismType organismType, int count)
        {
            version = new Version(version).ToString(3);

            using (SqlConnection myConnection = new SqlConnection(ServerSettings.SpeciesDsn)) {
                myConnection.Open();

                using (SqlCommand command = new SqlCommand("TerrariumTopAnimals", myConnection)) {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@Count", count);
                    command.Parameters.AddWithValue("@Version", version);
                    command.Parameters.AddWithValue("@SpeciesType", organismType.ToString());

                    using (SqlDataAdapter adapter = new SqlDataAdapter(command)) {
                        DataSet tempData = new DataSet();
                        adapter.Fill(tempData, "Species");

                        return(tempData);
                    }
                }
            }
        }
コード例 #26
0
        /*
            Member:     GetTopAnimals
            Purpose:    This class get the n top animal of a specific organism
            classification from the database and returns their information as
            a DataSet
        */
        public static DataSet GetTopAnimals(string version, OrganismType organismType, int count) {

            version = new Version(version).ToString(3);

            using(SqlConnection myConnection = new SqlConnection(ServerSettings.SpeciesDsn)) {
                myConnection.Open();

                SqlCommand command = new SqlCommand( "TerrariumTopAnimals", myConnection );
				command.CommandType = CommandType.StoredProcedure;
				
				command.Parameters.Add( "@Count", count );
				command.Parameters.Add( "@Version", version );
				command.Parameters.Add( "@SpeciesType", organismType.ToString() );

                SqlDataAdapter adapter = new SqlDataAdapter(command);

                DataSet tempData = new DataSet();
                adapter.Fill(tempData, "Species");
				
                myConnection.Close();
                return tempData;
            }
        }
コード例 #27
0
    private static void addTopOrganisms(OrganismType organismType, StringBuilder buffer)
    {
        DataSet dataSet = ChartBuilder.GetTopAnimals(ServerSettings.LatestVersion, organismType, 10);

        buffer.Append("<span class=\"SubTitle\">" + organismType + "</span>");
        buffer.Append("<ol type=\"1\" class=\"CritterList\">");

        if (dataSet != null)
        {
            if (dataSet.Tables.Contains("Species"))
            {
                DataTable speciesTable = dataSet.Tables["Species"];
                foreach (DataRow row in speciesTable.Rows)
                {
                    buffer.Append("<li>");
                    buffer.Append(Convert.ToString(row["Name"]) + " (" + Convert.ToString(row["Population"]) + ")");
                    buffer.Append("</li>");
                }
            }
        }

        buffer.Append("</ol>");
        buffer.Append("</span>");
    }
コード例 #28
0
 public System.Data.DataSet GetTopAnimals(string version, OrganismType tat, int num)
 {
     object[] results = this.Invoke("GetTopAnimals", new object[] {
                 version,
                 tat,
                 num});
     return ((System.Data.DataSet)(results[0]));
 }
コード例 #29
0
 partial void OnOrganismTypeDeleting(OrganismType organismType);
コード例 #30
0
 /// <remarks/>
 public void GetTopAnimalsAsync(string version, OrganismType tat, int num)
 {
     this.GetTopAnimalsAsync(version, tat, num, null);
 }
コード例 #31
0
 public IEnumerable<object> GetTopAnimals(string version, OrganismType tat, int num)
 {
     return null;
 }
コード例 #32
0
 partial void OnOrganismTypeUpdating(OrganismType organismType);
コード例 #33
0
 partial void OnOrganismTypeUpdated(OrganismType organismType);
コード例 #34
0
 /// <summary>
 /// Deprecated Method for adding a new object to the OrganismTypes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToOrganismTypes(OrganismType organismType)
 {
     base.AddObject("OrganismTypes", organismType);
 }
コード例 #35
0
ファイル: Reference.cs プロジェクト: Carolasb/Terrarium
 /// <remarks/>
 public void GetTopAnimalsAsync(string version, OrganismType tat, int num) {
     this.GetTopAnimalsAsync(version, tat, num, null);
 }
コード例 #36
0
ファイル: Reference.cs プロジェクト: Carolasb/Terrarium
 /// <remarks/>
 public void GetTopAnimalsAsync(string version, OrganismType tat, int num, object userState) {
     if ((this.GetTopAnimalsOperationCompleted == null)) {
         this.GetTopAnimalsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetTopAnimalsOperationCompleted);
     }
     this.InvokeAsync("GetTopAnimals", new object[] {
                 version,
                 tat,
                 num}, this.GetTopAnimalsOperationCompleted, userState);
 }
コード例 #37
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }
            ((fhirCsR4.Models.BackboneElement) this).SerializeJson(writer, options, false);

            if (Target != null)
            {
                writer.WritePropertyName("target");
                Target.SerializeJson(writer, options);
            }

            if (Type != null)
            {
                writer.WritePropertyName("type");
                Type.SerializeJson(writer, options);
            }

            if (Interaction != null)
            {
                writer.WritePropertyName("interaction");
                Interaction.SerializeJson(writer, options);
            }

            if (Organism != null)
            {
                writer.WritePropertyName("organism");
                Organism.SerializeJson(writer, options);
            }

            if (OrganismType != null)
            {
                writer.WritePropertyName("organismType");
                OrganismType.SerializeJson(writer, options);
            }

            if (AmountQuantity != null)
            {
                writer.WritePropertyName("amountQuantity");
                AmountQuantity.SerializeJson(writer, options);
            }

            if (AmountRange != null)
            {
                writer.WritePropertyName("amountRange");
                AmountRange.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(AmountString))
            {
                writer.WriteString("amountString", (string)AmountString !);
            }

            if (_AmountString != null)
            {
                writer.WritePropertyName("_amountString");
                _AmountString.SerializeJson(writer, options);
            }

            if (AmountType != null)
            {
                writer.WritePropertyName("amountType");
                AmountType.SerializeJson(writer, options);
            }

            if ((Source != null) && (Source.Count != 0))
            {
                writer.WritePropertyName("source");
                writer.WriteStartArray();

                foreach (Reference valSource in Source)
                {
                    valSource.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
コード例 #38
0
 partial void OnOrganismTypeDeleted(OrganismType organismType);
コード例 #39
0
 partial void OnOrganismTypeSaved(OrganismType organismType);