public ActionResult Create(Specialties Specialy)
        {
            if (ModelState.IsValid)
            {
                db.Specialties.Add(Specialy);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
示例#2
0
        public ActionResult Create(Company Company)
        {
            if (ModelState.IsValid)
            {
                db.Company.Add(Company);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
        public ActionResult Create(Service Service)
        {
            if (ModelState.IsValid)
            {
                db.Service.Add(Service);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
示例#4
0
        public ActionResult Create(Testimonials Test, HttpPostedFileBase file)
        {
            if (ModelState.IsValid)
            {
                if (file != null)
                {
                    string fileName = DateTime.Now.ToString("yyyyMMddHHssmmffff") + file.FileName;
                    file.SaveAs(Server.MapPath("~/Content/SiteImages/") + fileName);
                    Test.Photo = fileName;
                }

                db.Testimonials.Add(Test);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
示例#5
0
 public void AddDepatment(Depatment dep)
 {
     _db.Depatment.Add(dep);
     _db.SaveChanges();
 }
示例#6
0
 public void AddEmployee(Employee empl)
 {
     _db.Employee.Add(empl);
     _db.SaveChanges();
 }
示例#7
0
 public void AddTypeOfPosition(TypeOfPosition top)
 {
     _db.TypeOfPosition.Add(top);
     _db.SaveChanges();
 }
 public int Save()
 {
     return(companyDB.SaveChanges());
 }
示例#9
0
 public void AddPosition(Position pos)
 {
     _db.Position.Add(pos);
     _db.SaveChanges();
 }