コード例 #1
0
        public async Task <ActionResult> AddTask(DashBoardModel recivedModel)
        {
            //Post new tasks to the database
            if (recivedModel != null)
            {
                recivedModel.m_Task.ProjectID = Convert.ToInt16(recivedModel.m_CurrentProjectID);
                db.DashBoardData.Add(recivedModel.m_Task);
                await db.SaveChangesAsync();

                UpdateClientState();
                if (User.Identity.GetUserName() == "Admin")
                {
                    return(RedirectToAction("AdminIndex", new { ProjectID = recivedModel.m_CurrentProjectID }));
                }
                return(RedirectToAction("Index", new { ProjectID = recivedModel.m_CurrentProjectID }));
            }
            return(RedirectToAction("ErrorPage", "Home", new { msg = "خطأ في الوصول إلى الشبكة" }));
        }
コード例 #2
0
        public async Task <ActionResult> AddNewProject(HomeModel recivedModel)
        {
            if (recivedModel.m_NewProject != null)
            {
                NozomDashBoardEntities db = new NozomDashBoardEntities();
                db.Project.Add(recivedModel.m_NewProject);
                await db.SaveChangesAsync();

                return(RedirectToAction("ProjectSelection"));
            }
            else
            {
                return(RedirectToAction("ErrorPage", new { msg = "خطأ في الوصول إلى الشبكة" }));
            }
        }