Beispiel #1
0
        public async Task <Recipe> UpdateStepInRecipe(Guid recipeId, Step step)
        {
            var recipe = await GetOne(recipeId);

            var stepToUpdate = await GetStep(step.ID, recipe);

            EntityCopier.Copy(step.ConvertToEntity(recipe), stepToUpdate);
            await _db.SaveChangesAsync();

            return(recipe.ConvertToDTO());
        }
        public List <DiscrepancyModel> actionGetPendingDiscrepency()
        {
            List <Discrepancy>      discrepancy_entities = data.Discrepancies.Where(o => o.status == 0).ToList();
            List <DiscrepancyModel> stationery_models    = new List <DiscrepancyModel>();

            foreach (Discrepancy discrepency in discrepancy_entities)
            {
                stationery_models.Add(EntityCopier.Copy(discrepency));
            }

            return(stationery_models);
        }
Beispiel #3
0
        public void loadAllStationaries()
        {
            JavaScriptSerializer   js = new JavaScriptSerializer();
            List <Stationery>      stationery_entities = stationaryController.actionGetStationeries();
            List <StationeryModel> stationery_models   = new List <StationeryModel>();

            foreach (Stationery s in stationery_entities)
            {
                stationery_models.Add(EntityCopier.Copy(s));
            }
            String str = js.Serialize(stationery_models);

            Response.Write(str);
        }//loadAllStationaries
Beispiel #4
0
        public static string get_all_stationaries()
        {
            StationeryController   stationaryController = new StationeryController();
            JavaScriptSerializer   js = new JavaScriptSerializer();
            List <Stationery>      stationery_entities = stationaryController.actionGetStationeries();
            List <StationeryModel> stationery_models   = new List <StationeryModel>();

            foreach (Stationery s in stationery_entities)
            {
                stationery_models.Add(EntityCopier.Copy(s));
            }
            String str = js.Serialize(stationery_models);

            return(str);
        }
        public static string GetAllStationaries()
        {
            JavaScriptSerializer js = new JavaScriptSerializer();
            List <Stationery>    stationery_entities = stationaryController.actionGetStationeries();

            System.Diagnostics.Debug.WriteLine(" inside getAllStationaries  current count: " + stationery_entities.Count);
            List <StationeryModel> stationery_models = new List <StationeryModel>();

            foreach (Stationery s in stationery_entities)
            {
                stationery_models.Add(EntityCopier.Copy(s));
            }
            String str = js.Serialize(stationery_models);

            //String str = js.Serialize(stationaryList);
            // System.Diagnostics.Debug.WriteLine("total:" + stationaryController.actionGetStationeries().Count());
            // System.Diagnostics.Debug.WriteLine("check:" + str);

            //stationaryList
            return(str);
        }//getAllStationaries