示例#1
0
        public ActionResult Edit(int id)
        {
            using (DefinitionService service = new DefinitionService())
            {
                ViewBag.RecordStatuses = service.GetRecordStatuses();
            }

            using (CategoryService service = new CategoryService())
            {
                var result = service.Get(id);

                return(View(result));
            }
        }
示例#2
0
        private void UpdateStudent_Load(object sender, EventArgs e)
        {
            using (DefinitionService service = new DefinitionService())
            {
                cmbRecordStatus.DataSource    = service.GetRecordStatuses();
                cmbRecordStatus.DisplayMember = "RecordStatusName";
                cmbRecordStatus.ValueMember   = "RecordStatusId";
            }


            using (StudentService service = new StudentService())
            {
                listBox1.DataSource    = service.List();
                listBox1.DisplayMember = "FullName";
                listBox1.ValueMember   = "StudentId";
            }
        }
示例#3
0
        private void UpdateStudentForm_Load(object sender, EventArgs e)
        {
            using (StudentService studentService = new StudentService())
            {
                var students = studentService.List();

                lbStudents.DataSource    = students;
                lbStudents.DisplayMember = "FullName";
                lbStudents.ValueMember   = "StudentId";
            }
            using (DefinitionService definitionService = new DefinitionService())
            {
                cbRecordStatus.DataSource    = definitionService.GetRecordStatuses();
                cbRecordStatus.DisplayMember = "RecordStatusName";
                cbRecordStatus.ValueMember   = "RecordStatusId";
            }
        }
示例#4
0
        private void UpdateBookForm_Load(object sender, EventArgs e)
        {
            using (DefinitionService definitionService = new DefinitionService())
            {
                cmbRecordStatus.DataSource    = definitionService.GetRecordStatuses();
                cmbRecordStatus.DisplayMember = "RecordStatusName";
                cmbRecordStatus.ValueMember   = "RecordStatusId";

                cmbGenres.DataSource    = definitionService.GetGenres();
                cmbGenres.DisplayMember = "GenreName";
                cmbGenres.ValueMember   = "GenreId";
            }
            using (BookService bookService = new BookService())
            {
                lbBooks.DataSource    = bookService.List();
                lbBooks.DisplayMember = "BookName";
                lbBooks.ValueMember   = "BookId";
            }
        }
示例#5
0
        /// <summary>
        /// Edit e gönnderilecek veriler tanımlandı
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Edit(int id)
        {
            if (Session["loginuser"] == null)
            {
                return(RedirectToAction("Index", "Account"));
            }

            using (CategoryService categoryService = new CategoryService())
            {
                ViewBag.Categories = categoryService.GetCategories();
            }
            using (DefinitionService definitionService = new DefinitionService())
            {
                ViewBag.RecordStatuses = definitionService.GetRecordStatuses();
                ///ViewBag ile Controllerdan veriler gönderiliyor
            }
            using (BlogService blogService = new BlogService())
            {
                var result = blogService.Get(id);
                return(View(result));
            }
        }
示例#6
0
        public void GetRecordStatus()
        {
            var result = service.GetRecordStatuses();

            Assert.IsNotNull(result);
        }