Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <Entities.ClientAddress> GetAllClientAddressessByClientId(Int32 clientId)
        {
            var clientAddresses = new List <Entities.ClientAddress>();

            DbCommand dbCommand = null;

            try
            {
                using (dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetAllClientAddressByClientId))
                {
                    database.AddInParameter(dbCommand, "@client_id", DbType.Int32, clientId);

                    using (IDataReader reader = database.ExecuteReader(dbCommand))
                    {
                        while (reader.Read())
                        {
                            //var customerAndTransporterMapping = new CustomerAndTransporterMapping();

                            var clientAddress = new Entities.ClientAddress
                            {
                                ClientId          = DRE.GetNullableInt32(reader, "client_id", 0),
                                ClientName        = DRE.GetNullableString(reader, "client_name", null),
                                ClientTypeId      = DRE.GetNullableInt32(reader, "client_type_id", null),
                                ClientType        = DRE.GetNullableString(reader, "client_type", null),
                                AddressTypeId     = DRE.GetNullableInt32(reader, "address_type_id", 0),
                                AddressType       = DRE.GetNullableString(reader, "address_type", null),
                                ClientAddressCode = DRE.GetNullableString(reader, "client_address_code", null),
                                ClientAddressId   = DRE.GetNullableInt32(reader, "client_address_id", 0),
                                ClientAddressName = DRE.GetNullableString(reader, "client_address_name", null),
                                Address           = DRE.GetNullableString(reader, "address", null),
                                CountryId         = DRE.GetNullableInt32(reader, "country_id", null),
                                CountryName       = DRE.GetNullableString(reader, "country_name", null),
                                StateId           = DRE.GetNullableInt32(reader, "state_id", 0),
                                StateName         = DRE.GetNullableString(reader, "state_name", null),
                                CityId            = DRE.GetNullableInt32(reader, "city_id", 0),
                                CityName          = DRE.GetNullableString(reader, "city_name", null),
                                Area       = DRE.GetNullableString(reader, "area", null),
                                EmailId    = DRE.GetNullableString(reader, "email_id", null),
                                ContactNos = DRE.GetNullableString(reader, "contact_nos", null),
                                GSTNo      = DRE.GetNullableString(reader, "gst_no", null),
                                SrNo       = DRE.GetNullableInt64(reader, "sr_no", null)
                                             //CustomerAndTransporterMapping = customerAndTransporterMapping.GetTransportersListByCustomerAddressId(DRE.GetInt32(reader, "client_address_id"))
                            };

                            clientAddresses.Add(clientAddress);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dbCommand = null;
            }

            return(clientAddresses);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <Entities.Brand> GetAllBrands()
        {
            var brands = new List <Entities.Brand>();

            try
            {
                using (DbCommand dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetListOfAllBrands))
                {
                    using (IDataReader reader = database.ExecuteReader(dbCommand))
                    {
                        while (reader.Read())
                        {
                            var brand = new Entities.Brand
                            {
                                BrandId   = DRE.GetNullableInt32(reader, "brand_id", 0),
                                BrandName = DRE.GetNullableString(reader, "brand_name", null),
                                guid      = DRE.GetNullableGuid(reader, "row_guid", null),
                                SrNo      = DRE.GetNullableInt64(reader, "sr_no", null)
                            };

                            brands.Add(brand);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(brands);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="patientId"></param>
        /// <returns></returns>
        public List <Entities.PatientExerciseHistory> GetPatientExerciseHistoriesByPatientId(Int32 patientId)
        {
            List <Entities.PatientExerciseHistory> patientExercisesHistory = new List <Entities.PatientExerciseHistory>();

            try
            {
                using (DbCommand dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetPatientExerciseDetailsByPatientId))
                {
                    database.AddInParameter(dbCommand, "@patient_id", DbType.Int32, patientId);

                    using (IDataReader reader = database.ExecuteReader(dbCommand))
                    {
                        while (reader.Read())
                        {
                            Entities.PatientExerciseHistory patientExerciseHistory = new Entities.PatientExerciseHistory()
                            {
                                PatientExerciseHistoryId = DRE.GetNullableInt32(reader, "patient_exercise_history_id", 0),
                                PatientId    = DRE.GetNullableInt32(reader, "patient_id", 0),
                                ExerciseName = DRE.GetNullableString(reader, "exercise_name", null),
                                Frequency    = DRE.GetNullableString(reader, "frequency", null),
                                SrNo         = DRE.GetNullableInt64(reader, "sr_no", null)
                            };

                            patientExercisesHistory.Add(patientExerciseHistory);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(patientExercisesHistory);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <Entities.ClientAddress> GetAllClientAddressess()
        {
            var clientAddresses = new List <Entities.ClientAddress>();

            DbCommand dbCommand = null;

            try
            {
                using (dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetAllClientAddressess))
                {
                    using (IDataReader reader = database.ExecuteReader(dbCommand))
                    {
                        while (reader.Read())
                        {
                            var clientAddress = new Entities.ClientAddress
                            {
                                ClientId          = DRE.GetNullableInt32(reader, "client_id", 0),
                                ClientName        = DRE.GetNullableString(reader, "client_name", null),
                                ClientTypeId      = DRE.GetNullableInt32(reader, "client_type_id", null),
                                ClientType        = DRE.GetNullableString(reader, "client_type", null),
                                AddressTypeId     = DRE.GetNullableInt32(reader, "address_type_id", 0),
                                AddressType       = DRE.GetNullableString(reader, "address_type", null),
                                ClientAddressCode = DRE.GetNullableString(reader, "client_address_code", null),
                                ClientAddressId   = DRE.GetNullableInt32(reader, "client_address_id", 0),
                                ClientAddressName = DRE.GetNullableString(reader, "client_address_name", null),
                                Address           = DRE.GetNullableString(reader, "address", null),
                                CountryId         = DRE.GetNullableInt32(reader, "country_id", null),
                                CountryName       = DRE.GetNullableString(reader, "country_name", null),
                                StateId           = DRE.GetNullableInt32(reader, "state_id", 0),
                                StateName         = DRE.GetNullableString(reader, "state_name", null),
                                CityId            = DRE.GetNullableInt32(reader, "city_id", 0),
                                CityName          = DRE.GetNullableString(reader, "city_name", null),
                                Area       = DRE.GetNullableString(reader, "area", null),
                                EmailId    = DRE.GetNullableString(reader, "email_id", null),
                                ContactNos = DRE.GetNullableString(reader, "contact_nos", null),
                                GSTNo      = DRE.GetNullableString(reader, "gst_no", null),
                                SrNo       = DRE.GetNullableInt64(reader, "sr_no", null)
                            };

                            clientAddresses.Add(clientAddress);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dbCommand = null;
            }

            return(clientAddresses);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="clientAddressId"></param>
        /// <returns></returns>
        public Entities.ClientAddress GetClientAddressById(Int32 clientAddressId)
        {
            var clientAddress = new Entities.ClientAddress();

            DbCommand dbCommand = null;

            using (dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetClientAddressById))
            {
                database.AddInParameter(dbCommand, "@client_address_id", DbType.Int32, clientAddressId);

                using (IDataReader reader = database.ExecuteReader(dbCommand))
                {
                    while (reader.Read())
                    {
                        var _clientAddress = new Entities.ClientAddress
                        {
                            ClientTypeId      = DRE.GetNullableInt32(reader, "client_type_id", null),
                            ClientType        = DRE.GetNullableString(reader, "client_type", null),
                            ClientId          = DRE.GetNullableInt32(reader, "client_id", 0),
                            ClientName        = DRE.GetNullableString(reader, "client_name", null),
                            ClientAddressCode = DRE.GetNullableString(reader, "client_address_code", null),
                            AddressTypeId     = DRE.GetNullableInt32(reader, "address_type_id", 0),
                            AddressType       = DRE.GetNullableString(reader, "address_type", null),
                            ClientAddressId   = DRE.GetNullableInt32(reader, "client_address_id", 0),
                            ClientAddressName = DRE.GetNullableString(reader, "client_address_name", null),
                            Address           = DRE.GetNullableString(reader, "address", null),
                            CountryId         = DRE.GetNullableInt32(reader, "country_id", null),
                            CountryName       = DRE.GetNullableString(reader, "country_name", null),
                            StateId           = DRE.GetNullableInt32(reader, "state_id", 0),
                            StateName         = DRE.GetNullableString(reader, "state_name", null),
                            CityId            = DRE.GetNullableInt32(reader, "city_id", 0),
                            CityName          = DRE.GetNullableString(reader, "city_name", null),
                            Area       = DRE.GetNullableString(reader, "area", null),
                            EmailId    = DRE.GetNullableString(reader, "email_id", null),
                            ContactNos = DRE.GetNullableString(reader, "contact_nos", null),
                            GSTNo      = DRE.GetNullableString(reader, "gst_no", null),
                            SrNo       = DRE.GetNullableInt64(reader, "sr_no", null)
                        };

                        clientAddress = _clientAddress;
                    }
                }
            }

            return(clientAddress);
        }
Ejemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <Entities.Client> GetAllClients()
        {
            var clients = new List <Entities.Client>();

            DbCommand dbCommand = null;

            try
            {
                using (dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetAllClients))
                {
                    using (IDataReader reader = database.ExecuteReader(dbCommand))
                    {
                        while (reader.Read())
                        {
                            ClientAddress clientAddress = new ClientAddress();

                            var client = new Entities.Client
                            {
                                ClientTypeId     = DRE.GetNullableInt32(reader, "client_type_id", 0),
                                ClientTypeName   = DRE.GetNullableString(reader, "client_type", null),
                                ClientId         = DRE.GetNullableInt32(reader, "client_id", 0),
                                ClientCode       = DRE.GetNullableString(reader, "client_code", null),
                                ClientName       = DRE.GetNullableString(reader, "client_name", null),
                                PANNo            = DRE.GetNullableString(reader, "pan_no", null),
                                SrNo             = DRE.GetNullableInt64(reader, "sr_no", null),
                                ClientAddressess = clientAddress.GetAllClientAddressessByClientId(DRE.GetInt32(reader, "client_id"))
                            };

                            clients.Add(client);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dbCommand = null;
            }

            return(clients);
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <Entities.MedicalTestParameters> GetMedicalTestParameterDetailsByTestId(Int32 medicalTestId)
        {
            var medicalTestParameters = new List <Entities.MedicalTestParameters>();

            try
            {
                using (DbCommand dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetMedicalTestParametersByTestId))
                {
                    database.AddInParameter(dbCommand, "@medical_test_id", DbType.Int32, medicalTestId);

                    using (IDataReader reader = database.ExecuteReader(dbCommand))
                    {
                        while (reader.Read())
                        {
                            var medicalTestParameter = new Entities.MedicalTestParameters()
                            {
                                MedicalTestParameterId = DRE.GetNullableInt32(reader, "medical_test_parameter_id", null),
                                MedicalTestId          = DRE.GetNullableInt32(reader, "medical_test_id", 0),
                                TestParameterName      = DRE.GetNullableString(reader, "test_parameter_name", null),
                                TestParameterDesc      = DRE.GetNullableString(reader, "test_parameter_desc", null),
                                TestParameterSequence  = DRE.GetNullableDecimal(reader, "test_parameter_sequence", null),
                                MinimumValue           = DRE.GetNullableDecimal(reader, "minimum_value", null),
                                MaximumValue           = DRE.GetNullableDecimal(reader, "maximum_value", null),
                                NormalValue            = DRE.GetNullableDecimal(reader, "normal_value", null),
                                UnitOfMeasurementId    = DRE.GetNullableInt32(reader, "unit_of_measurement_id", null),
                                UnitCode = DRE.GetNullableString(reader, "unit_code", null),
                                SrNo     = DRE.GetNullableInt64(reader, "sr_no", null)
                            };

                            medicalTestParameters.Add(medicalTestParameter);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(medicalTestParameters);
        }
Ejemplo n.º 8
0
        public List <Entities.City> GetCitiesByState(Int32 stateId)
        {
            var cities = new List <Entities.City>();

            DbCommand dbCommand = null;

            try
            {
                using (dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetListofCitiesByState))
                {
                    database.AddInParameter(dbCommand, "@state_id", DbType.Int32, stateId);

                    using (IDataReader reader = database.ExecuteReader(dbCommand))
                    {
                        while (reader.Read())
                        {
                            var city = new Entities.City
                            {
                                CityId   = DRE.GetNullableInt32(reader, "city_id", 0),
                                CityName = DRE.GetNullableString(reader, "city_name", null),
                                SrNo     = DRE.GetNullableInt64(reader, "sr_no", null)
                            };

                            cities.Add(city);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dbCommand = null;
            }

            return(cities);
        }
Ejemplo n.º 9
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <Entities.WorkingPeriod> GetAllWorkingPeriods()
        {
            var workingPeriods = new List <Entities.WorkingPeriod>();

            DbCommand dbCommand = null;

            try
            {
                using (dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetAllWorkingPeriods))
                {
                    using (IDataReader reader = database.ExecuteReader(dbCommand))
                    {
                        while (reader.Read())
                        {
                            var workingPeriod = new Entities.WorkingPeriod
                            {
                                WorkingPeriodId = DRE.GetNullableInt32(reader, "working_period_id", 0),
                                StartDate       = DRE.GetNullableString(reader, "start_date", null),
                                EndDate         = DRE.GetNullableString(reader, "end_date", null),
                                FinancialYear   = DRE.GetNullableString(reader, "financial_year", null),
                                SrNo            = DRE.GetNullableInt64(reader, "sr_no", null)
                            };

                            workingPeriods.Add(workingPeriod);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dbCommand = null;
            }

            return(workingPeriods);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// /
        /// </summary>
        /// <returns></returns>
        public List <Entities.Pettycash> GetAllPettyCashDocno()
        {
            var Pettys = new List <Entities.Pettycash>();

            try
            {
                using (DbCommand dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetListOfAllPettycase))
                {
                    using (IDataReader reader = database.ExecuteReader(dbCommand))
                    {
                        while (reader.Read())
                        {
                            var Petty = new Entities.Pettycash
                            {
                                PettycaseId = DRE.GetNullableInt32(reader, "pettycase_id", 0),
                                DocNo       = DRE.GetNullableString(reader, "docno", null),
                                EntryDate   = DRE.GetNullableString(reader, "Date", null),
                                DateRange   = DRE.GetNullableString(reader, "daterange", null),
                                AccountHead = DRE.GetNullableString(reader, "account_head_name", null),
                                Supplier    = DRE.GetNullableString(reader, "nameofsupplier", null),
                                VoucherNo   = DRE.GetNullableString(reader, "voucherno", null),
                                Amount      = DRE.GetNullableDecimal(reader, "Amount", 0),
                                guid        = DRE.GetNullableGuid(reader, "row_guid", null),
                                SrNo        = DRE.GetNullableInt64(reader, "sr_no", null)
                            };

                            Pettys.Add(Petty);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Pettys);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Gets a list of all roles
        /// </summary>
        /// <returns>A collection of all roles.</returns>
        public List <Entities.Role> GetAllRoles()
        {
            var roles = new List <Entities.Role>();

            DbCommand dbCommand = null;

            try
            {
                using (dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetListOfAllRoles))
                {
                    using (IDataReader reader = database.ExecuteReader(dbCommand))
                    {
                        while (reader.Read())
                        {
                            var role = new Entities.Role
                            {
                                RoleId   = DRE.GetNullableInt32(reader, "role_id", 0),
                                RoleName = DRE.GetNullableString(reader, "role_name", null),
                                RoleDesc = DRE.GetNullableString(reader, "role_desc", null),
                                SrNo     = DRE.GetNullableInt64(reader, "sr_no", null)
                            };

                            roles.Add(role);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dbCommand = null;
            }

            return(roles);
        }
Ejemplo n.º 12
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <Entities.ClientType> GetAllClientTypes()
        {
            var clientTypes = new List <Entities.ClientType>();

            DbCommand dbCommand = null;

            try
            {
                using (dbCommand = database.GetStoredProcCommand(DBStoredProcedure.GetAllClientTypes))
                {
                    using (IDataReader reader = database.ExecuteReader(dbCommand))
                    {
                        while (reader.Read())
                        {
                            var clientType = new Entities.ClientType
                            {
                                ClientTypeId   = DRE.GetNullableInt32(reader, "client_type_id", 0),
                                ClientTypeName = DRE.GetNullableString(reader, "client_type", null),
                                SrNo           = DRE.GetNullableInt64(reader, "sr_no", null)
                            };

                            clientTypes.Add(clientType);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                dbCommand = null;
            }

            return(clientTypes);
        }