Exemplo n.º 1
0
        /*Funcion: busca si existe el proceso para ese parametro
          Param: processID
          Return: bool
          */
        public bool hadProcessParameter(String processID)
        {
            ParameterDao Dao = new ParameterDao();
            DataTable DaoResult = Dao.hadProcessParameter(processID);

            bool state = false;

            foreach (DataRow row in DaoResult.Rows)
            {
                RecipeProcessView x = new RecipeProcessView();
                if (DaoResult.Columns.Contains("Result") && row["Result"] != DBNull.Value) { state = (bool) row["Result"]; }

            }
            return state;
        }
Exemplo n.º 2
0
        /*Funcion: Obtiene los process de una receta por un producto
          Param: idProcess
          Return: Lista RecipeProcessView
          */
        public List<RecipeProcessView> getRecipeProcessForProduct(int idProducts)
        {
            RecipeDao Dao = new RecipeDao();
            DataTable DaoResult = Dao.getRecipeProcessForProduct(idProducts);
            List<RecipeProcessView> ViewList = new List<RecipeProcessView>();

            foreach (DataRow row in DaoResult.Rows)
            {
                RecipeProcessView x = new RecipeProcessView();
                if (DaoResult.Columns.Contains("ProcessName") && row["ProcessName"] != DBNull.Value) { x.ProcessName = row["ProcessName"].ToString(); }
                if (DaoResult.Columns.Contains("ProcessId") && row["ProcessId"] != DBNull.Value) { x.ProcessId = Convert.ToInt32(row["ProcessId"]); }

                ViewList.Add(x);
            }
            return ViewList;
        }