예제 #1
0
        public ActionResult List(int?paramPage, int paramPageSize, string paramSearch, int paramAsc, int paramDesc)
        {
            /* for paged */
            int countDataDb        = DosenDataAccess.GetCountData(paramSearch);
            PagingModel_Jurusan pg = new PagingModel_Jurusan(countDataDb, paramPage, paramPageSize);

            ViewData["pg"] = pg;

            List <DosenViewModel> listData = DosenDataAccess.GetListAll(paramSearch, paramAsc, paramDesc, ((pg.CurrentPage - 1) * pg.PageSize), pg.PageSize);

            return(View("List", listData));
        }
예제 #2
0
        public ActionResult Edit(DosenViewModel paramModel)
        {
            try
            {
                paramModel.updated_by   = "adit";
                paramModel.updated_date = DateTime.Now;

                if (DosenDataAccess.Update(paramModel))
                {
                    return(Json(new { success = true, message = "Data berhasil ditambahkan!" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { success = true, message = DosenDataAccess.Message }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception hasError)
            {
                return(Json(new { success = true, message = hasError.Message }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #3
0
        public ActionResult Create(DosenViewModel paramModel)
        {
            try
            {
                paramModel.created_by   = "adit";
                paramModel.created_date = DateTime.Now;
                paramModel.updated_by   = "adit";
                paramModel.updated_date = DateTime.Now;
                List <Files> statusUpload = Models.Shared.Helper.FnFileUploadMultiple(Request.Files, Request.Browser.Browser.ToUpper(), "~/Images/");

                if (DosenDataAccess.Insert(paramModel))
                {
                    return(Json(new { success = true, message = "Data berhasil ditambahkan!" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { success = false, message = DosenDataAccess.Message }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception hasError)
            {
                return(Json(new { success = true, message = hasError.Message }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #4
0
 public ActionResult Details(int paramId)
 {
     return(View(DosenDataAccess.GetDetailsByid(paramId)));
 }
예제 #5
0
 public ActionResult Edit(int paramId)
 {
     ViewBag.JurusanList       = new SelectList(JurusanDataAccess.GetListAll(), "id_jurusan_pk", "nama_jurusan");
     ViewData["TypeDosenList"] = TypeDosenDataAccess.GetListAll();
     return(View(DosenDataAccess.GetDetailsByid(paramId)));
 }