public ActionResult Create(Student stdObj)
        {
            if (ModelState.IsValid)
            {
                var id = MyDAL.SaveStudent(stdObj);
                ViewBag.ID = id;
                return(RedirectToAction("Index"));
            }

            return(View(stdObj));
        }
예제 #2
0
        private async void initData()
        {
            dal = MyDAL.Instance;
            string JsonWorker = await dal.GetAsync("2019_02_06_MVC_Backend/rest/workers");

            var deserialized = JsonConvert.DeserializeObject <IEnumerable <Worker> >(JsonWorker);

            // Do something with it

            _workers = deserialized.ToList <Worker>();
        }
예제 #3
0
        public CustomersModel()
        {
            Dal = MyDAL.Instance;

            initData();
        }
 public ActionResult DeleteRec(int id)
 {
     MyDAL.DeleteStudentByID(id);
     return(RedirectToAction("Index"));
 }
예제 #5
0
        public CitiesModel()
        {
            Dal = MyDAL.Instance;

            initData();
        }
        public ActionResult Edit(Student stdObj)
        {
            int id = MyDAL.SaveStudent(stdObj);

            return(RedirectToAction("Index"));
        }
        public ActionResult Delete(int id)
        {
            var result = MyDAL.GetStudentByID(id);

            return(View("Delete", result));
        }
        //
        // GET: /Student/

        public ActionResult Index()
        {
            var list = MyDAL.GetAllStudents();

            return(View("List", list));
        }
        public ActionResult Edit(int id)
        {
            var result = MyDAL.GetStudentByID(id);

            return(View("Edit", result));
        }
예제 #10
0
 public MyBLL(MyDAL dal)
 {
     _dal = dal;
 }
        public ActionResult Delete(int id)
        {
            var stdObj = MyDAL.GetStudentByID(id);

            return(View(stdObj));
        }
예제 #12
0
 public WorkersModel()
 {
     Dal = MyDAL.Instance;
     initData();
 }
        //
        // GET: /Student/

        public ActionResult Index()
        {
            var data = MyDAL.GetAllStudents();

            return(View("List", data));
        }
예제 #14
0
        public CarsModel()
        {
            Dal = MyDAL.Instance;

            InitData();
        }
예제 #15
0
 public static List <Employee> GetAll(string connectionString)
 {
     return(MyDAL.GetAll(connectionString));
 }
예제 #16
0
 public static void Update(string connectionString, int id, Employee emp)
 {
     MyDAL.Update(connectionString, id, emp);
 }
예제 #17
0
 public static Employee GetById(string connectionString, int id)
 {
     return(MyDAL.GetById(connectionString, id));
 }
예제 #18
0
 public BillsModel()
 {
     Dal = MyDAL.Instance;
     InitData();
     this.PropertyChanged += Model_Calculate;
 }