Initial population

This commit is contained in:
Jon
2026-03-07 19:22:22 -06:00
parent 647f55feb9
commit cae1a3ec46
108 changed files with 28484 additions and 0 deletions

View File

@@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JRCookbookBusiness
{
public class IngredientMeasure
{
public Guid? ingredientID = null;
public Guid? measureID = null;
public Single gramWeight = 0;
public IngredientMeasure()
{
}
public IngredientMeasure(Guid ingredientID, Guid measureID)
{
PopulateByID(ingredientID, measureID);
}
public static IngredientMeasure GetIngredientMeasureByID(Guid ingredientID, Guid measureID)
{
return new IngredientMeasure(ingredientID, measureID);
}
private void PopulateByID(Guid ingredientID, Guid measureID)
{
DataSet recordSet;
recordSet = clsDatabaseLayer.GetDatabaseLayer().GetIngredientMeasureByID(ingredientID, measureID);
if (recordSet.Tables[0].Rows.Count > 0)
{
DataRow ldbrwRow;
ldbrwRow = recordSet.Tables[0].Rows[0];
PopulateFromDataRow(ldbrwRow);
}
}
public static IngredientMeasure GetIngredientMeasureByDataRow(DataRow row)
{
var newIngredientMeasure = new IngredientMeasure();
newIngredientMeasure.PopulateFromDataRow(row);
return newIngredientMeasure;
}
private void PopulateFromDataRow(DataRow dataRow)
{
InitializeAllFields();
if (dataRow.IsNull("ingredientID"))
ingredientID = null;
else
ingredientID = (Guid)dataRow["ingredientID"];
if (dataRow.IsNull("measureID"))
measureID = null;
else
measureID = (Guid)dataRow["measureID"];
if (dataRow.IsNull("gramweight"))
gramWeight = 0;
else
gramWeight = (Single)dataRow["gramweight"];
}
private void InitializeAllFields()
{
ingredientID = null;
measureID = null;
gramWeight = 0;
}
}
}