Exemple #1
0
        public Department[] getDepartment()
        {
            DisbursementServie dis = new DisbursementServie();
            var department = dis.selectDisbursementDepartment();
            Department[] dep = new Department[department.Count];

            int count = 0;
            foreach (object o in department)
            {
                Department d = new Department();
                 Type t = o.GetType();
                PropertyInfo departmentID = t.GetProperty("DisbDepID");
                PropertyInfo depName = t.GetProperty("DepName");

                d.DepartmentID =Convert.ToString(departmentID.GetValue(o,null));
                d.DepartmentName = Convert.ToString(depName.GetValue(o, null));
                dep.SetValue(d, count);
                count++;

            }
            return dep;
        }
Exemple #2
0
        public DisbursementByDepartment[] getDisbursement(String depID)
        {
            DisbursementServie disService = new DisbursementServie();
            var disDetail = disService.selectDisbursementByDepartment(Convert.ToInt32(depID));
            DisbursementByDepartment[] dis_Detail = new DisbursementByDepartment[disDetail.Count];
            int count = 0;

            foreach (var obj in disDetail)
            {
                DisbursementByDepartment d = new DisbursementByDepartment();
                Type t = obj.GetType();
                PropertyInfo itemID = t.GetProperty("ItemID");
                PropertyInfo itemDesp = t.GetProperty("ItemDescription");
                PropertyInfo itemQuant = t.GetProperty("Quantity");
                PropertyInfo department = t.GetProperty("Department");

                d.ItemID = Convert.ToString(itemID.GetValue(obj, null));
                d.ItemDescription = Convert.ToString(itemDesp.GetValue(obj, null));
                d.ItemQuantity = Convert.ToString(itemQuant.GetValue(obj, null));
                d.DepartmentName = Convert.ToString(department.GetValue(obj, null));

                dis_Detail.SetValue(d, count);
                count++;

            }
            return dis_Detail;
        }
Exemple #3
0
        public CollectionPoint[] getCollectionPoint()
        {
            DisbursementServie dss = new DisbursementServie();
            List<collectionPoint> col = dss.selectAllCollectionPoint();
            CollectionPoint[] colpoint = new CollectionPoint[col.Count];

            int count = 0;
            foreach (ADSMS.DataAccess.collectionPoint o in col)
            {
                CollectionPoint c = new CollectionPoint();
                c.CollectionPointID = Convert.ToString(o.CollectionPointID);
                c.CollectionPointName = o.CollectionPointName;
                c.CollectionPointDate = o.CollectionPointDate;
                c.CollectionPointTime = o.CollectionPointTime;
                c.CollectionPointAddress = o.CollectionPointAddress;

                colpoint.SetValue(c, count);
                count++;
            }

            return colpoint;
        }