public HttpResponseMessage GetBatchesById(int batchId)
        {
            var batch          = _batchService.GetBatchById(batchId);
            var batchviewmodel = Areas.MasterArea.Mapper.BatchMapper.Detach(batch);

            return(Request.CreateResponse(HttpStatusCode.OK, batchviewmodel));
        }
Esempio n. 2
0
        public async Task <ActionResult <BatchFile> > GetBatch(Guid batchid)
        {
            try
            {
                var batchFile = await batchService.GetBatchById(batchid);

                if (batchFile == null)
                {
                    return(BadRequest(modelValidation.ValidateModel("400", "Batch id incorrect", "Incorrect batch id is provided")));
                }
                else
                {
                    return(batchFile);
                }
            }
            catch (Exception ex)
            {
                logger.LogError(ex.Message.ToString());
                return(BadRequest(ex.Message.ToString()));
            }
        }
 /// <summary>
 /// Edit Batch
 /// </summary>
 /// <param name="batchId"></param>
 /// <returns></returns>
 public ActionResult Edit(int batchId)
 {
     ViewBag.Batch = _batchService.GetBatchById(batchId);
     return(View());
 }