public DepartmentRep GetRepByRepId(int id)
 {
     var q = (from r in edm.DepartmentReps where r.RepID == id select r);
     DepartmentRep rep = new DepartmentRep();
     rep = q.First<DepartmentRep>();
     return rep;
 }
 public DepartmentRep GetRepsByDeptCode(string code)
 {
     var q = (from r in edm.DepartmentReps where r.Department_Code.Equals(code) select r);
     DepartmentRep rep = new DepartmentRep();
     rep = q.First<DepartmentRep>();
     return rep;
 }
        public void AddDeptRep(int id, string code)
        {
            DepartmentRep rep = new DepartmentRep();

            rep.EmployeeID = id;
            rep.Department_Code = code;
            edm.DepartmentReps.AddObject(rep);
            this.edm.SaveChanges();
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the DepartmentReps EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToDepartmentReps(DepartmentRep departmentRep)
 {
     base.AddObject("DepartmentReps", departmentRep);
 }
 /// <summary>
 /// Create a new DepartmentRep object.
 /// </summary>
 /// <param name="repID">Initial value of the RepID property.</param>
 /// <param name="department_Code">Initial value of the Department_Code property.</param>
 /// <param name="employeeID">Initial value of the EmployeeID property.</param>
 public static DepartmentRep CreateDepartmentRep(global::System.Int32 repID, global::System.String department_Code, global::System.Int32 employeeID)
 {
     DepartmentRep departmentRep = new DepartmentRep();
     departmentRep.RepID = repID;
     departmentRep.Department_Code = department_Code;
     departmentRep.EmployeeID = employeeID;
     return departmentRep;
 }