Esempio n. 1
0
        public Department getDepartment(string departmentId)
        {
            Department part = new Department();
            var depart = ctx.departments.FirstOrDefault(x => x.departmentId == departmentId);
            string pointName = depart.collectionPoint.address;

            part.CollectionPointId = depart.collectionPointId;
            part.CollectionPointName = pointName;
            part.DepartmentId = depart.departmentId;
            part.DepartmentName = depart.name;
            part.ContactNo = depart.contactName;
            part.PhoneNo = (long)depart.phoneNo;
            part.FaxNo = (long)depart.faxNo;

            return part;
        }
Esempio n. 2
0
 //department-------------------------------------------
 public void updateDepartmentCollectionPoint(Department department)
 {
     departmentgf.updateDepartmentCollectionGF(department);
 }
Esempio n. 3
0
 public void updateDepartmentCollectionGF(Department dept)
 {
     department d = ctx.departments.FirstOrDefault( o => o.departmentId == dept.DepartmentId);
     d.collectionPointId = dept.CollectionPointId;
     ctx.SaveChanges();
 }
Esempio n. 4
0
        public List<Department> getDepartments()
        {
            List<Department> departmentCollection = new List<Department>();

            try
            {
                var depC = from u in ctx.users
                           where
                             u.role.name == "departmentRepresentative" &&
                             u.departmentId!="IVS" &&
                             u.status == "Active"
                           select new
                           {
                               depId = u.department.departmentId,
                               collPointId = u.department.collectionPoint.collectionPointId,
                               collPoint = u.department.collectionPoint.address,
                               repName = u.name,
                               depName = u.department.name
                           };

                foreach(var d in depC)
                {
                    Department department = new Department();
                    department.DepartmentId = d.depId;
                    department.CollectionPointId = d.collPointId;
                    department.CollectionPointName = d.collPoint;
                    department.RepresentativeName = d.repName;
                    department.DepartmentName = d.depName;
                    departmentCollection.Add(department);
                }

            }
            catch (Exception exception)
            {
                errorobj.WriteErrorLog("DepartmentFacade-getDepartments():::" + exception.ToString());
                departmentCollection = new List<Department>();
            }

            return departmentCollection;
        }