コード例 #1
0
        //
        // /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});
        }
コード例 #2
0
		private void attach_Departments(Department entity)
		{
			this.SendPropertyChanging();
			entity.Contact = this;
		}
コード例 #3
0
		private void detach_Departments(Department entity)
		{
			this.SendPropertyChanging();
			entity.Contact = null;
		}
コード例 #4
0
 partial void DeleteDepartment(Department instance);
コード例 #5
0
 partial void UpdateDepartment(Department instance);
コード例 #6
0
 partial void InsertDepartment(Department instance);
コード例 #7
0
		private void detach_Departments(Department entity)
		{
			this.SendPropertyChanging();
			entity.Directorate = null;
		}
コード例 #8
0
 //insert
 public void Insert(Department newOrg)
 {
     dataAccess.Departments.InsertOnSubmit(newOrg);
     dataAccess.SubmitChanges();
 }