Example #1
0
        public MediaGroupItem GetMediaGroupItem(string AssetID)
        {
            DataLayer dal = new DataLayer();
            dal.ConnectionString = ConnectionString;
            dal.Connect();

            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "GetMediaGroupItem";
            cmd.Parameters.AddWithValue("@AssetID", AssetID);

            DataTable dt = dal.Execute(cmd);

            foreach (DataRow dr in dt.Rows)
            {
                MediaGroupItem mediagroupitem = new MediaGroupItem
                {
                    MediaID = Int32.Parse(dr["MediaID"].ToString()),
                    AssetID = dr["AssetID"].ToString(),
                    FileName = dr["FileName"].ToString(),
                    PreviewImageURL = dr["PreviewImage"].ToString(),
                    FilePath = dr["FilePath"].ToString(),
                    PermanentLinkURL = dr["PermanentLink"].ToString(),
                    Sort = Int32.Parse(dr["Sort"].ToString())
                };

                return mediagroupitem;
            }

            return null;
        }
Example #2
0
    public List<Insurance_DashBoard> GetDashBoardInsurance(long PatientID)
    {
        dl = new DataLayer();
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Portal_GetDashBoardInsuranceProviders";

        cmd.Parameters.AddWithValue("PatientID", PatientID);

        List<Insurance_DashBoard> Insurances = new List<Insurance_DashBoard>();
        DataTable dt = dl.Execute(cmd);

        foreach (DataRow dr in dt.Rows)
        {
            Insurance_DashBoard Insurance = new Insurance_DashBoard
            {
                ID = Int64.Parse(dr["ID"].ToString()),
                ProviderName = dr["ProviderName"].ToString(),
                InsuranceType = dr["InsuranceType"].ToString(),
                CreatedBy = dr["CreatedBy"].ToString(),
                GroupNumber = dr["GroupNumber"].ToString(),
                PolicyNumber = dr["PolicyNumber"].ToString(),
                DateCreated = Convert.ToDateTime(dr["DateCreated"].ToString()),

            };

            Insurances.Add(Insurance);

        }

        return Insurances;
    }
Example #3
0
        public List<MediaGroup> GetMediaGroups()
        {
            DataLayer dal = new DataLayer();
            dal.ConnectionString = ConectionString;
            dal.Connect();

            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "GetMediaGroups";

            DataTable dt = dal.Execute(cmd);
            List<MediaGroup> MediaGroups = new List<MediaGroup>();

            foreach (DataRow dr in dt.Rows)
            {
                MediaGroup mediagroup = new MediaGroup
                {
                    MediaID = Int32.Parse(dr["MediaID"].ToString()),
                    MediaTitle = dr["MediaTitle"].ToString(),
                    MediaType = dr["MediaType"].ToString(),
                    DateCreated = DateTime.Parse(dr["DateCreated"].ToString())
                };

                MediaGroups.Add(mediagroup);

            }
            return MediaGroups;
        }
