//
        // /Department/Create/id
        public ActionResult Create(int id,string DepName, string DepShortDescription, string TypeOfBusinessID, int? ContactID,
            string AddressLine1, string AddressLine2, string AddressLine3, string DepFullDescription, string PhoneNumber,
            string PostCode, string Fax, string CityTown, string Email, string County, string WebAddress,
            int CountryID)
        {
            Department newDep = new Department();

            newDep.DepName = DepName;
            newDep.DepShortDescription = DepShortDescription;
            newDep.TypeOfBusiness = TypeOfBusinessID;
            newDep.LeadContactID = ContactID;
            newDep.DepAddr1 = AddressLine1;
            newDep.DepAddr2 = AddressLine2;
            newDep.DepAddr3 = AddressLine3;
            newDep.DepFullDescription = DepFullDescription;
            newDep.DepPhone = PhoneNumber;
            newDep.DepPostCode = PostCode;
            newDep.DepFax = Fax;
            newDep.CityTown = CityTown;
            newDep.DepEmail = Email;
            newDep.County = County;
            newDep.DepWebAddr = WebAddress;
            newDep.CountryID = CountryID;

            newDep.DirID = id;
            newDep.DepIsActive = 1;

            departmentModel.Insert(newDep);
            ViewBag.Alert = "true";
            ViewBag.Message = "Action success!";
            ViewBag.URL = "/Department/Amend/" + newDep.DepID;

            return View("../Shared/Redirect");
            //return RedirectToAction("Amend", "Department", new { id=newDep.DepID});
        }
		private void attach_Departments(Department entity)
		{
			this.SendPropertyChanging();
			entity.Contact = this;
		}
		private void detach_Departments(Department entity)
		{
			this.SendPropertyChanging();
			entity.Contact = null;
		}
 partial void DeleteDepartment(Department instance);
 partial void UpdateDepartment(Department instance);
 partial void InsertDepartment(Department instance);
		private void detach_Departments(Department entity)
		{
			this.SendPropertyChanging();
			entity.Directorate = null;
		}
 //insert
 public void Insert(Department newOrg)
 {
     dataAccess.Departments.InsertOnSubmit(newOrg);
     dataAccess.SubmitChanges();
 }