Esempio n. 1
0
        public async Task <int> CreateUserAsync(UserModel userModel, string password)
        {
            var recInsert = 0;

            try
            {
                var stProc = CreateUser;
                var retVal = new SqlParameter("@SCOPE_OUTPUT", 10)
                {
                    Direction = ParameterDirection.Output
                };
                var pList = new List <SqlParameter>()
                {
                    new SqlParameter("@USEREMAIL", userModel.Email),
                    new SqlParameter("@PASSWORD", password),
                    new SqlParameter("@FIRSTNAME", userModel.FirstName ?? string.Empty),
                    new SqlParameter("@LASTNAME", userModel.LastName ?? string.Empty),
                    retVal
                };
                recInsert = Convert.ToInt32(UtilityDL.ExecuteNonQuery(stProc, pList, true));
                return(recInsert);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
 public AddEditMasters Add(PHCRequest pData)
 {
     try
     {
         string stProc = AddPHC;
         var    pList  = new List <SqlParameter>
         {
             new SqlParameter("@CHCID", pData.chcId),
             new SqlParameter("@HNIN_ID", pData.hninId ?? pData.hninId),
             new SqlParameter("@PHC_gov_code", pData.phcGovCode),
             new SqlParameter("@PHCname", pData.phcName ?? pData.phcName),
             new SqlParameter("@Pincode", pData.pincode ?? pData.pincode),
             new SqlParameter("@Isactive", pData.isActive ?? pData.isActive),
             new SqlParameter("@Latitude", pData.latitude ?? pData.latitude),
             new SqlParameter("@Longitude", pData.longitude ?? pData.longitude),
             new SqlParameter("@Comments", pData.comments ?? pData.comments),
             new SqlParameter("@Createdby", pData.createdBy),
             new SqlParameter("@Updatedby", pData.updatedBy),
         };
         var returnData = UtilityDL.FillEntity <AddEditMasters>(stProc, pList);
         return(returnData);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Esempio n. 3
0
 public string AddSample(AddSubjectSampleRequest ssData)
 {
     try
     {
         string stProc = AddSampleCollection;
         var    retVal = new SqlParameter("@Scope_output", 1);
         retVal.Direction = ParameterDirection.Output;
         var pList = new List <SqlParameter>
         {
             new SqlParameter("@UniqueSubjectID", ssData.uniqueSubjectId ?? ssData.uniqueSubjectId),
             new SqlParameter("@BarcodeNo", ssData.barcodeNo ?? ssData.barcodeNo),
             new SqlParameter("@SampleCollectionDate", ssData.sampleCollectionDate ?? ssData.sampleCollectionDate),
             new SqlParameter("@SampleCollectionTime", ssData.sampleCollectionTime ?? ssData.sampleCollectionTime),
             new SqlParameter("@Reason", ssData.reason ?? ssData.reason),
             new SqlParameter("@CollectionFrom", ssData.collectionFrom),
             new SqlParameter("@CollectedBy", ssData.collectedBy),
             retVal
         };
         UtilityDL.ExecuteNonQuery(stProc, pList);
         return($"Sample collected successfully");
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Esempio n. 4
0
 public AddEditMasters Add(CHCRequest cData)
 {
     try
     {
         string stProc = AddCHC;
         var    pList  = new List <SqlParameter>
         {
             new SqlParameter("@BlockID", cData.blockId),
             new SqlParameter("@DistrictID", cData.districtId),
             new SqlParameter("@HNIN_ID", cData.hninId ?? cData.hninId),
             new SqlParameter("@CHC_gov_code", cData.chcGovCode),
             new SqlParameter("@CHCname", cData.chcName ?? cData.chcName),
             new SqlParameter("@Istestingfacility", cData.isTestingFacility ?? cData.isTestingFacility),
             new SqlParameter("@TestingCHCID", cData.testingCHCId),
             new SqlParameter("@CentralLabId", cData.centralLabId),
             new SqlParameter("@Pincode", cData.pincode ?? cData.pincode),
             new SqlParameter("@Isactive", cData.isActive ?? cData.isActive),
             new SqlParameter("@Latitude", cData.latitude ?? cData.latitude),
             new SqlParameter("@Longitude", cData.longitude ?? cData.longitude),
             new SqlParameter("@Comments", cData.comments ?? cData.comments),
             new SqlParameter("@Createdby", cData.createdBy),
             new SqlParameter("@Updatedby", cData.updatedBy),
         };
         var returnData = UtilityDL.FillEntity <AddEditMasters>(stProc, pList);
         return(returnData);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Esempio n. 5
0
 public void SubjectPregnancy(SubjectPregnancyDetailRequest spData, string uniqueSubID)
 {
     try
     {
         var stProc = AddSubjectPregnancyDetail;
         var retVal = new SqlParameter("@SCOPE_OUTPUT", 1)
         {
             Direction = ParameterDirection.Output
         };
         var pList = new List <SqlParameter>()
         {
             new SqlParameter("@UniqueSubjectID", uniqueSubID),
             new SqlParameter("@RCHID", spData.rchId.ToCheckNull()),
             new SqlParameter("@ECNumber", spData.ecNumber.ToCheckNull()),
             new SqlParameter("@LMP_Date", spData.lmpDate.ToCheckNull()),
             new SqlParameter("@G", Convert.ToInt32(spData.g)),
             new SqlParameter("@P", Convert.ToInt32(spData.p)),
             new SqlParameter("@L", Convert.ToInt32(spData.l)),
             new SqlParameter("@A", Convert.ToInt32(spData.a)),
             new SqlParameter("@UpdatedBy", Convert.ToInt32(spData.updatedBy)),
             retVal
         };
         UtilityDL.ExecuteNonQuery(stProc, pList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 6
0
        public string Add(TestTypeRequest ttData)
        {
            try
            {
                string stProc = AddTestType;
                var    retVal = new SqlParameter("@Scope_output", 1);
                retVal.Direction = ParameterDirection.Output;
                var pList = new List <SqlParameter>
                {
                    new SqlParameter("@TestType", ttData.testTypeName ?? ttData.testTypeName),
                    new SqlParameter("@Isactive", ttData.isactive ?? ttData.isactive),
                    new SqlParameter("@Comments", ttData.comments ?? ttData.comments),
                    new SqlParameter("@Createdby", ttData.createdby),
                    new SqlParameter("@Updatedby", ttData.updatedby),

                    retVal
                };
                UtilityDL.ExecuteNonQuery(stProc, pList);
                return("Test type added successfully");
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Esempio n. 7
0
 public List<UserRole> Retrieve()
 {
     string stProc = FetchUserRoles;
     var pList = new List<SqlParameter>();
     var allData = UtilityDL.FillData<UserRole>(stProc, pList);
     return allData;
 }
Esempio n. 8
0
 public void SubjectAddress(SubjectAddressDetailRequest saData, string uniqueSubId)
 {
     try
     {
         var stProc = AddSubjectAddressDetail;
         var retVal = new SqlParameter("@SCOPE_OUTPUT", 1)
         {
             Direction = ParameterDirection.Output
         };
         var pList = new List <SqlParameter>()
         {
             new SqlParameter("@UniqueSubjectID", uniqueSubId),
             new SqlParameter("@Religion_Id", Convert.ToInt32(saData.religionId)),
             new SqlParameter("@Caste_Id", Convert.ToInt32(saData.casteId)),
             new SqlParameter("@Community_Id", Convert.ToInt32(saData.communityId)),
             new SqlParameter("@Address1", saData.address1.ToCheckNull()),
             new SqlParameter("@Address2", saData.address2.ToCheckNull()),
             new SqlParameter("@Address3", saData.address3.ToCheckNull()),
             new SqlParameter("@Pincode", saData.pincode.ToCheckNull()),
             new SqlParameter("@StateName", saData.stateName.ToCheckNull()),
             new SqlParameter("@UpdatedBy", Convert.ToInt32(saData.updatedBy)),
             retVal
         };
         UtilityDL.ExecuteNonQuery(stProc, pList);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 9
0
 public List<UserRole> Retrieve(int code)
 {
     string stProc = FetchUserRole;
     var pList = new List<SqlParameter>() { new SqlParameter("@ID", code) };
     var allData = UtilityDL.FillData<UserRole>(stProc, pList);
     return allData; throw new NotImplementedException();
 }
Esempio n. 10
0
 public string Add(Patient patient)
 {
     try
     {
         string stProc = AddPatient;
         var    retVal = new SqlParameter("@SCOPE_OUTPUT", 1)
         {
             Direction = ParameterDirection.Output
         };
         var pList = new List <SqlParameter>
         {
             new SqlParameter("@GID", patient.GovtId),
             new SqlParameter("@FIRSTNAME", patient.FirstName ?? patient.FirstName),
             new SqlParameter("@LASTNAME", patient.LastName ?? patient.LastName),
             new SqlParameter("@LOCATION", patient.Location ?? patient.Location),
             retVal
         };
         UtilityDL.ExecuteNonQuery(stProc, pList);
         return("Patient added successfully");
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Esempio n. 11
0
 public AddEditMasters Add(RIRequest rData)
 {
     try
     {
         string stProc = AddRI;
         var    pList  = new List <SqlParameter>
         {
             new SqlParameter("@TestingCHCID", rData.testingCHCId),
             new SqlParameter("@CHCID", rData.chcId),
             new SqlParameter("@PHCID", rData.phcId),
             new SqlParameter("@SCID", rData.scId),
             new SqlParameter("@RI_gov_code", rData.riGovCode),
             new SqlParameter("@RIsite", rData.riSite ?? rData.riSite),
             new SqlParameter("@Pincode", rData.pincode ?? rData.pincode),
             new SqlParameter("@ILRID", rData.ilrId),
             new SqlParameter("@Isactive", rData.isActive ?? rData.isActive),
             new SqlParameter("@Latitude", rData.latitude ?? rData.latitude),
             new SqlParameter("@Longitude", rData.longitude ?? rData.longitude),
             new SqlParameter("@Comments", rData.comments ?? rData.comments),
             new SqlParameter("@Createdby", rData.createdBy),
             new SqlParameter("@Updatedby", rData.updatedBy),
         };
         var returnData = UtilityDL.FillEntity <AddEditMasters>(stProc, pList);
         return(returnData);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Esempio n. 12
0
        public List <Patient> GetPatients()
        {
            string stProc  = GetAllpatients;
            var    pList   = new List <SqlParameter>();
            var    allData = UtilityDL.FillData <Patient>(stProc, pList);

            return(allData);
        }
Esempio n. 13
0
        public List <Community> Retrieve()
        {
            string stProc  = FetchCommunities;
            var    pList   = new List <SqlParameter>();
            var    allData = UtilityDL.FillData <Community>(stProc, pList);

            return(allData);
        }
Esempio n. 14
0
        public List <Threshold> Retrieve()
        {
            string stProc  = FetchThresholdValues;
            var    pList   = new List <SqlParameter>();
            var    allData = UtilityDL.FillData <Threshold>(stProc, pList);

            return(allData);
        }
Esempio n. 15
0
        public List <Block> Retrieve()
        {
            string stProc  = FetchAllBlocks;
            var    pList   = new List <SqlParameter>();
            var    allData = UtilityDL.FillData <Block>(stProc, pList);

            return(allData);
        }
Esempio n. 16
0
        public List <ClinicalDiagnosis> Retrieve()
        {
            string stProc  = FetchAllClinicalDiagnosis;
            var    pList   = new List <SqlParameter>();
            var    allData = UtilityDL.FillData <ClinicalDiagnosis>(stProc, pList);

            return(allData);
        }
Esempio n. 17
0
        public List <Religion> Retrieve()
        {
            string stProc  = FetchReligions;
            var    pList   = new List <SqlParameter>();
            var    allData = UtilityDL.FillData <Religion>(stProc, pList);

            return(allData);
        }
Esempio n. 18
0
        public List <SubjectType> Retrieve()
        {
            string stProc  = FetchSubjectTypes;
            var    pList   = new List <SqlParameter>();
            var    allData = UtilityDL.FillData <SubjectType>(stProc, pList);

            return(allData);
        }
Esempio n. 19
0
        public List <District> Retrieve()
        {
            string stProc  = FetchDistricts;
            var    pList   = new List <SqlParameter>();
            var    allData = UtilityDL.FillData <District>(stProc, pList);

            return(allData);
        }
Esempio n. 20
0
        public List <Block> Retrieve(int code)
        {
            string stProc = FetchBlock;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@ID", code)
            };
            var allData = UtilityDL.FillData <Block>(stProc, pList);

            return(allData);
        }
Esempio n. 21
0
        public async Task <List <User> > FindByEmailAsync(string email)
        {
            var stProc = FetchUserByEmail;
            var pList  = new List <SqlParameter>()
            {
                new SqlParameter("@Email", email)
            };
            var userDetail = UtilityDL.FillData <User>(stProc, pList);

            return(userDetail);
        }
Esempio n. 22
0
        public SMSSamplesDetails FetchSMSSamplesByBarcode(string barcodeNo)
        {
            string stProc = FetchSampleDetailsForSMSbyBarcode;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@Barcode", barcodeNo),
            };
            var allData = UtilityDL.FillEntity <SMSSamplesDetails>(stProc, pList);

            return(allData);
        }
Esempio n. 23
0
        public async Task <List <User> > FindByUsernameAsync(string userName)
        {
            var stProc = FetchUserByUsername;
            var pList  = new List <SqlParameter>()
            {
                new SqlParameter("@Username", userName)
            };
            var userDetail = UtilityDL.FillData <User>(stProc, pList);

            return(userDetail);
        }
Esempio n. 24
0
        public List <BarcodeSample> FetchBarcode(string barcodeNo)
        {
            string stProc = FetchBarcodeSample;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@Barcode", barcodeNo),
            };
            var allData = UtilityDL.FillData <BarcodeSample>(stProc, pList);

            return(allData);
        }
Esempio n. 25
0
        public List <User> RetrieveByEmail(string email)
        {
            string stProc = FetchUserByEmail;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@Email", email)
            };
            var allData = UtilityDL.FillData <User>(stProc, pList);

            return(allData);
        }
Esempio n. 26
0
        public List <ClinicalDiagnosis> Retrieve(int code)
        {
            string stProc = FetchClinicalDiagnosis;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@ID", code)
            };
            var allData = UtilityDL.FillData <ClinicalDiagnosis>(stProc, pList);

            return(allData);
        }
Esempio n. 27
0
        public List <User> RetrieveByUsername(string username)
        {
            string stProc = FetchUserByUsername;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@Username", username)
            };
            var allData = UtilityDL.FillData <User>(stProc, pList);

            return(allData);
        }
Esempio n. 28
0
        public async Task <List <UserModel> > FindByEmailAsync(string email)
        {
            var stProc = FindUserByEmail;
            var pList  = new List <SqlParameter>()
            {
                new SqlParameter("@USEREMAIL", email)
            };
            var user = UtilityDL.FillData <UserModel>(stProc, pList);

            return(user);
        }
Esempio n. 29
0
        public List <Threshold> Retrieve(int code)
        {
            string stProc = FetchThresholdValue;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@ID", code)
            };
            var allData = UtilityDL.FillData <Threshold>(stProc, pList);

            return(allData);
        }
Esempio n. 30
0
        public SMSSamplesDetails FetchSMSSamples(string barcodeNo, string subjectId)
        {
            string stProc = FetchSMSSample;
            var    pList  = new List <SqlParameter>()
            {
                new SqlParameter("@Barcode", barcodeNo),
                new SqlParameter("@SubjectId", subjectId),
            };
            var allData = UtilityDL.FillEntity <SMSSamplesDetails>(stProc, pList);

            return(allData);
        }