internal static bool CreateNewCPA(CPADetails newCPA) { bool result =true; try { SqlParameter CompanyName = new SqlParameter() { ParameterName = "CompanyName", Value = newCPA.CompanyName }; SqlParameter Address1 = new SqlParameter() { ParameterName = "Address1", Value = newCPA.Address1 }; SqlParameter Address2 = new SqlParameter() { ParameterName = "Address2", Value = newCPA.Address2 }; SqlParameter City = new SqlParameter() { ParameterName = "City", Value = newCPA.City }; SqlParameter State = new SqlParameter() { ParameterName = "State", Value = newCPA.State }; SqlParameter ZipCode = new SqlParameter() { ParameterName = "ZipCode", Value = newCPA.ZipCode }; SqlParameter Phone = new SqlParameter() { ParameterName = "Phone", Value = newCPA.PhoneNumber }; SqlParameter FirstName = new SqlParameter() { ParameterName = "FirstName", Value = newCPA.FirstName }; SqlParameter LastName = new SqlParameter() { ParameterName = "LastName", Value = newCPA.LastName }; SqlParameter DateOfBirth = new SqlParameter() { ParameterName = "DateOfBirth", Value = newCPA.DateOfBirth }; SqlParameter Gender = new SqlParameter() { ParameterName = "Gender", Value = newCPA.Gender }; //SqlParameter SpecialityID = new SqlParameter() { ParameterName = "SpecialityID", Value = newCPA.SpecialityID }; SqlParameter Email = new SqlParameter() { ParameterName = "Email", Value = newCPA.Email }; SqlParameter Password = new SqlParameter() {ParameterName = "Password", Value=newCPA.Password }; SqlParameter CPAImage = new SqlParameter() { ParameterName = "CPAImage", Value = newCPA.Image }; SqlParameter Speciality = new SqlParameter() { ParameterName = "Speciality", Value = newCPA.Speciality }; DBHelper.ExecuteStoredProcedure(StoredProcedure.SignUpNewCPA, Address1 , Address2 , City , State , ZipCode , Phone , FirstName , LastName ,DateOfBirth, Gender ,Email,Password,CompanyName,CPAImage,Speciality); } catch (Exception ex) { result = false; throw ex; } return result; }
internal static bool UpdateCPADetails(CPADetails cpa) { bool result = true; try { SqlParameter CompanyName = new SqlParameter() { ParameterName = "CompanyName", Value = cpa.CompanyName }; SqlParameter Address1 = new SqlParameter() { ParameterName = "Address1", Value = cpa.Address1 }; SqlParameter Address2 = new SqlParameter() { ParameterName = "Address2", Value = cpa.Address2 }; SqlParameter City = new SqlParameter() { ParameterName = "City", Value = cpa.City }; SqlParameter State = new SqlParameter() { ParameterName = "State", Value = cpa.State }; SqlParameter ZipCode = new SqlParameter() { ParameterName = "ZipCode", Value = cpa.ZipCode }; SqlParameter PhoneNumber = new SqlParameter() { ParameterName = "PhoneNumber", Value = cpa.PhoneNumber }; SqlParameter FirstName = new SqlParameter() { ParameterName = "FirstName", Value = cpa.FirstName }; SqlParameter LastName = new SqlParameter() { ParameterName = "LastName", Value = cpa.LastName }; SqlParameter Gender = new SqlParameter() { ParameterName = "Gender", Value = cpa.Gender }; SqlParameter SpecialityID = new SqlParameter() { ParameterName = "SpecialityID", Value = cpa.SpecialityID }; SqlParameter Email = new SqlParameter() { ParameterName = "Email", Value = cpa.Email }; //SqlParameter Password = new SqlParameter() { ParameterName = "Password", Value = cpa.Password }; SqlParameter CPAImage = new SqlParameter() { ParameterName = "CPAImage", Value = cpa.Image }; SqlParameter UserID = new SqlParameter() { ParameterName = "UserID", Value = cpa.UserID }; SqlParameter DateOFBirth = new SqlParameter() { ParameterName = "DateOfBirth", Value = cpa.DateOfBirth }; SqlParameter Speciality = new SqlParameter() { ParameterName = "Speciality", Value = cpa.Speciality }; DBHelper.ExecuteStoredProcedure(StoredProcedure.UpdateCPA, Address1, Address2, City, State, ZipCode, PhoneNumber, FirstName, LastName, Gender, SpecialityID, Email, CompanyName, DateOFBirth, CPAImage, UserID, Speciality); } catch (Exception ex) { result = false; throw ex; } return result; }
internal static bool CreateNewTempCPA(CPADetails newCPA) { bool result = true; try { SqlParameter CompanyName = new SqlParameter() { ParameterName = "CompanyName", Value = newCPA.CompanyName }; SqlParameter Address1 = new SqlParameter() { ParameterName = "Address1", Value = newCPA.Address1 }; SqlParameter Address2 = new SqlParameter() { ParameterName = "Address2", Value = newCPA.Address2 }; SqlParameter City = new SqlParameter() { ParameterName = "City", Value = newCPA.City }; SqlParameter State = new SqlParameter() { ParameterName = "State", Value = newCPA.State }; SqlParameter ZipCode = new SqlParameter() { ParameterName = "ZipCode", Value = newCPA.ZipCode }; SqlParameter Phone = new SqlParameter() { ParameterName = "Phone", Value = newCPA.PhoneNumber }; SqlParameter FirstName = new SqlParameter() { ParameterName = "FirstName", Value = newCPA.FirstName }; SqlParameter LastName = new SqlParameter() { ParameterName = "LastName", Value = newCPA.LastName }; SqlParameter DateOfBirth = new SqlParameter() { ParameterName = "DateOfBirth", Value = newCPA.DateOfBirth }; SqlParameter Gender = new SqlParameter() { ParameterName = "Gender", Value = newCPA.Gender }; //SqlParameter SpecialityID = new SqlParameter() { ParameterName = "SpecialityID", Value = newCPA.SpecialityID }; SqlParameter Email = new SqlParameter() { ParameterName = "Email", Value = newCPA.Email }; SqlParameter Password = new SqlParameter() { ParameterName = "Password", Value = newCPA.Password }; SqlParameter CPAImage = new SqlParameter() { ParameterName = "CPAImage", Value = newCPA.Image }; SqlParameter Speciality = new SqlParameter() { ParameterName = "Speciality", Value = newCPA.Speciality }; SqlParameter ActivationToken = new SqlParameter() { ParameterName = "ActivationToken", Value = newCPA.ActivationToken }; SqlParameter CreatedDate = new SqlParameter() { ParameterName = "CreatedDate", Value = newCPA.CreatedDate }; SqlParameter Latitude = new SqlParameter() { ParameterName = "Latitude", Value = newCPA.Latitude }; SqlParameter Longitude = new SqlParameter() { ParameterName = "Longitude", Value = newCPA.Longitude }; SqlParameter TimeZoneID = new SqlParameter() { ParameterName = "TimeZoneID", Value = newCPA.TimeZoneID }; DBHelper.ExecuteStoredProcedure(StoredProcedure.SignUpNewTempCPA, Address1, Address2, City, State, ZipCode, Phone, FirstName, LastName, DateOfBirth, Gender, Email, Password, CompanyName, CPAImage, Speciality, ActivationToken, CreatedDate, Latitude, Longitude, TimeZoneID); } catch (Exception ex) { result = false; throw ex; } return(result); }
internal static bool UpdateCPADetails(CPADetails cpa) { bool result = true; try { SqlParameter CompanyName = new SqlParameter() { ParameterName = "CompanyName", Value = cpa.CompanyName }; SqlParameter Address1 = new SqlParameter() { ParameterName = "Address1", Value = cpa.Address1 }; SqlParameter Address2 = new SqlParameter() { ParameterName = "Address2", Value = cpa.Address2 }; SqlParameter City = new SqlParameter() { ParameterName = "City", Value = cpa.City }; SqlParameter State = new SqlParameter() { ParameterName = "State", Value = cpa.State }; SqlParameter ZipCode = new SqlParameter() { ParameterName = "ZipCode", Value = cpa.ZipCode }; SqlParameter PhoneNumber = new SqlParameter() { ParameterName = "PhoneNumber", Value = cpa.PhoneNumber }; SqlParameter FirstName = new SqlParameter() { ParameterName = "FirstName", Value = cpa.FirstName }; SqlParameter LastName = new SqlParameter() { ParameterName = "LastName", Value = cpa.LastName }; SqlParameter Gender = new SqlParameter() { ParameterName = "Gender", Value = cpa.Gender }; SqlParameter SpecialityID = new SqlParameter() { ParameterName = "SpecialityID", Value = cpa.SpecialityID }; SqlParameter Email = new SqlParameter() { ParameterName = "Email", Value = cpa.Email }; //SqlParameter Password = new SqlParameter() { ParameterName = "Password", Value = cpa.Password }; SqlParameter CPAImage = new SqlParameter() { ParameterName = "CPAImage", Value = cpa.Image }; SqlParameter UserID = new SqlParameter() { ParameterName = "UserID", Value = cpa.UserID }; SqlParameter DateOFBirth = new SqlParameter() { ParameterName = "DateOfBirth", Value = cpa.DateOfBirth }; SqlParameter Speciality = new SqlParameter() { ParameterName = "Speciality", Value = cpa.Speciality }; DBHelper.ExecuteStoredProcedure(StoredProcedure.UpdateCPA, Address1, Address2, City, State, ZipCode, PhoneNumber, FirstName, LastName, Gender, SpecialityID, Email, CompanyName, DateOFBirth, CPAImage, UserID, Speciality); } catch (Exception ex) { result = false; throw ex; } return(result); }