Example #4
0
    public List<EventLink> GetEventLinks(Int64 EventID)
    {
        dl = new DataLayer(pConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "[GetEventsLinks]";
        cmd.Parameters.AddWithValue("@EventID", EventID);

        List<EventLink> Links = new List<EventLink>();
        DataTable dt = dl.Execute(cmd);

        foreach (DataRow dr in dt.Rows)
        {
            EventLink link = new EventLink
            {
                LinkID = Int64.Parse(dr["LinkID"].ToString()),

                LinkURL = dr["LinkURL"].ToString(),

                LinkDescription = dr["LinkDescription"].ToString(),

            };

            Links.Add(link);

        }

        return Links;
    }
Example #5
0
    public HopeEvent GetEvent(Int64 EventID )
    {
        dl = new DataLayer(pConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "GetEvent";
        cmd.Parameters.AddWithValue("@EventID", EventID);

         DataTable dt = dl.Execute(cmd);

        foreach (DataRow dr in dt.Rows)
        {
            HopeEvent the_event = new HopeEvent
            {
                ID = Int64.Parse(dr["ID"].ToString()),

                EventName = dr["EventName"].ToString(),
                ShortDescription = dr["ShortDescription"].ToString(),
                LongDescription = dr["LongDescription"].ToString(),
                AdditionalInformation = dr["AdditionalInformation"].ToString(),
                RegistrationInformation = dr["RegistrationInformation"].ToString(),
                Sort = Int32.Parse(dr["Sort"].ToString()),
                DateCreated = Convert.ToDateTime(dr["DateCreated"].ToString())

            };

            return the_event;

        }

        return null;
    }
Example #6
0
    public List<Patient_Contact> GetDashBoardContacts(long PatientID)
    {
        dl = new DataLayer();
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Portal_GetDashBoardContacts";
        cmd.Parameters.AddWithValue("PatientID", PatientID);

        List<Patient_Contact> contacts = new List<Patient_Contact>();
        DataTable dt = dl.Execute(cmd);

        foreach (DataRow dr in dt.Rows)
        {
            Patient_Contact contact = new Patient_Contact
            {
                ID = Int64.Parse(dr["ID"].ToString()),
                ContactName = dr["ContactName"].ToString(),
                ContactType = dr["ContactType"].ToString(),
                ContactPhoneNumber = dr["PhoneNumber"].ToString(),
                Emergency = bool.Parse(dr["Emergency"].ToString())

            };

            contacts.Add(contact);

        }

        return contacts;
    }
Example #7
0
    public List<Patient_ContactPhone> GetDashBoardContactPhones(long PatientID)
    {
        dl = new DataLayer();
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Portal_GetDashBoardPatientContactNumbers";
        cmd.Parameters.AddWithValue("PatientID", PatientID);

        List<Patient_ContactPhone> contacts = new List<Patient_ContactPhone>();
        DataTable dt = dl.Execute(cmd);

        foreach (DataRow dr in dt.Rows)
        {
            Patient_ContactPhone phone = new Patient_ContactPhone
            {
                PhoneNumber = dr["PhoneNumber"].ToString(),
                PhoneType = dr["PhoneType"].ToString(),
                DateCreated = DateTime.Parse(dr["DateCreated"].ToString()),

            };

            contacts.Add(phone);

        }

        return contacts;
    }
Example #8
0
        public MediaGroup GetMediaGroup(int MediaID)
        {
            DataLayer dal = new DataLayer();
            dal.ConnectionString = ConnectionString;
            dal.Connect();

            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "GetMediaGroup";

            cmd.Parameters.AddWithValue("@MediaID", MediaID);

            DataTable dt = dal.Execute(cmd);

            DataRow dr = dt.Rows[0];
            return new MediaGroup
            {
                MediaID = Int32.Parse(dr["MediaID"].ToString()),
                MediaTitle = dr["MediaTitle"].ToString(),
                MediaType = dr["MediaType"].ToString(),
                ProductID = Int32.Parse(dr["ProductID"].ToString()),
                Active = bool.Parse(dr["Active"].ToString()),
                DateCreated = DateTime.Parse(dr["DateCreated"].ToString())
            };
        }
Example #9
0
        public static DateTime GetMaxCustomerLastUpdateDate()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "GetMaxCustomerLastUpdateDate";

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            DataRow row = dal.Execute(cmd).Rows[0];

            return  DateTime.Parse(row["LastUpdated"].ToString());
        }
Example #10
0
        public static int GetMaxOrderNo()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "GetMaxOrderNo";

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            DataRow row = dal.Execute(cmd).Rows[0];

            return Int32.Parse(row["OrderNo"].ToString());
        }
Example #11
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddOrderPayment";

            cmd.Parameters.AddWithValue("@OrderNo", OrderNo);
            cmd.Parameters.AddWithValue("@CreditCardType", CreditCardType);
            cmd.Parameters.AddWithValue("@CreditCardNumber", CreditCardNumber);
            cmd.Parameters.AddWithValue("@CreditCardExpDate", CreditCardExpDate);
            cmd.Parameters.AddWithValue("@PaymentMethod", PaymentMethod);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Example #12
0
        public static bool EmailExists(string email)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "IsExistingEmail";

            cmd.Parameters.AddWithValue("@Email", email);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = ConectionString;
            dal.Connect();

            DataTable dt = dal.Execute(cmd);

            if (dt.Rows.Count > 0)
            {
                return true;
            }

            return false;
        }
