public ActionResult DeleteConfirmed(int id)
        {
            Masterdata masterdata = db.Masterdatas.Find(id);

            db.Masterdatas.Remove(masterdata);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public static void RemoveSymbolLibrary(Project project, string symbolLibraryNameWithExtesion)
        {
            Masterdata       masterdata         = new Masterdata();
            StringCollection newMasterdatas     = new StringCollection();
            StringCollection projectMasterdatas = masterdata.get_ProjectEntries(project);

            if (projectMasterdatas.Contains(symbolLibraryNameWithExtesion))
            {
                newMasterdatas.Remove(symbolLibraryNameWithExtesion);
            }
        }
 /// <summary>
 /// Add masterdata from system to project
 /// </summary>
 /// <param name="project"></param>
 /// <param name="symbolLibraryNameWithExtesion">Filename with extension (without path)</param>
 public static void AddSymbolLibrary(Project project, string symbolLibraryNameWithExtesion)
 {
    Masterdata masterdata = new Masterdata();
    StringCollection newMasterdatas = new StringCollection();
    StringCollection projectMasterdatas = masterdata.get_ProjectEntries(project);
    if (!projectMasterdatas.Contains(symbolLibraryNameWithExtesion))
    {
       Masterdata md = new Masterdata();
       newMasterdatas.Add(symbolLibraryNameWithExtesion);
    }
 }
 /// <summary>
 /// Add masterdata from system to project
 /// </summary>
 /// <param name="project"></param>
 /// <param name="masterdataName">Full file name</param>
 public static void AddMasterdataToProject(Project project, string masterdataName)
 {
    Masterdata masterdata = new Masterdata();
    StringCollection newMasterdatas = new StringCollection();
    StringCollection projectMasterdatas = masterdata.get_ProjectEntries(project);
    if (!projectMasterdatas.Contains(masterdataName))
    {
       newMasterdatas.Add(masterdataName);
       masterdata.AddToProjectEx(project, newMasterdatas);
    }
 }
        /// <summary>
        /// Add masterdata from system to project
        /// </summary>
        /// <param name="project"></param>
        /// <param name="masterdataName">Full file name</param>
        public static void AddMasterdataToProject(Project project, string masterdataName)
        {
            Masterdata       masterdata         = new Masterdata();
            StringCollection newMasterdatas     = new StringCollection();
            StringCollection projectMasterdatas = masterdata.get_ProjectEntries(project);

            if (!projectMasterdatas.Contains(masterdataName))
            {
                newMasterdatas.Add(masterdataName);
                masterdata.AddToProjectEx(project, newMasterdatas);
            }
        }
        /// <summary>
        /// Add masterdata from system to project
        /// </summary>
        /// <param name="project"></param>
        /// <param name="symbolLibraryNameWithExtesion">Filename with extension (without path)</param>
        public static void AddSymbolLibrary(Project project, string symbolLibraryNameWithExtesion)
        {
            Masterdata       masterdata         = new Masterdata();
            StringCollection newMasterdatas     = new StringCollection();
            StringCollection projectMasterdatas = masterdata.get_ProjectEntries(project);

            if (!projectMasterdatas.Contains(symbolLibraryNameWithExtesion))
            {
                Masterdata md = new Masterdata();
                newMasterdatas.Add(symbolLibraryNameWithExtesion);
                md.AddToProjectEx(project, newMasterdatas);
            }
        }
        // GET: Masterdatas/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Masterdata masterdata = db.Masterdatas.Find(id);

            if (masterdata == null)
            {
                return(HttpNotFound());
            }
            return(View(masterdata));
        }
 public ActionResult Edit([Bind(Include = "MasterdataID,MahasiswaID,FalkutasID,JurusanID,MatakuliahID")] Masterdata masterdata)
 {
     if (ModelState.IsValid)
     {
         db.Entry(masterdata).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FalkutasID   = new SelectList(db.Falkutas, "FalkutasID", "Nama_falkutas", masterdata.FalkutasID);
     ViewBag.JurusanID    = new SelectList(db.Jurusans, "JurusanID", "Nama_jurusan", masterdata.JurusanID);
     ViewBag.MahasiswaID  = new SelectList(db.Mahasiswas, "MahasiswaID", "Nama_mhs", masterdata.MahasiswaID);
     ViewBag.MatakuliahID = new SelectList(db.Matakuliahs, "MatakuliahID", "Nama_matakuliah", masterdata.MatakuliahID);
     return(View(masterdata));
 }
        // GET: Masterdatas/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Masterdata masterdata = db.Masterdatas.Find(id);

            if (masterdata == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FalkutasID   = new SelectList(db.Falkutas, "FalkutasID", "Nama_falkutas", masterdata.FalkutasID);
            ViewBag.JurusanID    = new SelectList(db.Jurusans, "JurusanID", "Nama_jurusan", masterdata.JurusanID);
            ViewBag.MahasiswaID  = new SelectList(db.Mahasiswas, "MahasiswaID", "Nama_mhs", masterdata.MahasiswaID);
            ViewBag.MatakuliahID = new SelectList(db.Matakuliahs, "MatakuliahID", "Nama_matakuliah", masterdata.MatakuliahID);
            return(View(masterdata));
        }