Beispiel #1
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Personnels personnel = personnelManager.Find(x => x.Id == id);

            if (personnel == null)
            {
                return(HttpNotFound());
            }

            return(View(personnel));
        }
Beispiel #2
0
 public ActionResult Index(string username, string password)
 {
     if (username == null || password == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     personnel = personnelManager.Find(x => x.Users.Username == username && x.Users.Password == password);
     if (personnel == null)
     {
         ViewBag.LOGINMESSAGE = "Kullanıcı bulunamadı.";
         return(View());
     }
     else
     {
         Session["user"] = personnel;
         return(RedirectToAction("Dashboard", "Dash"));
     }
 }
Beispiel #3
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Personnels personnels = personnelManager.Find(x => x.Id == id.Value);

            if (personnels == null)
            {
                return(HttpNotFound());
            }
            TaskDegreePositionListCreatOrEdit(personnels);
            return(View(personnels));
        }
Beispiel #4
0
        public ActionResult AddPersonnel(int?PersonnelID, string position, int projectID)
        {
            if (PersonnelID == null || position == null || projectID <= 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Personnels personnels = personnelManager.Find(x => x.Id == PersonnelID);

            if (personnels == null)
            {
                return(HttpNotFound());
            }
            SuppProjectPersonnels suppProjectPersonnels;

            suppProjectPersonnels = suppProjectPersonnelsManager.Find(x => x.Personnels.Id == PersonnelID && x.SuppProjects.ID == projectID);
            if (suppProjectPersonnels != null)
            {
                ViewBag.MESAJ = "Personnel already available";
                return(View(suppProjectPersonnels));
            }
            suppProjectPersonnels              = new SuppProjectPersonnels();
            suppProjectPersonnels.Personnels   = personnels;
            suppProjectPersonnels.Position     = position;
            suppProjectPersonnels.SuppProjectD = projectID;
            var res = supportProjectPersonnelsManager.Insert(suppProjectPersonnels);

            if (res > 0)
            {
                TempData["mesaj"] = "Added";
            }
            else
            {
                ViewBag.MESAJ = "Error. Please check fields.";
                return(View(suppProjectPersonnels));
            }
            return(RedirectToAction("Detail", new { id = projectID }));
        }