コード例 #1
0
        public ActionResult View(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                NewsUpdts Update = new Cateloge().SelectNewsAndUpdts(id);

                if (Update == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    AllClasses Data = new AllClasses();
                    Data.NewsAndUpdt = new NewsUpdt
                    {
                        Id      = Update.db_Id,
                        Name    = Update.Name,
                        Detail  = Update.Detail,
                        Picture = Update.Picture,
                        Publish = Update.Publish
                    };
                    return(View(Data));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #2
0
        public ActionResult Edit(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                ContactsInfo contactsinfo = new Cateloge().SelectContactInfo(id);

                if (contactsinfo == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    ContactInfo Formelements = new ContactInfo
                    {
                        Title            = contactsinfo.Title,
                        Contact_Cell     = contactsinfo.Contact_Cell,
                        Contact_Phone    = contactsinfo.Contact_Phone,
                        Contact_Email    = contactsinfo.Contact_Email,
                        Contact_Website  = contactsinfo.Contact_Website,
                        Contact_Location = contactsinfo.Contact_Location,
                        Contact_Address  = contactsinfo.Contact_Address
                    };
                    return(PartialView("_ContactForm", Formelements));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #3
0
        public ActionResult View(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                AllClasses Data = new AllClasses();

                Books book = new Cateloge().SelectBook(id);

                if (book == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    Data.Book_ = new Book
                    {
                        Id         = book.db_Id,
                        Name       = book.Name,
                        Class_name = (book.Class_name != null) ? book.Class_name.Name : null,
                        Picture    = book.Picture,
                        Publish    = book.Publish
                    };
                    return(View(Data));
                }
                return(View());
            }
        }
コード例 #4
0
        public ActionResult Edit(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                StuffsInStorages stuffsinstorage = new Cateloge().SelectStuffInStorage(id);

                if (stuffsinstorage == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    StuffInStorage Formelements = new StuffInStorage
                    {
                        Name = stuffsinstorage.Name
                    };
                    return(PartialView("_EditFile", Formelements));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #5
0
        public ActionResult Edit(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                Uniforms uniform = new Cateloge().SelectUniforms(id);

                if (uniform == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    Uniform Formelements = new Uniform
                    {
                        Name         = uniform.Name,
                        Class_lvl_id = uniform.Class_lvl_id,
                        Picture      = uniform.Picture,
                    };
                    return(PartialView("_EditUniform", Formelements));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #6
0
        public ActionResult EditSbjctsTtlMrks(int id, int rid)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                List <SubjectsTotalMarks> subjectsttlmrks = new Cateloge().SelectAllSubjectsTotalMarksWithIds(id, rid);
                AllClasses Data = new AllClasses();

                if (subjectsttlmrks == null)
                {
                    ViewBag.StatusMessage = " No Any Subject Founded ! ";
                }
                else
                {
                    Data.SubjectsTotalMark_s = new List <SubjectTotalMark>();
                    foreach (var gdfc in subjectsttlmrks)
                    {
                        SubjectTotalMark dbr = new SubjectTotalMark();
                        dbr.Id           = gdfc.Id;
                        dbr.R_id         = Convert.ToString(rid);
                        dbr.Subject_Name = gdfc.Subject_name.Name;
                        dbr.Total_marks  = gdfc.Total_marks;
                        Data.SubjectsTotalMark_s.Add(dbr);
                    }
                    Data.SubjectsTotalMark_s.TrimExcess();
                }
                return(PartialView("_EditSbjctsTtlMrks", Data));
            }
        }
コード例 #7
0
        public ActionResult View(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                Achvmnts achvmnt = new Cateloge().SelectAchvmnts(id);

                if (achvmnt == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    AllClasses Data = new AllClasses();
                    Data.Achvmnt = new Achvmnt
                    {
                        Id      = achvmnt.db_Id,
                        Name    = achvmnt.Name,
                        Detail  = achvmnt.Detail,
                        Picture = achvmnt.Picture,
                        Publish = achvmnt.Publish
                    };
                    return(View(Data));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #8
0
 public ActionResult ViewEvent(int?id)
 {
     if (id.HasValue)
     {
         Events selecteventforweb = new Cateloge().EventForWeb(id);
         if (selecteventforweb == null)
         {
             TempData["Message"] = "Unknown Request !";
             return(RedirectToAction("Index"));
         }
         else
         {
             WebAllClass Data = new WebAllClass();
             Data.Event_ = new Event
             {
                 Id      = selecteventforweb.db_Id,
                 Name    = selecteventforweb.Name,
                 Picture = selecteventforweb.Picture,
                 Detail  = selecteventforweb.Detail,
                 Date    = selecteventforweb.Date,
                 Month   = selecteventforweb.Month,
                 Year    = selecteventforweb.Year,
                 Time    = selecteventforweb.Time
             };
             return(View(Data));
         }
     }
     else
     {
         return(RedirectToAction("Index"));
     }
 }
コード例 #9
0
        public ActionResult ShiningStars()
        {
            List <Stars> SelectAllStars = new Cateloge().StarsForWeb();

            if (SelectAllStars == null)
            {
                TempData["Message"] = "No Any Shining Star Posted Yet !";
            }
            else
            {
                WebAllClass Data = new WebAllClass();
                Data.Star_s = new List <Star>();
                foreach (var gdfc in SelectAllStars)
                {
                    Star dbr = new Star();
                    dbr.Id      = gdfc.db_Id;
                    dbr.Name    = gdfc.Name;
                    dbr.Picture = gdfc.Picture;
                    dbr.Date    = gdfc.Date;
                    dbr.Month   = gdfc.Month;
                    dbr.Year    = gdfc.Year;
                    dbr.Time    = gdfc.Time;
                    Data.Star_s.Add(dbr);
                }
                return(View(Data));
            }
            return(View());
        }
コード例 #10
0
        public ActionResult News()
        {
            List <NewsUpdts> SelectAllNews = new Cateloge().SelectAllNewsForWeb();

            if (SelectAllNews == null)
            {
                TempData["Message"] = "No Any News Posted Yet !";
            }
            else
            {
                WebAllClass Data = new WebAllClass();
                Data.NewsAndUpdts_s = new List <NewsUpdt>();
                foreach (var gdfc in SelectAllNews)
                {
                    NewsUpdt dbr = new NewsUpdt();
                    dbr.Id      = gdfc.db_Id;
                    dbr.Name    = gdfc.Name;
                    dbr.Picture = gdfc.Picture;
                    dbr.Detail  = gdfc.Detail;
                    dbr.Date    = gdfc.Date;
                    dbr.Month   = gdfc.Month;
                    dbr.Year    = gdfc.Year;
                    dbr.Time    = gdfc.Time;
                    Data.NewsAndUpdts_s.Add(dbr);
                }
                return(View(Data));
            }
            return(View());
        }
コード例 #11
0
        public ActionResult Events()
        {
            List <Events> SelectAllEvents = new Cateloge().EventsForWeb();

            if (SelectAllEvents == null)
            {
                TempData["Message"] = "No Any Event Posted Yet !";
            }
            else
            {
                WebAllClass Data = new WebAllClass();
                Data.Event_s = new List <Event>();
                foreach (var gdfc in SelectAllEvents)
                {
                    Event dbr = new Event();
                    dbr.Id      = gdfc.db_Id;
                    dbr.Name    = gdfc.Name;
                    dbr.Picture = gdfc.Picture;
                    dbr.Detail  = gdfc.Detail;
                    dbr.Date    = gdfc.Date;
                    dbr.Month   = gdfc.Month;
                    dbr.Year    = gdfc.Year;
                    dbr.Time    = gdfc.Time;
                    Data.Event_s.Add(dbr);
                }
                return(View(Data));
            }
            return(View());
        }
コード例 #12
0
        public ActionResult Achievements()
        {
            List <Achvmnts> achvmnts = new Cateloge().AchvmntsForWeb();

            if (achvmnts == null)
            {
                TempData["Message"] = "No Any Ahcievement Posted Yet !";
            }
            else
            {
                WebAllClass Data = new WebAllClass();
                Data.Achievements = new List <Achvmnt>();
                foreach (var gdfc in achvmnts)
                {
                    Achvmnt dbr = new Achvmnt();
                    dbr.Id      = gdfc.db_Id;
                    dbr.Name    = gdfc.Name;
                    dbr.Picture = gdfc.Picture;
                    dbr.Detail  = gdfc.Detail;
                    dbr.Date    = gdfc.Date;
                    dbr.Month   = gdfc.Month;
                    dbr.Year    = gdfc.Year;
                    dbr.Time    = gdfc.Time;
                    Data.Achievements.Add(dbr);
                }
                return(View(Data));
            }
            return(View());
        }
コード例 #13
0
 public ActionResult Edit(int id)
 {
     if (Session["Username"] == null && Session["Password"] == null)
     {
         return(RedirectToAction("Index", "Admin", new { area = "" }));
     }
     else
     {
         Students Parents = new Cateloge().SelectParent(id);
         if (Parents == null)
         {
             ViewBag.StatusMessage = " No Any Result Founded ! ";
         }
         else
         {
             Student Data = new Student()
             {
                 db_Id               = Parents.db_Id,
                 Aplicnt_f_name      = Parents.Aplicnt_f_name,
                 Aplicnt_f_ocptn     = Parents.Aplicnt_f_ocptn,
                 Aplicnt_f_title     = Parents.Aplicnt_f_title,
                 Aplicnt_f_cell      = Parents.Aplicnt_f_cell,
                 Aplicnt_f_bsns_name = Parents.Aplicnt_f_bsns_name,
                 Aplicnt_f_bsns_addr = Parents.Aplicnt_f_bsns_addr,
                 Aplicnt_f_email     = Parents.Aplicnt_f_email,
                 Aplicnt_f_phone     = Parents.Aplicnt_f_phone,
                 Aplicnt_m_name      = Parents.Aplicnt_m_name,
                 Aplicnt_m_cell      = Parents.Aplicnt_m_cell,
                 Aplicnt_m_ldln      = Parents.Aplicnt_m_ldln,
             };
             return(PartialView("_EditParent", Data));
         }
         return(RedirectToAction("Index"));
     }
 }
コード例 #14
0
        public ActionResult Edit(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                NewsUpdts Update = new Cateloge().SelectNewsAndUpdts(id);

                if (Update == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    NewsUpdt Formelements = new NewsUpdt
                    {
                        Name    = Update.Name,
                        Detail  = Update.Detail,
                        Picture = Update.Picture,
                    };
                    return(PartialView("_EditNewsOrUpdate", Formelements));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #15
0
        public ActionResult Edit(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                Results result = new Cateloge().SelectResults(id);

                if (result == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    Result Formelements = new Result
                    {
                        Name = result.Session_year
                    };
                    return(PartialView("_CreateNewResult", Formelements));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #16
0
        public ActionResult ContactUs()
        {
            ContactsInfo SelectContactInfo = new Cateloge().ContactInfoForWeb();

            WebAllClass Data = new WebAllClass();

            if (SelectContactInfo == null)
            {
                ViewBag.Msg = "No Content Founded";
                return(View());
            }
            else
            {
                Data.ContactInfo = new ContactInfo
                {
                    Title            = SelectContactInfo.Title,
                    Contact_Cell     = SelectContactInfo.Contact_Cell,
                    Contact_Phone    = SelectContactInfo.Contact_Phone,
                    Contact_Email    = SelectContactInfo.Contact_Email,
                    Contact_Website  = SelectContactInfo.Contact_Website,
                    Contact_Location = SelectContactInfo.Contact_Location,
                    Contact_Address  = SelectContactInfo.Contact_Address,
                };
                return(View(Data));
            }
        }
コード例 #17
0
        public ActionResult AddSbjctsTtlMrks(int id, int rid)
        {
            List <Subjects> subjects = new Cateloge().SelectSubjectsOfClassById(id);
            AllClasses      Data     = new AllClasses();

            if (subjects == null)
            {
                ViewBag.StatusMessage = " No Any Subject Founded ! ";
            }
            else
            {
                Data.SubjectsTotalMark_s = new List <SubjectTotalMark>();
                foreach (var gdfc in subjects)
                {
                    SubjectTotalMark dbr = new SubjectTotalMark();
                    dbr.Id           = gdfc.db_Id;
                    dbr.Subject_Name = gdfc.Name;
                    dbr.Subject_id   = gdfc.db_Id;
                    Data.SubjectsTotalMark_s.Add(dbr);
                }
                Data.SubjectsTotalMark_s.TrimExcess();

                Data.SubjectsTotalMarks_ = new SubjectTotalMark()
                {
                    R_id     = Convert.ToString(rid),
                    Class_id = Convert.ToString(id)
                };
            }
            return(PartialView("_AddSbjctsTtlMrks", Data));
        }
コード例 #18
0
        public ActionResult View(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                Syllabuses syllabus = new Cateloge().SelectSyllabus(id);

                if (syllabus == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    AllClasses Data = new AllClasses();
                    Data.Syllabus = new Syllabus
                    {
                        Id                 = syllabus.db_Id,
                        Name_of_lvl        = syllabus.Name_of_lvl,
                        Detail_of_syllabus = syllabus.Detail_of_syllabus,
                        Publish            = syllabus.Publish
                    };
                    return(View(Data));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #19
0
 public ActionResult All(string Search_key)
 {
     if (Session["Username"] == null && Session["Password"] == null)
     {
         return(RedirectToAction("Index", "Admin", new { area = "" }));
     }
     else
     {
         List <Subjects> Subjects = new Cateloge().Subjects();
         AllClasses      Data     = new AllClasses();
         if (Subjects == null)
         {
             ViewBag.StatusMessage = " No Any Data Found ! ";
         }
         else
         {
             Data.Subject_s = new List <Subject>();
             foreach (var gdfc in Subjects)
             {
                 Subject dbr = new Subject();
                 dbr.Id         = gdfc.db_Id;
                 dbr.ClassLevel = gdfc.ClassLevel;
                 dbr.ClassName  = (gdfc.ClassName != null) ? gdfc.ClassName.Name : null;
                 dbr.Name       = gdfc.Name;
                 Data.Subject_s.Add(dbr);
             }
             Data.Subject_s.TrimExcess();
             return(View(Data));
         }
         return(View());
     }
 }
コード例 #20
0
        public ActionResult Create()
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                if (Request.IsAjaxRequest())
                {
                    List <ClassLevels> ClassLevels = new Cateloge().ClassLevels();

                    if (ClassLevels == null)
                    {
                        return(View());
                    }
                    else
                    {
                        AllClasses Data = new AllClasses();
                        Data.ClassLevel_s = new List <ClassLevel>();
                        foreach (var gdfc in ClassLevels)
                        {
                            ClassLevel dbr = new ClassLevel();
                            dbr.Id   = gdfc.db_Id;
                            dbr.Name = gdfc.Name;
                            Data.ClassLevel_s.Add(dbr);
                        }
                        Data.ClassLevel_s.TrimExcess();
                        return(PartialView("_CreateNewSyllabus", Data));
                    }
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #21
0
        public ActionResult Edit(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                Achvmnts achvmnt = new Cateloge().SelectAchvmnts(id);

                if (achvmnt == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    Achvmnt Formelements = new Achvmnt
                    {
                        Name    = achvmnt.Name,
                        Detail  = achvmnt.Detail,
                        Picture = achvmnt.Picture
                    };
                    return(PartialView("_EditAchvmnt", Formelements));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #22
0
        public ActionResult Edit(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                Syllabuses syllabus = new Cateloge().SelectSyllabus(id);

                if (syllabus == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    Syllabus Formelements = new Syllabus
                    {
                        Name_of_lvl        = syllabus.Name_of_lvl,
                        Detail_of_syllabus = syllabus.Detail_of_syllabus
                    };
                    return(PartialView("_CreateNewSyllabus", Formelements));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #23
0
        public ActionResult View(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                AllClasses Data = new AllClasses();
                Data.Uniform_ = new Uniform();

                Uniforms uniform = new Cateloge().SelectUniforms(id);

                if (uniform == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    Data.Uniform_ = new Uniform {
                        Id           = uniform.db_Id,
                        Name         = uniform.Name,
                        Class_lvl_id = uniform.Class_lvl_id,
                        Picture      = uniform.Picture,
                        Publish      = uniform.Publish
                    };
                    return(View(Data));
                }
                return(View());
            }
        }
コード例 #24
0
        public ActionResult Edit(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                Diaries diary = new Cateloge().SelectDiary(id);

                if (diary == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    Diary Formelements = new Diary
                    {
                        Diary_date = diary.Diary_date
                    };
                    return(PartialView("_Edit", Formelements));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #25
0
        public ActionResult View(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                ContactsInfo contactsinfo = new Cateloge().SelectContactInfo(id);

                if (contactsinfo == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    AllClasses Data = new AllClasses();
                    Data.ContactInfo = new ContactInfo
                    {
                        Id               = contactsinfo.db_Id,
                        Title            = contactsinfo.Title,
                        Contact_Cell     = contactsinfo.Contact_Cell,
                        Contact_Phone    = contactsinfo.Contact_Phone,
                        Contact_Email    = contactsinfo.Contact_Email,
                        Contact_Website  = contactsinfo.Contact_Website,
                        Contact_Location = contactsinfo.Contact_Location,
                        Contact_Address  = contactsinfo.Contact_Address,
                        Publish          = contactsinfo.Publish
                    };
                    return(View(Data));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #26
0
        public ActionResult Active()
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                List <Diaries> diaries = new Cateloge().ActiveDiaries();

                if (diaries == null)
                {
                    ViewBag.StatusMessage = " No Any Data Found ! ";
                }
                else
                {
                    AllClasses Data = new AllClasses();
                    Data.Diary_s = new List <Diary>();
                    foreach (var gdfc in diaries)
                    {
                        Diary dbr = new Diary();
                        dbr.Id         = gdfc.db_Id;
                        dbr.Diary_date = gdfc.Diary_date;
                        dbr.Settings   = gdfc.Settings;
                        Data.Diary_s.Add(dbr);
                    }
                    Data.Diary_s.TrimExcess();
                    return(View(Data));
                }
                return(View());
            }
        }
コード例 #27
0
        public ActionResult Edit(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                Books book = new Cateloge().SelectBook(id);

                if (book == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    Book Formelements = new Book
                    {
                        Name             = book.Name,
                        Class_subject_id = book.Class_subject_id,
                        Picture          = book.Picture,
                    };
                    return(PartialView("_EditBook", Formelements));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #28
0
        public ActionResult SelectViewType(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                Sub_Results sub_result = new Cateloge().SelectSubResult(id);

                if (sub_result == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    AllClasses Data = new AllClasses();
                    Data.Sub_Result = new Sub_Result()
                    {
                        id   = sub_result.id,
                        name = sub_result.name
                    };
                    return(View(Data));
                }

                return(RedirectToAction("Index"));
            }
        }
コード例 #29
0
        public ActionResult Active()
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                List <Books> Books = new Cateloge().ActiveBooks();

                if (Books == null)
                {
                    ViewBag.StatusMessage = " No Any Data Found ! ";
                }
                else
                {
                    AllClasses Data = new AllClasses();
                    Data.Book_s = new List <Book>();
                    foreach (var gdfc in Books)
                    {
                        Book dbr = new Book();
                        dbr.Id         = gdfc.db_Id;
                        dbr.Name       = gdfc.Name;
                        dbr.Class_name = (gdfc.Class_name != null) ? gdfc.Class_name.Name : null;
                        dbr.Picture    = gdfc.Picture;
                        Data.Book_s.Add(dbr);
                    }
                    Data.Book_s.TrimExcess();
                    return(View(Data));
                }
                return(View());
            }
        }
コード例 #30
0
        public ActionResult Edit(int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                Stars star = new Cateloge().SelectStars(id);

                if (star == null)
                {
                    ViewBag.StatusMessage = " No Any Result Founded ! ";
                }
                else
                {
                    Star Formelements = new Star
                    {
                        Name        = star.Name,
                        Star_type   = star.Star_type,
                        Achievement = star.Achievement,
                        Picture     = star.Picture
                    };
                    return(PartialView("_EditShiningStar", Formelements));
                }

                return(RedirectToAction("Index"));
            }
        }