Example #1
0
        public ActionResult Create([Bind(Include = "Student_Id,Nim,Register_Id,Register_Number,Full_Name,First_Title,Last_Title,Gender_Id,Department_Id,Class_Prog_Id,Concentration_Id,Class_Id,Birth_Place,Birth_Date,Birth_Place_Id,Birth_Country_Id,Citizenship_Id,Entry_Period_Id,Entry_Period_Type_Id,Entry_Year_Id,Entry_Term_Id,Register_Status_Id,Religion_Id,Marital_Status_Id,Job_Id,Blood_Id,High_School_Major_Id,Nisn,Nik,Status_Id,Registration_Date,Registration_Officer_Id,Source_Fund_Id,Read_Quran,Transport,Photo_Status,Student_Password,Parent_Password,Hobby_Id,Kebutuhan_Khusus,Kk_Name,Recieve_Kps,Kps_Number,Completion_Date,Out_Date,Phone_Home,Phone_Mobile,Email_Corporate,Email_General,Rfid,Created_By,Created_Date,Modified_By,Modified_Date")] Acd_Student acd_Student)
        {
            if (ModelState.IsValid)
            {
                db.Acd_Student.Add(acd_Student);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Student_Id           = new SelectList(db.Acd_Gpa_TEMP, "Student_Id", "Student_Id", acd_Student.Student_Id);
            ViewBag.Student_Id           = new SelectList(db.Acd_Student_FREE_SKS, "Student_Id", "Description", acd_Student.Student_Id);
            ViewBag.Blood_Id             = new SelectList(db.Mstr_Blood_Type, "Blood_Type_Id", "Blood_Code", acd_Student.Blood_Id);
            ViewBag.Citizenship_Id       = new SelectList(db.Mstr_Citizenship, "Citizenship_Id", "Citizenship_Code", acd_Student.Citizenship_Id);
            ViewBag.Class_Id             = new SelectList(db.Mstr_Class, "Class_Id", "Class_Name", acd_Student.Class_Id);
            ViewBag.Class_Prog_Id        = new SelectList(db.Mstr_Class_Program, "Class_Prog_Id", "Class_Prog_Code", acd_Student.Class_Prog_Id);
            ViewBag.Birth_Country_Id     = new SelectList(db.Mstr_Country, "Country_Id", "Country_Code", acd_Student.Birth_Country_Id);
            ViewBag.Department_Id        = new SelectList(db.Mstr_Department.OrderBy(d => d.Department_Code), "Department_Id", "Department_Code", acd_Student.Department_Id);
            ViewBag.Entry_Period_Id      = new SelectList(db.Mstr_Entry_Period, "Entry_Period_Id", "Entry_Period_Code", acd_Student.Entry_Period_Id);
            ViewBag.Entry_Period_Type_Id = new SelectList(db.Mstr_Entry_Period_Type, "Entry_Period_Type_Id", "Entry_Period_Type_Code", acd_Student.Entry_Period_Type_Id);
            ViewBag.Entry_Year_Id        = new SelectList(db.Mstr_Entry_Year.OrderByDescending(ey => ey.Entry_Year_Id), "Entry_Year_Id", "Entry_Year_Name", acd_Student.Entry_Year_Id);
            ViewBag.Gender_Id            = new SelectList(db.Mstr_Gender, "Gender_Id", "Gender_Type", acd_Student.Gender_Id);
            ViewBag.High_School_Major_Id = new SelectList(db.Mstr_High_School_Major, "High_School_Major_Id", "High_School_Major_Code", acd_Student.High_School_Major_Id);
            ViewBag.Job_Id             = new SelectList(db.Mstr_Job_Category, "Job_Category_Id", "Job_Category_Name", acd_Student.Job_Id);
            ViewBag.Marital_Status_Id  = new SelectList(db.Mstr_Marital_Status, "Marital_Status_Id", "Marital_Status_Code", acd_Student.Marital_Status_Id);
            ViewBag.Register_Status_Id = new SelectList(db.Mstr_Register_Status, "Register_Status_Id", "Register_Status_Name", acd_Student.Register_Status_Id);
            ViewBag.Religion_Id        = new SelectList(db.Mstr_Religion, "Religion_Id", "Religion_Code", acd_Student.Religion_Id);
            ViewBag.Status_Id          = new SelectList(db.Mstr_Status, "Status_Id", "Status_Code", acd_Student.Status_Id);
            ViewBag.Entry_Term_Id      = new SelectList(db.Mstr_Term, "Term_Id", "Term_Code", acd_Student.Entry_Term_Id);
            ViewBag.Register_Id        = new SelectList(db.Reg_Camaru, "Camaru_Id", "Camaru_Code", acd_Student.Register_Id);
            ViewBag.Student_Id         = new SelectList(db.Acd_Yudisium, "Student_Id", "Sk_Num", acd_Student.Student_Id);
            return(View(acd_Student));
        }
        // GET: DefaultClassStudent/Edit/5
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Acd_Student acd_Student = db.Acd_Student.Find(id);

            if (acd_Student == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Student_Id           = new SelectList(db.Acd_Gpa_TEMP, "Student_Id", "Student_Id", acd_Student.Student_Id);
            ViewBag.Student_Id           = new SelectList(db.Acd_Student_FREE_SKS, "Student_Id", "Description", acd_Student.Student_Id);
            ViewBag.Blood_Id             = new SelectList(db.Mstr_Blood_Type, "Blood_Type_Id", "Blood_Code", acd_Student.Blood_Id);
            ViewBag.Citizenship_Id       = new SelectList(db.Mstr_Citizenship, "Citizenship_Id", "Citizenship_Code", acd_Student.Citizenship_Id);
            ViewBag.Class_Id             = new SelectList(db.Mstr_Class, "Class_Id", "Class_Name", acd_Student.Class_Id);
            ViewBag.Class_Prog_Id        = new SelectList(db.Mstr_Class_Program, "Class_Prog_Id", "Class_Prog_Code", acd_Student.Class_Prog_Id);
            ViewBag.Birth_Country_Id     = new SelectList(db.Mstr_Country, "Country_Id", "Country_Code", acd_Student.Birth_Country_Id);
            ViewBag.Department_Id        = new SelectList(db.Mstr_Department.OrderBy(d => d.Department_Code), "Department_Id", "Department_Code", acd_Student.Department_Id);
            ViewBag.Entry_Period_Id      = new SelectList(db.Mstr_Entry_Period, "Entry_Period_Id", "Entry_Period_Code", acd_Student.Entry_Period_Id);
            ViewBag.Entry_Period_Type_Id = new SelectList(db.Mstr_Entry_Period_Type, "Entry_Period_Type_Id", "Entry_Period_Type_Code", acd_Student.Entry_Period_Type_Id);
            ViewBag.Entry_Year_Id        = new SelectList(db.Mstr_Entry_Year.OrderByDescending(ey => ey.Entry_Year_Id), "Entry_Year_Id", "Entry_Year_Name", acd_Student.Entry_Year_Id);
            ViewBag.Gender_Id            = new SelectList(db.Mstr_Gender, "Gender_Id", "Gender_Type", acd_Student.Gender_Id);
            ViewBag.High_School_Major_Id = new SelectList(db.Mstr_High_School_Major, "High_School_Major_Id", "High_School_Major_Code", acd_Student.High_School_Major_Id);
            ViewBag.Job_Id             = new SelectList(db.Mstr_Job_Category, "Job_Category_Id", "Job_Category_Name", acd_Student.Job_Id);
            ViewBag.Marital_Status_Id  = new SelectList(db.Mstr_Marital_Status, "Marital_Status_Id", "Marital_Status_Code", acd_Student.Marital_Status_Id);
            ViewBag.Register_Status_Id = new SelectList(db.Mstr_Register_Status, "Register_Status_Id", "Register_Status_Name", acd_Student.Register_Status_Id);
            ViewBag.Religion_Id        = new SelectList(db.Mstr_Religion, "Religion_Id", "Religion_Code", acd_Student.Religion_Id);
            ViewBag.Status_Id          = new SelectList(db.Mstr_Status, "Status_Id", "Status_Code", acd_Student.Status_Id);
            ViewBag.Entry_Term_Id      = new SelectList(db.Mstr_Term, "Term_Id", "Term_Code", acd_Student.Entry_Term_Id);
            ViewBag.Register_Id        = new SelectList(db.Reg_Camaru, "Camaru_Id", "Camaru_Code", acd_Student.Register_Id);
            ViewBag.Student_Id         = new SelectList(db.Acd_Yudisium, "Student_Id", "Sk_Num", acd_Student.Student_Id);
            return(View(acd_Student));
        }
Example #3
0
        public ActionResult DeleteConfirmed(long id)
        {
            Acd_Student acd_Student = db.Acd_Student.Find(id);

            db.Acd_Student.Remove(acd_Student);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #4
0
        public ActionResult Edit([Bind(Include = "Student_Id,Nim,Register_Id,Register_Number,Full_Name,First_Title,Last_Title,Gender_Id,Department_Id,Class_Prog_Id,Concentration_Id,Class_Id,Birth_Place,Birth_Date,Birth_Place_Id,Birth_Country_Id,Citizenship_Id,Entry_Period_Id,Entry_Period_Type_Id,Entry_Year_Id,Entry_Term_Id,Register_Status_Id,Religion_Id,Marital_Status_Id,Job_Id,Blood_Id,High_School_Major_Id,Nisn,Nik,Status_Id,Registration_Date,Registration_Officer_Id,Source_Fund_Id,Read_Quran,Transport,Photo_Status,Student_Password,Parent_Password,Hobby_Id,Kebutuhan_Khusus,Kk_Name,Recieve_Kps,Kps_Number,Completion_Date,Out_Date,Phone_Home,Phone_Mobile,Email_Corporate,Email_General,Rfid,Created_By,Created_Date,Modified_By,Modified_Date")] Acd_Student acd_Student, string UrlReferrer)
        {
            if (ModelState.IsValid)
            {
                db.Entry(acd_Student).State = EntityState.Modified;
                try
                {
                    db.SaveChanges();
                }
                //catch (DbEntityValidationException e)
                //{
                //    foreach (var eve in e.EntityValidationErrors)
                //    {
                //        Debug.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:",
                //            eve.Entry.Entity.GetType().Name, eve.Entry.State);
                //        foreach (var ve in eve.ValidationErrors)
                //        {
                //            Debug.WriteLine("- Property: \"{0}\", Error: \"{1}\"",
                //                ve.PropertyName, ve.ErrorMessage);
                //        }
                //    }
                //    throw;
                //}
                catch (DbUpdateException)
                {
                    TempData["shortMessage"] = "Data telah ada.";
                    TempData["UrlReferrer"]  = UrlReferrer;
                    return(RedirectToAction("Edit", new { id = acd_Student.Student_Id }));

                    throw;
                }

                return(Redirect(UrlReferrer));
            }
            //ViewBag.Student_Id = new SelectList(db.Acd_Gpa_TEMP, "Student_Id", "Student_Id", acd_Student.Student_Id);
            //ViewBag.Student_Id = new SelectList(db.Acd_Student_FREE_SKS, "Student_Id", "Description", acd_Student.Student_Id);
            //ViewBag.Blood_Id = new SelectList(db.Mstr_Blood_Type, "Blood_Type_Id", "Blood_Code", acd_Student.Blood_Id);
            //ViewBag.Citizenship_Id = new SelectList(db.Mstr_Citizenship, "Citizenship_Id", "Citizenship_Code", acd_Student.Citizenship_Id);
            //ViewBag.Class_Id = new SelectList(db.Mstr_Class, "Class_Id", "Class_Name", acd_Student.Class_Id);
            ViewBag.Class_Prog_Id = new SelectList(db.Mstr_Department_Class_Program.Where(dcp => dcp.Department_Id == acd_Student.Department_Id), "Class_Prog_Id", "Mstr_Class_Program.Class_Program_Name", acd_Student.Class_Prog_Id);
            //ViewBag.Birth_Country_Id = new SelectList(db.Mstr_Country, "Country_Id", "Country_Code", acd_Student.Birth_Country_Id);
            //ViewBag.Department_Id = new SelectList(db.Mstr_Department, "Department_Id", "Department_Code", acd_Student.Department_Id);
            //ViewBag.Entry_Period_Id = new SelectList(db.Mstr_Entry_Period, "Entry_Period_Id", "Entry_Period_Code", acd_Student.Entry_Period_Id);
            //ViewBag.Entry_Period_Type_Id = new SelectList(db.Mstr_Entry_Period_Type, "Entry_Period_Type_Id", "Entry_Period_Type_Code", acd_Student.Entry_Period_Type_Id);
            //ViewBag.Entry_Year_Id = new SelectList(db.Mstr_Entry_Year, "Entry_Year_Id", "Entry_Year_Name", acd_Student.Entry_Year_Id);
            ViewBag.Gender_Id = new SelectList(db.Mstr_Gender, "Gender_Id", "Gender_Type", acd_Student.Gender_Id);
            //ViewBag.High_School_Major_Id = new SelectList(db.Mstr_High_School_Major, "High_School_Major_Id", "High_School_Major_Code", acd_Student.High_School_Major_Id);
            //ViewBag.Job_Id = new SelectList(db.Mstr_Job_Category, "Job_Category_Id", "Job_Category_Name", acd_Student.Job_Id);
            //ViewBag.Marital_Status_Id = new SelectList(db.Mstr_Marital_Status, "Marital_Status_Id", "Marital_Status_Code", acd_Student.Marital_Status_Id);
            //ViewBag.Register_Status_Id = new SelectList(db.Mstr_Register_Status, "Register_Status_Id", "Register_Status_Name", acd_Student.Register_Status_Id);
            //ViewBag.Religion_Id = new SelectList(db.Mstr_Religion, "Religion_Id", "Religion_Code", acd_Student.Religion_Id);
            //ViewBag.Status_Id = new SelectList(db.Mstr_Status, "Status_Id", "Status_Code", acd_Student.Status_Id);
            //ViewBag.Entry_Term_Id = new SelectList(db.Mstr_Term, "Term_Id", "Term_Code", acd_Student.Entry_Term_Id);
            //ViewBag.Register_Id = new SelectList(db.Reg_Camaru, "Camaru_Id", "Camaru_Code", acd_Student.Register_Id);
            //ViewBag.Student_Id = new SelectList(db.Acd_Yudisium, "Student_Id", "Sk_Num", acd_Student.Student_Id);
            return(View(acd_Student));
        }
        //int proses 3
        public ActionResult BeritaAcaraYudisium(int?Employee_Id, long?Student_Id, DateTime?tglY, string no, string namaJab, short?GraduatePredicateId, bool?IsGraduated)
        {
            if (TempData["shortMessage"] != null)
            {
                ViewBag.message = TempData["shortMessage"].ToString();
            }
            ViewBag.OriUrl = System.Web.HttpContext.Current.Request.Url.AbsolutePath.ToString();

            string DeptFunc = (string)Session["DeptFunc"];

            Emp_Employee emp_Employee = new Emp_Employee();

            if (Employee_Id != null)
            {
                emp_Employee = db.Emp_Employee.Find(Employee_Id);
            }

            long         StudentId    = Convert.ToInt64(TempData["StudentId"] ?? Student_Id);
            Acd_Yudisium acd_Yudisium = db.Acd_Yudisium.Find(StudentId);

            acd_Yudisium.Yudisium_Date = tglY ?? acd_Yudisium.Yudisium_Date;
            acd_Yudisium.Sk_Num        = no ?? acd_Yudisium.Sk_Num;
            if (acd_Yudisium.Department_Functionary == null)
            {
                acd_Yudisium.Department_Functionary = namaJab ?? DeptFunc;
            }
            acd_Yudisium.Department_Functionary_Name = emp_Employee.Full_Name ?? acd_Yudisium.Department_Functionary_Name;
            acd_Yudisium.Department_Functionary_Nik  = emp_Employee.Nik ?? acd_Yudisium.Department_Functionary_Nik;

            //View Data
            var acd_Student = new Acd_Student();

            acd_Student           = db.Acd_Student.Where(s => s.Student_Id == StudentId).FirstOrDefault();
            ViewBag.Nim           = acd_Student.Nim;
            ViewBag.Name          = acd_Student.Full_Name;
            ViewBag.Department_Id = acd_Student.Department_Id;

            //viewbag for dropdown Is_Graduated
            List <SelectListItem> obj = new List <SelectListItem>();

            obj.Add(new SelectListItem {
                Text = "Lulus", Value = "true"
            });
            obj.Add(new SelectListItem {
                Text = "Tidak lulus", Value = "false"
            });
            ViewBag.Is_Graduated = new SelectList(obj, "Value", "Text", IsGraduated ?? acd_Yudisium.Is_Graduated);
            //viewbag for dropdown Graduate_Predicate
            ViewBag.Graduate_Predicate_Id = new SelectList(db.Mstr_Graduate_Predicate, "Graduate_Predicate_Id", "Predicate_Name", GraduatePredicateId ?? acd_Yudisium.Graduate_Predicate_Id);

            return(View(acd_Yudisium));
        }
Example #6
0
        // GET: Student/Details/5
        public ActionResult Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Acd_Student acd_Student = db.Acd_Student.Find(id);

            if (acd_Student == null)
            {
                return(HttpNotFound());
            }
            return(View(acd_Student));
        }
        // GET: Yudisium/Create
        public ActionResult Create(short idDept, short idTermYear, long Student_Id)
        {
            ViewBag.currentTermYear = idTermYear;
            ViewBag.CurrentDept     = idDept;

            //View Data
            var acd_Student = new Acd_Student();

            acd_Student  = db.Acd_Student.Where(s => s.Student_Id == Student_Id).FirstOrDefault();
            ViewBag.Nim  = acd_Student.Nim;
            ViewBag.Name = acd_Student.Full_Name;

            //View Data
            var acd_Thesis = new Acd_Thesis();

            acd_Thesis = db.Acd_Thesis.Where(th => th.Student_Id == Student_Id).FirstOrDefault();
            if (acd_Thesis != null)
            {
                ViewBag.judul         = acd_Thesis.Thesis_Title;
                ViewBag.judul_Eng     = acd_Thesis.Thesis_Title_Eng;
                ViewBag.dosenPemb1    = acd_Thesis.Emp_Employee.Full_Name;
                ViewBag.dosenPemb2    = acd_Thesis.Emp_Employee1.Full_Name;
                ViewBag.tglSeminar    = string.Format("{0:dddd, d MMMM yyyy}", acd_Thesis.Seminar_Date);
                ViewBag.tglPendadaran = string.Format("{0:dddd, d MMMM yyyy}", acd_Thesis.Thesis_Exam_Date);
            }

            //Input Data
            var acd_yudisium   = new Acd_Yudisium();
            var acd_transcript = db.Acd_Transcript.Where(t => t.Student_Id == Student_Id).ToList();

            acd_yudisium.Student_Id   = Student_Id;
            acd_yudisium.Term_Year_Id = idTermYear;
            if (acd_transcript.Count() != 0)
            {
                acd_yudisium.Sks_Total    = Math.Round(Convert.ToDecimal(acd_transcript.Sum(t => t.Sks)), 0);
                acd_yudisium.Course_Count = Convert.ToByte(acd_transcript.Count());
                acd_yudisium.Bnk          = acd_transcript.Sum(t => t.Bnk_Value);
                acd_yudisium.Gpa          = Math.Round(Convert.ToDecimal(acd_yudisium.Bnk / acd_yudisium.Sks_Total), 2);
            }
            acd_yudisium.Application_Date = DateTime.Now;



            //ViewBag.Graduation_Period_Id = new SelectList(db.Acd_Graduation_Period, "Graduation_Period_Id", "Period_Name");
            //ViewBag.Student_Id = new SelectList(db.Acd_Student, "Student_Id", "Nim");
            //ViewBag.Graduate_Predicate_Id = new SelectList(db.Mstr_Graduate_Predicate, "Graduate_Predicate_Id", "Predicate_Name");
            //ViewBag.Term_Year_Id = new SelectList(db.Mstr_Term_Year, "Term_Year_Id", "Term_Year_Name");
            return(View(acd_yudisium));
        }
        // GET: Yudisium/Details/5
        public ActionResult Details(long?id)
        {
            ViewBag.proses = new string[] {
                "Surat Permohonan Yudisium",   //proses 1
                "Surat bebas pinjaman lab",    //proses 2
                "Berita acara yudisium",       //proses 3
                "Pengantar pembayaran wisuda", //proses 4
                "Surat keterangan lulus",      //proses 5
                "Cetak transkrip",             //proses 6
                "Cetak bukti penyerahan TA"    //proses 7
            };

            //View Data
            var acd_Student = new Acd_Student();

            acd_Student  = db.Acd_Student.Where(s => s.Student_Id == id).FirstOrDefault();
            ViewBag.Nim  = acd_Student.Nim;
            ViewBag.Name = acd_Student.Full_Name;

            //View Data
            var acd_Thesis = new Acd_Thesis();

            acd_Thesis = db.Acd_Thesis.Where(th => th.Student_Id == id).FirstOrDefault();
            if (acd_Thesis != null)
            {
                ViewBag.judul         = acd_Thesis.Thesis_Title;
                ViewBag.judul_Eng     = acd_Thesis.Thesis_Title_Eng;
                ViewBag.dosenPemb1    = acd_Thesis.Emp_Employee.Full_Name;
                ViewBag.dosenPemb2    = acd_Thesis.Emp_Employee1.Full_Name;
                ViewBag.tglSeminar    = string.Format("{0:dddd, d MMMM yyyy}", acd_Thesis.Seminar_Date);
                ViewBag.tglPendadaran = string.Format("{0:dddd, d MMMM yyyy}", acd_Thesis.Thesis_Exam_Date);
            }

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Acd_Yudisium acd_Yudisium = db.Acd_Yudisium.Find(id);

            if (acd_Yudisium == null)
            {
                return(HttpNotFound());
            }
            ViewBag.currentTermYear = acd_Yudisium.Term_Year_Id;
            ViewBag.CurrentDept     = acd_Student.Department_Id;

            return(View(acd_Yudisium));
        }
Example #9
0
        // GET: Student/Edit/5
        public ActionResult Edit(long?id)
        {
            string UrlReferrer = null;

            if (TempData["UrlReferrer"] != null)
            {
                UrlReferrer = TempData["UrlReferrer"].ToString();
            }
            ViewBag.UrlReferrer = UrlReferrer ?? System.Web.HttpContext.Current.Request.UrlReferrer.ToString();
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            if (TempData["shortMessage"] != null)
            {
                ViewBag.message = TempData["shortMessage"].ToString();
            }
            Acd_Student acd_Student = db.Acd_Student.Find(id);

            if (acd_Student == null)
            {
                return(HttpNotFound());
            }
            //ViewBag.Student_Id = new SelectList(db.Acd_Gpa_TEMP, "Student_Id", "Student_Id", acd_Student.Student_Id);
            //ViewBag.Student_Id = new SelectList(db.Acd_Student_FREE_SKS, "Student_Id", "Description", acd_Student.Student_Id);
            //ViewBag.Blood_Id = new SelectList(db.Mstr_Blood_Type, "Blood_Type_Id", "Blood_Code", acd_Student.Blood_Id);
            //ViewBag.Citizenship_Id = new SelectList(db.Mstr_Citizenship, "Citizenship_Id", "Citizenship_Code", acd_Student.Citizenship_Id);
            //ViewBag.Class_Id = new SelectList(db.Mstr_Class, "Class_Id", "Class_Name", acd_Student.Class_Id);
            ViewBag.Class_Prog_Id = new SelectList(db.Mstr_Department_Class_Program.Where(dcp => dcp.Department_Id == acd_Student.Department_Id), "Class_Prog_Id", "Mstr_Class_Program.Class_Program_Name", acd_Student.Class_Prog_Id);
            //ViewBag.Birth_Country_Id = new SelectList(db.Mstr_Country, "Country_Id", "Country_Code", acd_Student.Birth_Country_Id);
            //ViewBag.Department_Id = new SelectList(db.Mstr_Department, "Department_Id", "Department_Code", acd_Student.Department_Id);
            //ViewBag.Entry_Period_Id = new SelectList(db.Mstr_Entry_Period, "Entry_Period_Id", "Entry_Period_Code", acd_Student.Entry_Period_Id);
            //ViewBag.Entry_Period_Type_Id = new SelectList(db.Mstr_Entry_Period_Type, "Entry_Period_Type_Id", "Entry_Period_Type_Code", acd_Student.Entry_Period_Type_Id);
            //ViewBag.Entry_Year_Id = new SelectList(db.Mstr_Entry_Year, "Entry_Year_Id", "Entry_Year_Name", acd_Student.Entry_Year_Id);
            ViewBag.Gender_Id = new SelectList(db.Mstr_Gender, "Gender_Id", "Gender_Type", acd_Student.Gender_Id);
            //ViewBag.High_School_Major_Id = new SelectList(db.Mstr_High_School_Major, "High_School_Major_Id", "High_School_Major_Code", acd_Student.High_School_Major_Id);
            //ViewBag.Job_Id = new SelectList(db.Mstr_Job_Category, "Job_Category_Id", "Job_Category_Name", acd_Student.Job_Id);
            //ViewBag.Marital_Status_Id = new SelectList(db.Mstr_Marital_Status, "Marital_Status_Id", "Marital_Status_Code", acd_Student.Marital_Status_Id);
            //ViewBag.Register_Status_Id = new SelectList(db.Mstr_Register_Status, "Register_Status_Id", "Register_Status_Name", acd_Student.Register_Status_Id);
            //ViewBag.Religion_Id = new SelectList(db.Mstr_Religion, "Religion_Id", "Religion_Code", acd_Student.Religion_Id);
            //ViewBag.Status_Id = new SelectList(db.Mstr_Status, "Status_Id", "Status_Code", acd_Student.Status_Id);
            //ViewBag.Entry_Term_Id = new SelectList(db.Mstr_Term, "Term_Id", "Term_Code", acd_Student.Entry_Term_Id);
            //ViewBag.Register_Id = new SelectList(db.Reg_Camaru, "Camaru_Id", "Camaru_Code", acd_Student.Register_Id);
            //ViewBag.Student_Id = new SelectList(db.Acd_Yudisium, "Student_Id", "Sk_Num", acd_Student.Student_Id);
            return(View(acd_Student));
        }
Example #10
0
        public ActionResult Delete(int id)
        {
            Acd_Student_Krs acd_Student_Krs = db.Acd_Student_Krs.Find(id);
            Acd_Student     student         = db.Acd_Student.Find(acd_Student_Krs.Student_Id);
            var             khscount        = db.Acd_Student_Khs.Where(p => p.Krs_Id == acd_Student_Krs.Krs_Id).Count();

            if (khscount > 0)
            {
                ViewBag.NotifMessage = "Data KRS sudah terpakai di KHS.";
                return(View(acd_Student_Krs));
            }
            db.Acd_Student_Krs.Remove(acd_Student_Krs);
            db.SaveChanges();
            return(RedirectToAction("Index", "KRSv2", new
            {
                Student_NIM = student.Nim,
                Term_Year_Id = acd_Student_Krs.Term_Year_Id
            }));
        }
        //int proses 5
        public ActionResult SuratKeteranganLulus(int?Employee_Id, long?Student_Id, DateTime?tglS, string namaJab)
        {
            if (TempData["shortMessage"] != null)
            {
                ViewBag.message = TempData["shortMessage"].ToString();
            }
            ViewBag.OriUrl = System.Web.HttpContext.Current.Request.Url.AbsolutePath.ToString();

            string facFunc = (string)Session["FacFunc"];

            Emp_Employee emp_Employee = new Emp_Employee();

            if (Employee_Id != null)
            {
                emp_Employee = db.Emp_Employee.Find(Employee_Id);
            }

            long         StudentId    = Convert.ToInt64(TempData["StudentId"] ?? Student_Id);
            Acd_Yudisium acd_Yudisium = db.Acd_Yudisium.Find(StudentId);

            acd_Yudisium.Sk_Date = tglS ?? acd_Yudisium.Sk_Date;
            if (acd_Yudisium.Faculty_Functionary == null)
            {
                acd_Yudisium.Faculty_Functionary = namaJab ?? facFunc;
            }
            acd_Yudisium.Faculty_Functionary_Name = emp_Employee.Full_Name ?? acd_Yudisium.Faculty_Functionary_Name;
            acd_Yudisium.Faculty_Functionary_Nik  = emp_Employee.Nik ?? acd_Yudisium.Faculty_Functionary_Nik;

            //View Data
            var acd_Student = new Acd_Student();

            acd_Student           = db.Acd_Student.Where(s => s.Student_Id == StudentId).FirstOrDefault();
            ViewBag.Nim           = acd_Student.Nim;
            ViewBag.Name          = acd_Student.Full_Name;
            ViewBag.Department_Id = acd_Student.Department_Id;

            return(View(acd_Yudisium));
        }
        public ActionResult Edit(Acd_Student acd_Student, string parent_pass, string student_pass)
        {
            if (ModelState.IsValid)
            {
                string err = string.Empty;

                //validasi
                string err1 = cekContentPassword(acd_Student.Student_Password);
                if (err1 != string.Empty)
                {
                    ViewBag.massage_warning_student = err1;
                    return(View(acd_Student));
                }

                string err2 = cekContentPassword(acd_Student.Parent_Password);
                if (err2 != string.Empty)
                {
                    ViewBag.massage_warning_parent = err2;
                    return(View(acd_Student));
                }

                if (string.IsNullOrEmpty(acd_Student.Student_Password))
                {
                    if (string.IsNullOrEmpty(student_pass))
                    {
                        acd_Student.Student_Password = null;
                    }
                    else
                    {
                        acd_Student.Student_Password = student_pass;
                    }
                }
                else
                {
                    acd_Student.Student_Password = MD5Hash(acd_Student.Student_Password);
                }

                if (string.IsNullOrEmpty(acd_Student.Parent_Password))
                {
                    if (string.IsNullOrEmpty(parent_pass))
                    {
                        acd_Student.Parent_Password = null;
                    }
                    else
                    {
                        acd_Student.Parent_Password = parent_pass;
                    }
                }
                else
                {
                    acd_Student.Parent_Password = MD5Hash(acd_Student.Parent_Password);
                }

                try
                {
                    db.Acd_Student.Attach(acd_Student); // attach in the Unchanged state

                    db.Entry(acd_Student).Property(r => r.Student_Password).IsModified = true;
                    db.Entry(acd_Student).Property(r => r.Parent_Password).IsModified  = true;

                    //db.Entry(acd_Student).State = EntityState.Modified;
                    db.SaveChanges();
                }
                catch (Exception ex)
                {
                    err = ex.Message.ToString();
                }
                //catch (DbEntityValidationException e)
                //{
                //    foreach (var eve in e.EntityValidationErrors)
                //    {
                //        Debug.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:",
                //            eve.Entry.Entity.GetType().Name, eve.Entry.State);
                //        foreach (var ve in eve.ValidationErrors)
                //        {
                //            Debug.WriteLine("- Property: \"{0}\", Error: \"{1}\"",
                //                ve.PropertyName, ve.ErrorMessage);
                //        }
                //    }
                //    throw;
                //}

                if (err == string.Empty)
                {
                    TempData["massage_success"] = "Data berhasil diubah";
                }
                else
                {
                    TempData["massage_danger"] = err;
                }

                return(RedirectToAction("Index", new { searchString = acd_Student.Nim }));
            }

            return(View(acd_Student));
        }