public string addNewDept(string code, string name, int contact, int ph, int fax, int head, int col)
        {
            Department dept = new Department();

            dept.Department_Code = code;
            dept.Department_Name = name;
            dept.Contact_Person = contact;
            dept.Phone = ph;
            dept.Fax = fax;
            dept.Department_Head = head;
            dept.CollectionID = col;

            entity.Departments.AddObject(dept);
            entity.SaveChanges();

            string z = "New Dept \"" + code + "\" is added.";
            return z;
        }
        public string UpdateDepartmentInfo(Department updateDeptInfo)
        {
            //Department updateInfo = this.GetDepartmentByCode(updateDeptInfo.Department_Code);

            Department updateInfo = entity.Departments.First(c => c.Department_Code == updateDeptInfo.Department_Code);

            if (updateInfo != null)
            {
                //Debug.WriteLine("DeptBLL update if loop.");
                //updateInfo.Department_Code = updateDeptInfo.Department_Code;
                updateInfo.Department_Name = updateDeptInfo.Department_Name;
                updateInfo.Contact_Person = updateDeptInfo.Contact_Person;
                updateInfo.Phone = updateDeptInfo.Phone;
                updateInfo.Fax = updateDeptInfo.Fax;
                updateInfo.Department_Head = updateDeptInfo.Department_Head;
                updateInfo.CollectionID = updateDeptInfo.CollectionID;
                //updateInfo.CollectionPoint = updateDeptInfo.CollectionPoint;

            }
            this.entity.SaveChanges();
            string s = "Update is successful";
            return s;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the Departments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDepartments(Department department)
 {
     base.AddObject("Departments", department);
 }
 /// <summary>
 /// Create a new Department object.
 /// </summary>
 /// <param name="department_Code">Initial value of the Department_Code property.</param>
 /// <param name="department_Name">Initial value of the Department_Name property.</param>
 /// <param name="contact_Person">Initial value of the Contact_Person property.</param>
 /// <param name="phone">Initial value of the Phone property.</param>
 /// <param name="collectionID">Initial value of the CollectionID property.</param>
 /// <param name="department_Head">Initial value of the Department_Head property.</param>
 public static Department CreateDepartment(global::System.String department_Code, global::System.String department_Name, global::System.Int32 contact_Person, global::System.Int32 phone, global::System.Int32 collectionID, global::System.Int32 department_Head)
 {
     Department department = new Department();
     department.Department_Code = department_Code;
     department.Department_Name = department_Name;
     department.Contact_Person = contact_Person;
     department.Phone = phone;
     department.CollectionID = collectionID;
     department.Department_Head = department_Head;
     return department;
 }