예제 #1
0
        public async Task <ActionResult> GetList()
        {
            PDAMRepository Repository = new PDAMRepository();

            ViewData["ListPDAM"] = await Repository.GetPDAM();

            return(PartialView("_SimpleGrid"));
        }
예제 #2
0
        public async Task <ActionResult> Delete(MasterPDAM model)
        {
            try
            {
                PDAMRepository Repository = new PDAMRepository();
                var            result     = await Repository.DeletePDAM(model.PDAMId, User.Identity.Name);

                if (result == true)
                {
                    return(await GetList());
                }
                else
                {
                    return(View(result));
                }
            }
            catch
            {
                return(View(false));
            }
        }
예제 #3
0
        public async Task <ActionResult> Create(MasterPDAM model)
        {
            try
            {
                PDAMRepository Repository = new PDAMRepository();
                var            result     = await Repository.CreatePDAM(model.PDAMId, model.Deskripsi, User.Identity.Name);

                if (result == true)
                {
                    return(await GetList());
                }
                else
                {
                    return(View(result));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("{0} Exception caught.", e);
                return(View(false));
            }
        }