Example #1
0
        public List <MedicineReportView> GetMedicineMonthlyReport(string medicineView)
        {
            DataTable dataTable = _sqlHelper.GetMedicineMonthlyReport(medicineView);
            List <MedicineReportView> medicinesList = new List <MedicineReportView>();

            for (int index = 0; index < dataTable.Rows.Count; index++)
            {
                MedicineReportView medicine = new MedicineReportView();
                medicine.medicineName     = dataTable.Rows[index]["MedicineName"].ToString();
                medicine.quantityAssigned = (int)dataTable.Rows[index]["QuantityAssigned"];
                medicine.batchNumber      = (string)dataTable.Rows[index]["BatchNumber"];
                medicine.allocationDate   = ((DateTime)(dataTable.Rows[index]["AllocationDate"])).ToString("MMMM dd, yyyy");
                medicine.departmentName   = (dataTable.Rows[index]["DepartmentName"]).ToString();
                medicinesList.Add(medicine);
            }
            return(medicinesList);
        }
Example #2
0
        public List <MedicineReportView> GetMedicineMovingRate(string medicineName)
        {
            DataTable dataTable = _sqlHelper.GetMedicineMovingRate(medicineName);
            List <MedicineReportView> medicineList = new List <MedicineReportView>();

            for (int index = 0; index < dataTable.Rows.Count; index++)
            {
                MedicineReportView medicine = new MedicineReportView();
                //medicine.allocationDate = dataTable.Rows[index]["AllocationDate"].ToString().Split(' ')[0];
                medicine.allocationDate   = dataTable.Rows[index]["AllocationDate"].ToString();
                medicine.departmentName   = dataTable.Rows[index]["DepartmentName"].ToString();
                medicine.quantityAssigned = (int)dataTable.Rows[index]["QuantityAssigned"];
                medicine.medicineName     = medicineName;
                medicineList.Add(medicine);
            }
            return(medicineList);
        }