Example #13
0
    public void Portal_SavePatient(Patient patient, Referrer referrer)
    {
        dl = new DataLayer(pConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Portal_SavePatient";

        cmd.Parameters.AddWithValue("@ID", patient.ID);
        cmd.Parameters.AddWithValue("@FirstName", patient.FirstName);
        cmd.Parameters.AddWithValue("@LastName", patient.LastName);
        cmd.Parameters.AddWithValue("@DateOfBirth", patient.DateOfBirth);
        cmd.Parameters.AddWithValue("@Gender", patient.Gender);
        cmd.Parameters.AddWithValue("@Ethnicity", patient.Ethnicity);
        cmd.Parameters.AddWithValue("@MedicaidNumber", patient.MedicaidNumber);
        cmd.Parameters.AddWithValue("@SocialSecurityNumber", patient.MedicaidNumber);
        cmd.Parameters.AddWithValue("@ResidingWithName", patient.ResidingWithName);
        cmd.Parameters.AddWithValue("@ResidingWithRelationship", patient.ResidingWithRelationship);
        cmd.Parameters.AddWithValue("@SchoolName", patient.SchoolName);
        cmd.Parameters.AddWithValue("@SchoolGrade", patient.SchoolName);
        cmd.Parameters.AddWithValue("@SchoolPhone", patient.SchoolPhone);
        cmd.Parameters.AddWithValue("@EmployerName", patient.EmployerName);
        cmd.Parameters.AddWithValue("@Occupation", patient.Occupation);
        cmd.Parameters.AddWithValue("@ClientOnProbation", patient.ClientOnProbation);
        cmd.Parameters.AddWithValue("@EmailAddress", patient.EmailAddress);
        cmd.Parameters.AddWithValue("@Diagnosis", patient.Diagnosis);
        cmd.Parameters.AddWithValue("@ServiceRequested", patient.ServiceRequested);
        cmd.Parameters.AddWithValue("@LocationofServices", patient.LocationofServices);
        cmd.Parameters.AddWithValue("@FinanciallyResponsiblePerson", patient.FinanciallyResponsiblePerson);
        cmd.Parameters.AddWithValue("@PaymentMethod", patient.PaymentMethod);
        cmd.Parameters.AddWithValue("@Email", patient.EmailAddress);
        cmd.Parameters.AddWithValue("@ReferralSourceName", referrer.ReferralSourceName);
        cmd.Parameters.AddWithValue("@ReferralSourceAgency", referrer.ReferralSourceAgency);
        cmd.Parameters.AddWithValue("@ReferrerPhone", referrer.ReferrerPhone);
        cmd.Parameters.AddWithValue("@ReferralFax", referrer.ReferralFax);
        cmd.Parameters.AddWithValue("@ReferralStreet", referrer.Street);
        cmd.Parameters.AddWithValue("@ReferralSuite", referrer.Suite);
        cmd.Parameters.AddWithValue("@ReferralCity", referrer.City);
        cmd.Parameters.AddWithValue("@ReferralState", referrer.State);
        cmd.Parameters.AddWithValue("@ReferralZipCode", referrer.ZipCode);
        cmd.Parameters.AddWithValue("@ReferralCountry", referrer.Country);
        cmd.Parameters.AddWithValue("@PatientStreet", patient.PatientStreet);
        cmd.Parameters.AddWithValue("@PatientSuite", patient.PatientSuite);
        cmd.Parameters.AddWithValue("@PatientCity", patient.PatientCity);
        cmd.Parameters.AddWithValue("@PatientState", patient.PatientState);
        cmd.Parameters.AddWithValue("@PatientZipCode", patient.PatientZipCode);
        cmd.Parameters.AddWithValue("@PatientCountry", patient.PatientCountry);

        dl.Execute(cmd);

        return;
    }
Example #14
0
    public int Portal_SaveTherapist(Therapist therapist, string LoggedInUserEmail)
    {
        dl = new DataLayer();
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Portal_SaveTherapist";

        cmd.Parameters.AddWithValue("@FirstName", therapist.FirstName);
        cmd.Parameters.AddWithValue("@LastName", therapist.LastName);
        cmd.Parameters.AddWithValue("@Gender", therapist.Gender);
        cmd.Parameters.AddWithValue("@TaxNumber", therapist.TaxNumber);
        cmd.Parameters.AddWithValue("@Qualification", therapist.Qualification);
        cmd.Parameters.AddWithValue("@LicenseNumber", therapist.LicenceNumber);
        cmd.Parameters.AddWithValue("@HiringDate", therapist.HiringDate);
        cmd.Parameters.AddWithValue("@TerminationDate", therapist.TerminationDate);
        cmd.Parameters.AddWithValue("@EmailAddress", therapist.EmailAddress);
        cmd.Parameters.AddWithValue("@Title", therapist.Title);
        cmd.Parameters.AddWithValue("@Bio", therapist.Bio);
        cmd.Parameters.AddWithValue("@MiddleInitial", therapist.MiddleInitial);
        cmd.Parameters.AddWithValue("@PictureURL", therapist.PictureURL);
        cmd.Parameters.AddWithValue("@NPINumber", therapist.NPINumber);
        cmd.Parameters.AddWithValue("@SpecialisedTraining", therapist.SpecialisedTraining);
        cmd.Parameters.AddWithValue("@Password", therapist.Password);
        cmd.Parameters.AddWithValue("@PhoneNUmber", therapist.PhoneNumber);
        cmd.Parameters.AddWithValue("@PhoneType", therapist.PhoneType);
        cmd.Parameters.AddWithValue("@DateofBirth", therapist.DateOfBirth);
        cmd.Parameters.AddWithValue("@Active", therapist.Active);
        cmd.Parameters.AddWithValue("@SavedBy", LoggedInUserEmail);

        DataTable dt = dl.Execute(cmd);

        DataRow dr = dt.Rows[0];

        return Int32.Parse(dr["RET"].ToString());
    }
Example #15
0
    public bool Login(string email, string password)
    {
        dl = new DataLayer(pConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Portal_UserLogin";
        cmd.Parameters.AddWithValue("@email", email);
        cmd.Parameters.AddWithValue("@password", password);

        DataTable dt = dl.Execute(cmd);

        if (dt.Rows.Count > 0)
        {
            return true;
        }

        return false;
    }
Example #16
0
    public List<Patient> GetPatients()
    {
        dl = new DataLayer(pConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Portal_Patients";

        List<Patient> patients = new List<Patient>();
        DataTable dt = dl.Execute(cmd);

        foreach (DataRow dr in dt.Rows)
        {
            Patient patient = new Patient
            {
                ID = Int64.Parse(dr["ID"].ToString()),
                Guid = Guid.Parse(dr["Guid"].ToString()),
                FirstName = dr["FirstName"].ToString(),
                LastName = dr["LastName"].ToString(),
                Gender = dr["Gender"].ToString(),
                DateOfBirth = Convert.ToDateTime(dr["DateOfBirth"].ToString()),
                Ethnicity = dr["Ethnicity"].ToString(),
                MedicaidNumber = dr["MedicaidNumber"].ToString(),
                SocialSecurityNumber = dr["SocialSecurityNumber"].ToString(),
                ResidingWithName = dr["ResidingWithName"].ToString(),
                ResidingWithRelationship = dr["ResidingWithRelationship"].ToString(),
                SchoolName = dr["SchoolName"].ToString(),
                SchoolGrade = dr["SchoolGrade"].ToString(),
                SchoolPhone = dr["SchoolPhone"].ToString(),
                EmployerName = dr["EmployerName"].ToString(),
                Occupation = dr["Occupation"].ToString(),
                ClientOnProbation = bool.Parse(dr["ClientOnProbation"].ToString()),
                EmailAddress = dr["EmailAddress"].ToString(),
                Diagnosis = dr["Diagnosis"].ToString(),
                ServiceRequested = dr["ServiceRequested"].ToString(),
                LocationofServices = dr["LocationofServices"].ToString(),
                FinanciallyResponsiblePerson = dr["FinanciallyResponsiblePerson"].ToString(),
                DateCreated = Convert.ToDateTime(dr["DateCreated"].ToString()),
                CreatedBy = dr["CreatedBy"].ToString(),
                LastUpdated = Convert.ToDateTime(dr["LastUpdated"].ToString()),
                LastUpdatedBy = dr["LastUpdatedBy"].ToString(),
                PaymentMethod = dr["PaymentMethod"].ToString(),
                PatientStreet = dr["Street"].ToString(),
                PatientSuite = dr["Suite"].ToString(),
                PatientCity = dr["City"].ToString(),
                PatientState = dr["State"].ToString(),
                PatientZipCode = dr["ZipCode"].ToString(),
                PatientCountry = dr["Country"].ToString(),

            };

            patients.Add(patient);

        }

        return patients;
    }
Example #17
0
    public List<Therapist> GetTherapists()
    {
        dl = new DataLayer(pConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "GetTherapists";

        List<Therapist> therapists = new List<Therapist>();
        DataTable dt = dl.Execute(cmd);

        foreach (DataRow dr in dt.Rows)
        {
            Therapist therapist = new Therapist
            {
                ID = Int64.Parse(dr["ID"].ToString()),
                Guid = Guid.Parse(dr["Guid"].ToString()),
                Name = dr["Name"].ToString(),
                FirstName = dr["FirstName"].ToString(),
                LastName = dr["LastName"].ToString(),
                Gender = dr["Gender"].ToString(),
                TaxNumber = dr["TaxNumber"].ToString(),
                Qualification = dr["Qualification"].ToString(),
                LicenceNumber = dr["LicenceNumber"].ToString(),
                HiringDate = Convert.ToDateTime(dr["HiringDate"].ToString()),
                TerminationDate = Convert.ToDateTime(dr["TerminationDate"].ToString()),
                EmailAddress = dr["EmailAddress"].ToString(),
                Title = dr["Title"].ToString(),
                Bio = dr["Bio"].ToString(),
                MiddleInitial = dr["MiddleInitial"].ToString(),
                PictureURL = dr["PictureURL"].ToString(),
                Sort = Int32.Parse(dr["Sort"].ToString()),
                DateCreated = Convert.ToDateTime(dr["DateCreated"].ToString())

            };

            therapists.Add(therapist);

        }

        return therapists;
    }
Example #18
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMediaGroup";

            cmd.Parameters.AddWithValue("@MediaID", MediaID);
            cmd.Parameters.AddWithValue("@MediaTitle", MediaTitle);
            cmd.Parameters.AddWithValue("@MediaType", MediaType);
            cmd.Parameters.AddWithValue("@ProductID", ProductID);
            cmd.Parameters.AddWithValue("@Active", Active);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Example #19
0
    public string getNewPatientNumber()
    {
        dl = new DataLayer(pConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "IssueSequenceNumber";

        DataTable dt = dl.Execute(cmd);

        DataRow dr = dt.Rows[0];

        return dr["SequenceID"].ToString();
    }
Example #20
0
    public int Portal_UpdatePatient(Patient patient, Referrer referrer, string LoggedInUserEmail)
    {
        dl = new DataLayer();
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Portal_SavePatient";

        cmd.Parameters.AddWithValue("@ID", patient.ID);
        cmd.Parameters.AddWithValue("@FirstName", patient.FirstName);
        cmd.Parameters.AddWithValue("@LastName", patient.LastName);
        cmd.Parameters.AddWithValue("@DateOfBirth", patient.DateOfBirth);
        cmd.Parameters.AddWithValue("@ReferralDate", patient.ReferralDate);
        cmd.Parameters.AddWithValue("@Gender", patient.Gender);
        cmd.Parameters.AddWithValue("@Ethnicity", patient.Ethnicity);
        cmd.Parameters.AddWithValue("@MedicaidNumber", patient.MedicaidNumber);
        cmd.Parameters.AddWithValue("@SocialSecurityNumber", patient.SocialSecurityNumber);
        cmd.Parameters.AddWithValue("@ResidingWithName", patient.ResidingWithName);
        cmd.Parameters.AddWithValue("@ResidingWithRelationship", patient.ResidingWithRelationship);
        cmd.Parameters.AddWithValue("@SchoolName", patient.SchoolName);
        cmd.Parameters.AddWithValue("@SchoolGrade", patient.SchoolName);
        cmd.Parameters.AddWithValue("@SchoolPhone", patient.SchoolPhone);
        cmd.Parameters.AddWithValue("@EmployerName", patient.EmployerName);
        cmd.Parameters.AddWithValue("@Occupation", patient.Occupation);
        cmd.Parameters.AddWithValue("@ClientOnProbation", patient.ClientOnProbation);
        cmd.Parameters.AddWithValue("@EmailAddress", patient.EmailAddress);
        cmd.Parameters.AddWithValue("@Diagnosis", patient.Diagnosis);
        cmd.Parameters.AddWithValue("@PresentingConcerns", patient.PresentingConcerns);

        cmd.Parameters.AddWithValue("@ServiceRequested", patient.ServiceRequested);
        cmd.Parameters.AddWithValue("@LocationofServices", patient.LocationofServices);
        cmd.Parameters.AddWithValue("@FinanciallyResponsiblePerson", patient.FinanciallyResponsiblePerson);
        cmd.Parameters.AddWithValue("@LegalGuardian", patient.LegalGuardian);
        cmd.Parameters.AddWithValue("@PaymentMethod", patient.PaymentMethod);

        cmd.Parameters.AddWithValue("@ReferralSourceName", referrer.ReferralSourceName);
        cmd.Parameters.AddWithValue("@ReferralSourceAgency", referrer.ReferralSourceAgency);
        cmd.Parameters.AddWithValue("@ReferrerPhone", referrer.ReferrerPhone);
        cmd.Parameters.AddWithValue("@ReferralFax", referrer.ReferralFax);
        cmd.Parameters.AddWithValue("@ReferralStreet", referrer.Street);
        cmd.Parameters.AddWithValue("@ReferralSuite", referrer.Suite);
        cmd.Parameters.AddWithValue("@ReferralCity", referrer.City);
        cmd.Parameters.AddWithValue("@ReferralState", referrer.State);
        cmd.Parameters.AddWithValue("@ReferralZipCode", referrer.ZipCode);
        cmd.Parameters.AddWithValue("@ReferralCountry", referrer.Country);

        cmd.Parameters.AddWithValue("@PatientStreet", patient.PatientStreet);
        cmd.Parameters.AddWithValue("@PatientSuite", patient.PatientSuite);
        cmd.Parameters.AddWithValue("@PatientCity", patient.PatientCity);
        cmd.Parameters.AddWithValue("@PatientState", patient.PatientState);
        cmd.Parameters.AddWithValue("@PatientZipCode", patient.PatientZipCode);
        cmd.Parameters.AddWithValue("@PatientCountry", patient.PatientCountry);
        cmd.Parameters.AddWithValue("@SchoolPhoneType", patient.SchoolPhoneType);
        cmd.Parameters.AddWithValue("@ReferrerPhoneType", referrer.ReferrerPhoneType);
        cmd.Parameters.AddWithValue("@UpdatedBy", LoggedInUserEmail);

        DataTable dt = dl.Execute(cmd);

        DataRow dr = dt.Rows[0];

        return Int32.Parse(dr["RET"].ToString());
    }
Example #21
0
    public List<HopeEvent> GetEvents()
    {
        dl = new DataLayer(pConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "GetEvents";

        List<HopeEvent> Events = new List<HopeEvent>();
        DataTable dt = dl.Execute(cmd);

        foreach (DataRow dr in dt.Rows)
        {
            HopeEvent the_event = new HopeEvent
            {
                ID = Int64.Parse(dr["ID"].ToString()),

                EventName = dr["EventName"].ToString(),
                ShortDescription = dr["ShortDescription"].ToString(),
                LongDescription = dr["LongDescription"].ToString(),
                AdditionalInformation = dr["AdditionalInformation"].ToString(),
                RegistrationInformation = dr["RegistrationInformation"].ToString(),
                Sort = Int32.Parse(dr["Sort"].ToString()),
                DateCreated = Convert.ToDateTime(dr["DateCreated"].ToString())

            };

            Events.Add(the_event);

        }

        return Events;
    }
Example #22
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddOrderItem";

            cmd.Parameters.AddWithValue("@LineItemNo", LineItemNo);
            cmd.Parameters.AddWithValue("@OrderNo", OrderNo);
            cmd.Parameters.AddWithValue("@ProductNo", ProductNo);
            cmd.Parameters.AddWithValue("@ProductName", ProductName);
            cmd.Parameters.AddWithValue("@ProductSKU", ProductSKU);
            cmd.Parameters.AddWithValue("@ProductType", ProductType);
            cmd.Parameters.AddWithValue("@Quantity", Quantity);
            cmd.Parameters.AddWithValue("@UnitWeight", UnitWeight);
            cmd.Parameters.AddWithValue("@TotalWeight", TotalWeight);
            cmd.Parameters.AddWithValue("@LineStatus", LineStatus);
            cmd.Parameters.AddWithValue("@UnitPrice", UnitPrice);
            cmd.Parameters.AddWithValue("@ExtPrice", ExtPrice);
            cmd.Parameters.AddWithValue("@ShipDate", ShipDate);
            cmd.Parameters.AddWithValue("@TrackingNumber", TrackingNumber);
            cmd.Parameters.AddWithValue("@ProductKey", ProductKey);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Example #23
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddOrder";

            cmd.Parameters.AddWithValue("@OrderNo", OrderNo);
            cmd.Parameters.AddWithValue("@OrderDate", OrderDate);
            cmd.Parameters.AddWithValue("@OrderType", OrderType);
            cmd.Parameters.AddWithValue("@OrderStatus", OrderStatus);
            cmd.Parameters.AddWithValue("@ShipDate", ShipDate);
            cmd.Parameters.AddWithValue("@BillingStatus", BillingStatus);
            cmd.Parameters.AddWithValue("@OrderAmount", OrderAmount);
            cmd.Parameters.AddWithValue("@OrderNet", OrderNet);
            cmd.Parameters.AddWithValue("@PlacedBy", PlacedBy);
            cmd.Parameters.AddWithValue("@LastUpdate", LastUpdate);
            cmd.Parameters.AddWithValue("@LastUpdateBy", LastUpdateBy);
            cmd.Parameters.AddWithValue("@IpAddress", IpAdress);
            cmd.Parameters.AddWithValue("@IpAddress_CountryCode", IpAdress_CountryCode);
            cmd.Parameters.AddWithValue("@CustomerNo", CustomerNo);
            cmd.Parameters.AddWithValue("@Email", Email);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Example #24
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddProduct";

            cmd.Parameters.AddWithValue("@ProductNo", ProductNo);
            cmd.Parameters.AddWithValue("@ProductName", ProductName);
            cmd.Parameters.AddWithValue("@ProductSKU", ProductSKU);
            cmd.Parameters.AddWithValue("@ProductPrice", ProductPrice);
            cmd.Parameters.AddWithValue("@Weight", Weight);
            cmd.Parameters.AddWithValue("@Status", Status);
            cmd.Parameters.AddWithValue("@ShipFrom", ShipFrom);
            cmd.Parameters.AddWithValue("@Taxable", Taxable);
            cmd.Parameters.AddWithValue("@Visibility", Visibility);
            cmd.Parameters.AddWithValue("@DiscountEligible", DiscountEligible);
            cmd.Parameters.AddWithValue("@AllowDirectCheckout", AllowDirectCheckout);
            cmd.Parameters.AddWithValue("@AllowReviews", AllowReviews);
            cmd.Parameters.AddWithValue("@AllowQuestions", AllowQuestions);
            cmd.Parameters.AddWithValue("@StoreFrontURL", StoreFrontURL);
            cmd.Parameters.AddWithValue("@DirectCheckoutURL", DirectCheckoutURL);
            cmd.Parameters.AddWithValue("@ShortDescrption", ShortDescrption);
            cmd.Parameters.AddWithValue("@LongDescription", LongDescription);
            cmd.Parameters.AddWithValue("@DateCreated", DateCreated);
            cmd.Parameters.AddWithValue("@CreatedBy", CreatedBy);
            cmd.Parameters.AddWithValue("@DateLastUpdated", DateLastUpdated);
            cmd.Parameters.AddWithValue("@UpdatedBy", UpdatedBy);
            cmd.Parameters.AddWithValue("@ThumbNailImageURL", ThumbNailImageURL);
            cmd.Parameters.AddWithValue("@MainImageURL", MainImageURL);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Example #25
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddCustomerAddress";

            cmd.Parameters.AddWithValue("@ID", ID);
            cmd.Parameters.AddWithValue("@AddressType", AddressType);
            cmd.Parameters.AddWithValue("@CustomerNo", CustomerNo);
            cmd.Parameters.AddWithValue("@FirstName", FistName);
            cmd.Parameters.AddWithValue("@LastName", LastName);
            cmd.Parameters.AddWithValue("@StreetAddress1", StreetAddress1);
            cmd.Parameters.AddWithValue("@City", City);
            cmd.Parameters.AddWithValue("@StateProvCode", StateProvCode);
            cmd.Parameters.AddWithValue("@ZipPostalCode", ZipPostalCode);
            cmd.Parameters.AddWithValue("@CountryCode", CountryCode);
            cmd.Parameters.AddWithValue("@PhoneNumber", PhoneNumber);
            cmd.Parameters.AddWithValue("@PrimaryShip", isPrimaryShip);
            cmd.Parameters.AddWithValue("@PrimaryBill", isPrimaryBill);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Example #26
0
        public bool Update()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "UpdateMediaGroupItem";

            cmd.Parameters.AddWithValue("@AssetID", AssetID);
            cmd.Parameters.AddWithValue("@FileName", FileName);
            cmd.Parameters.AddWithValue("@FilePath", FilePath);
            cmd.Parameters.AddWithValue("@PermanentLink", PermanentLinkURL);
            cmd.Parameters.AddWithValue("@PreviewImage", PreviewImageURL);
            cmd.Parameters.AddWithValue("@Sort", Sort);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Example #27
0
    public void Portal_SavePatientPhone(
               long PatientID,
               string ContactPhoneNumber,
               string ContactPhoneType,
               string LoggedInUserEmail)
    {
        dl = new DataLayer();
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Portal_SavePatientPhone";

        cmd.Parameters.AddWithValue("@PatientID", PatientID);
        cmd.Parameters.AddWithValue("@ContactPhoneNumber", ContactPhoneNumber);
        cmd.Parameters.AddWithValue("@ContactPhoneType", ContactPhoneType);
        cmd.Parameters.AddWithValue("@SavedBy", LoggedInUserEmail);

        dl.Execute(cmd);
    }
Example #28
0
    public List<LookUp> getLookUps(string lookup_Name)
    {
        dl = new DataLayer(pConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "usp_get_lookup_values";

        cmd.Parameters.AddWithValue("@lookup_Name", lookup_Name);

        DataTable dt = dl.Execute(cmd);

        List<LookUp> Lookups = new List<LookUp>();

        foreach (DataRow dr in dt.Rows)
        {
            LookUp lookup = new LookUp
            {
                lookup_id = dr["lookup_id"].ToString(),
                lookup_name = dr["lookup_name"].ToString().ToLower(),
                lookup_value = dr["lookup_value"].ToString().ToLower(),
                lookup_display_text = dr["lookup_display_text"].ToString().ToLower()
            };

            Lookups.Add(lookup);

        }
        return Lookups;
    }
Example #29
0
    public List<EventPicture> GetEventPictures(Int64 EventID)
    {
        dl = new DataLayer(pConnectionString);
        SqlCommand cmd = new SqlCommand();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "[GetEventsPictures]";
        cmd.Parameters.AddWithValue("@EventID", EventID);

        List<EventPicture> Pictures = new List<EventPicture>();
        DataTable dt = dl.Execute(cmd);

        foreach (DataRow dr in dt.Rows)
        {
            EventPicture picture = new EventPicture
            {
                PictureID = Int64.Parse(dr["PictureID"].ToString()),

                PictureURL = dr["PictureURL"].ToString(),

            };

            Pictures.Add(picture);

        }

        return Pictures;
    }
Example #30
0
        public DataTable GetMediaGroupItems(int MediaID)
        {
            DataLayer dal = new DataLayer();
            dal.ConnectionString = ConnectionString;
            dal.Connect();

            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "GetMediaGroupItems";
            cmd.Parameters.AddWithValue("@MediaID", MediaID);

            return  dal.Execute(cmd);
        }