Ejemplo n.º 1
0
        private PatientModel TransformPatientDataByPatientID(DataTable dataTable)
        {
            PatientModel obj = new PatientModel();

            if (dataTable.Rows.Count > 0)
            {
                obj.PatientID             = Convert.ToInt64(dataTable.Rows[0]["PatientID"]);
                obj.FullName              = Convert.ToString(dataTable.Rows[0]["Name"]);
                obj.Address               = Convert.ToString(dataTable.Rows[0]["address"]);
                obj.Gender                = Convert.ToInt32(dataTable.Rows[0]["Gender"]);
                obj.GenderStr             = (obj.Gender == 1) ? "Male" : "Female";
                obj.DOBStr                = Convert.ToString(dataTable.Rows[0]["DOB"]);
                obj.BloodGroup            = Convert.ToString(dataTable.Rows[0]["BloodGroup"]);
                obj.age                   = Convert.ToInt32(dataTable.Rows[0]["Age"]);
                obj.MobileNumber          = Convert.ToString(dataTable.Rows[0]["MobileNumber"]);
                obj.MedicationName        = Convert.ToString(dataTable.Rows[0]["MedicationName"]);
                obj.MedicationDescription = Convert.ToString(dataTable.Rows[0]["MedicationDescription"]);
            }
            return(obj);
        }
Ejemplo n.º 2
0
        private List <PatientModel> TransformPatientProfileData(DataTable dataTable)
        {
            List <PatientModel> patientList = new List <PatientModel>();

            if (dataTable.Rows.Count > 0)
            {
                foreach (var item in dataTable.AsEnumerable())
                {
                    PatientModel obj = new PatientModel();
                    obj.PatientID    = Convert.ToInt64(item["PatientID"]);
                    obj.FullName     = Convert.ToString(item["Name"]);
                    obj.Address      = Convert.ToString(item["address"]);
                    obj.Gender       = Convert.ToInt32(item["Gender"]);
                    obj.GenderStr    = (obj.Gender == 1) ? "Male" : "Female";
                    obj.DOBStr       = Convert.ToString(item["DOB"]);
                    obj.BloodGroup   = Convert.ToString(item["BloodGroup"]);
                    obj.age          = Convert.ToInt32(item["Age"]);
                    obj.MobileNumber = Convert.ToString(item["MobileNumber"]);
                    patientList.Add(obj);
                }
            }
            return(patientList);
        }
Ejemplo n.º 3
0
        public List <PatientModel> TransformPatientData(DataTable data)
        {
            List <PatientModel> patientList = new List <PatientModel>();

            if (data.Rows.Count > 0)
            {
                foreach (var item in data.AsEnumerable())
                {
                    PatientModel obj = new PatientModel();
                    obj.PatientID    = Convert.ToInt64(item["NUMBER"]);
                    obj.FullName     = Convert.ToString(item["Name"]);
                    obj.TimeSpentstr = Convert.ToString(item["TimeSpent"]);
                    obj.Gender       = Convert.ToInt32(item["Gender"]);
                    obj.GenderStr    = (obj.Gender == 1) ? "Male" : "Female";
                    obj.DOBStr       = Convert.ToString(item["DOB"]);
                    obj.BloodGroup   = Convert.ToString(item["BloodGroup"]);
                    obj.age          = Convert.ToInt32(item["Age"]);
                    obj.TotalCount   = Convert.ToInt16(item["TotalCount"]);
                    patientList.Add(obj);
                }
            }
            return(patientList);
        }