Exemple #1
0
 public ActionResult Registration([Bind(Include = "ID,Username,Email,Password,Role")] Developer developer)
 {
     if (ModelState.IsValid)
     {
         db.Developers.Add(developer);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(developer));
 }
Exemple #2
0
        public ActionResult Create([Bind(Include = "ID,DeveleperID,Title,Description,Category,Status")] Project project)
        {
            if (ModelState.IsValid)
            {
                db.Projects.Add(project);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.DeveleperID = new SelectList(db.Developers, "ID", "Username", project.DeveleperID);
            return(View(project));
        }
Exemple #3
0
        public void Seed()
        {
            if (context.Database.CanConnect())
            {
                if (!context.Companies.Any())
                {
                    var companies = CreatComapny();

                    context.Companies.AddRange(companies);
                    context.SaveChanges();
                }
            }
        }
 public int Commit()
 {
     try
     {
         var returnValue = dbcontext.SaveChanges();
         if (dbTransaction != null)
         {
             dbTransaction.Commit();
         }
         return(returnValue);
     }
     catch (Exception ex)
     {
         if (dbTransaction != null)
         {
             this.dbTransaction.Rollback();
         }
         throw;
     }
     finally
     {
         this.Dispose();
     }
 }
 public void AddUserProject(UserProject userProject)
 {
     context.UserProjects.Add(userProject);
     context.SaveChanges();
 }
 public void CreateUser(User user)
 {
     context.Users.Add(user);
     context.SaveChanges();
 }
 public string AddUser(Users user)
 {
     _db.Users.Add(user);
     _db.SaveChanges();
     return("User Added Successfully");
 }
 public void CreateCompany(Company company)
 {
     context.Companies.Add(company);
     context.SaveChanges();
 }
Exemple #9
0
 public void CreateTeam(Team team)
 {
     context.Teams.Add(team);
     context.SaveChanges();
 }
 public void CreateProject(Project project)
 {
     context.Projects.Add(project);
     context.SaveChanges();
 }