public ActionResult BatchCreate()
        {
            BatchCreateVM batch = new BatchCreateVM();

            batch.selectListOrganization = _selectOptionId.SelectOrganization();

            return(View(batch));
        }
        public ActionResult EditBatch(int id)
        {
            var batchVm = new BatchCreateVM();

            if (id > 0)
            {
                var batch = _batchManager.GetById(id);

                batchVm = Mapper.Map <BatchCreateVM>(batch);
                batchVm.selectListOrganization = _selectOptionId.SelectOrganization();
                batchVm.selectListCourse       = _selectOptionId.SelectCourse();
            }

            return(View(batchVm));
        }
        public ActionResult EditBatch(BatchCreateVM vm)
        {
            var course = Mapper.Map <Batch>(vm);

            var isUpdated = _batchManager.Update(course);


            if (isUpdated)
            {
                ViewBag.Msg = "Success";

                return(RedirectToAction("BatchDetails"));
            }

            ViewBag.Msg = "Failed";
            return(RedirectToAction("BatchDetails"));
        }
        public string BatchCreateAdd(BatchCreateVM vm)
        {
            var batch = Mapper.Map <Batch>(vm);


            if (ModelState.IsValid)
            {
                bool isAdded = _batchManager.AddBatch(batch);
                if (isAdded)
                {
                    return("Successfully Saved");
                }
                else
                {
                    return("Did not saved.");
                }
            }


            return("Sorry! Error Occured.");
        }