Example #1
0
        public static WCFDepartment convertToWCFDepartment(Department d)
        {
            WCFDepartment wcfd = new WCFDepartment();

            wcfd.DepartmentCode      = d.departmentCode;
            wcfd.DepartmentName      = d.departmentName;
            wcfd.ContactName         = d.contactName;
            wcfd.CollectionPointID   = d.collectionPointID;
            wcfd.CollectionPointName = d.Collection_Point.collectionPointName;

            return(wcfd);
        }
        //public List<WCFDisbursement> GetCodeFromName(string name)
        //{
        //    stationeryService.GetAllStationery();

        //}


        //public List<Disbursement> getDisbursementList()
        //{
        //    throw new NotImplementedException();
        //}

        //public List<RequisitionRecord> getRequisitionListByUserID(string UserID)
        //{
        //    throw new NotImplementedException();
        //}

        //public List<RequisitionDetails> getrequisitionDetailsByNO(int requisitionNo)
        //{
        //    throw new NotImplementedException();
        //}

        public WCFDepartment GetDepartment(string departmentCode)
        {
            string deptCode = departmentCode.ToUpper().Trim();

            try
            {
                Department d = departmentService.GetDepartmentByCode(deptCode);
                if (d.departmentCode == deptCode)
                {
                    WCFDepartment WCFD = WCFModelConvertUtility.convertToWCFDepartment(d);
                    return(WCFD);
                }
                else
                {
                    WCFDepartment invalid = new WCFDepartment();
                    return(invalid);
                }
            }
            catch (Exception e)
            {
                WCFDepartment invalid = new WCFDepartment();
                return(invalid);
            }
        }