public DataTable GetPendingApprovalData() { try { SqlConnection sqlConnection = ConnectionHandler.GetConnection(); SqlCommand sqlCommand = new SqlCommand(); sqlCommand.Connection = sqlConnection; sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.CommandText = "GetPendingUsers"; SqlDataAdapter sqlDataAdaper = new SqlDataAdapter(sqlCommand); DataTable dt = new DataTable(); sqlDataAdaper.Fill(dt); if (dt.Rows.Count > 0) { return(dt); } else { return(new DataTable()); } } catch (Exception ex) { return(new DataTable()); } }
public void DALAddPackageDetails(PackageDetails package_details) { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("DALAddPackageDetails", _sqlConnection); _sqlCommand.CommandType = CommandType.StoredProcedure; _sqlCommand.Parameters.Add("@customer_Id", SqlDbType.VarChar).Value = package_details.Customer_Id; _sqlCommand.Parameters.Add("@sender_Address", SqlDbType.VarChar).Value = package_details.Sender_Address; _sqlCommand.Parameters.Add("@receiver_Address", SqlDbType.VarChar).Value = package_details.Reciver_Address; _sqlCommand.Parameters.Add("@package_Weight", SqlDbType.Float).Value = package_details.Package_Weight; _sqlCommand.Parameters.Add("@cost", SqlDbType.Float).Value = package_details.Cost; //_sqlCommand.Parameters.AddWithValue("@pk_Customer_id", package_details.Customer_Id); //_sqlCommand.Parameters.AddWithValue("@pk_Sender_address", package_details.Sender_Address); //_sqlCommand.Parameters.AddWithValue("@pk_Receiver_address ", package_details.Receiver_Address); //_sqlCommand.Parameters.AddWithValue("@pk_Package_weight", package_details.Package_Weight); //_sqlCommand.Parameters.AddWithValue("@pk_cost", package_details.Cost); try { _sqlConnection.Open(); if (_sqlConnection.State == ConnectionState.Open) { _sqlCommand.ExecuteNonQuery(); } } catch (Exception ex) { } finally { _sqlConnection.Close(); } }
public PackageDetails DALGetPackagesDetails(long packageId) { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("DALGetPackagesDetails", _sqlConnection); _sqlCommand.CommandType = CommandType.StoredProcedure; _sqlCommand.Parameters.Add("@packageId", SqlDbType.Int).Value = packageId; //_sqlCommand.Parameters.AddWithValue("@packageId", packageId); SqlDataAdapter _sqlDataAdapter = new SqlDataAdapter(_sqlCommand); DataTable _dataTable = new DataTable(); _sqlDataAdapter.Fill(_dataTable); if (_dataTable.Rows.Count > 0) { DataRow _dataRow = _dataTable.Rows[0]; PackageDetails package_list = new PackageDetails ( long.Parse(_dataRow["pk_Customer_id"].ToString()), _dataRow["pk_Sender_address"].ToString(), _dataRow["pk_Receiver_address"].ToString(), float.Parse(_dataRow["pk_Package_weight"].ToString()), float.Parse(_dataRow["pk_cost"].ToString()) ); return(package_list); } else { return(new PackageDetails()); } }
public bool DALUserLoginValidate(string userId, string password) { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("DALUserLoginValidate", _sqlConnection); _sqlCommand.CommandType = CommandType.StoredProcedure; _sqlCommand.Parameters.Add("@userId", SqlDbType.VarChar).Value = userId; _sqlCommand.Parameters.Add("@password", SqlDbType.VarChar).Value = password; try { _sqlConnection.Open(); if (_sqlConnection.State == ConnectionState.Open) { SqlDataReader read = _sqlCommand.ExecuteReader(); while (read.Read()) { if (read[0].ToString() == userId && read[1].ToString() == password) { return(true); } else { return(false); } } } } catch (Exception ex) { return(false); } finally { _sqlConnection.Close(); } return(false); }
public List <DoctorDetails> DisplayDoctorDetails() { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("getdoctordetails", _sqlConnection); _sqlCommand.CommandType = CommandType.Text; _sqlCommand.CommandType = System.Data.CommandType.StoredProcedure; _sqlCommand.Connection = _sqlConnection; SqlDataAdapter _sqlDataAdapter = new SqlDataAdapter(_sqlCommand); DataTable _dataTable = new DataTable(); _sqlDataAdapter.Fill(_dataTable); List <DoctorDetails> doctorDetails = new List <DoctorDetails>(); if (_dataTable.Rows.Count > 0) { foreach (DataRow _dataRow in _dataTable.Rows) { doctorDetails.Add(new DoctorDetails ( int.Parse(_dataRow["DoctorID"].ToString()), _dataRow["FirstName"].ToString(), _dataRow["LastName"].ToString(), int.Parse(_dataRow["Age"].ToString()), _dataRow["Gender"].ToString(), _dataRow["DoB"].ToString(), double.Parse(_dataRow["ContactNumber"].ToString()), double.Parse(_dataRow["AltContactNumber"].ToString()), _dataRow["EmailId"].ToString(), _dataRow["UserName"].ToString(), _dataRow["Password"].ToString(), _dataRow["AddressLine1"].ToString(), _dataRow["AddressLine2"].ToString(), _dataRow["City"].ToString(), _dataRow["State"].ToString(), int.Parse(_dataRow["Zipcode"].ToString()), _dataRow["Degree"].ToString(), _dataRow["Specialty"].ToString(), int.Parse(_dataRow["Workhours"].ToString()), _dataRow["HospitalName"].ToString(), int.Parse(_dataRow["MedicareServiceID"].ToString()), _dataRow["Isapproved"].ToString().Equals("True") ? true : false, DateTime.Parse(_dataRow["Isapproved_on"].ToString()) )); } return(doctorDetails); } else { return(new List <DoctorDetails>()); } } catch (Exception ex) { return(new List <DoctorDetails>()); } }
public List <TestResultdetails> DisplayTestResults() { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("gettestresults", _sqlConnection); _sqlCommand.CommandType = CommandType.Text; _sqlCommand.CommandType = System.Data.CommandType.StoredProcedure; _sqlCommand.Connection = _sqlConnection; _sqlConnection.Open(); SqlDataAdapter _sqlDataAdapter = new SqlDataAdapter(_sqlCommand); DataTable _dataTable = new DataTable(); _sqlDataAdapter.Fill(_dataTable); List <TestResultdetails> testresults = new List <TestResultdetails>(); if (_dataTable.Rows.Count > 0) { foreach (DataRow _dataRow in _dataTable.Rows) { testresults.Add(new TestResultdetails( int.Parse(_dataRow["PatientId"].ToString()), int.Parse(_dataRow["doctorid"].ToString()), int.Parse(_dataRow["medicareService"].ToString()), int.Parse(_dataRow["agentId"].ToString()), _dataRow["servicedate"].ToString(), _dataRow["testresultdate"].ToString(), _dataRow["diag1_normal_value"].ToString(), _dataRow["diag1_actual_value"].ToString(), _dataRow["diag2_normal_value"].ToString(), _dataRow["diag2_actual_value"].ToString(), _dataRow["diag3_normal_value"].ToString(), _dataRow["diag3_actual_value"].ToString(), _dataRow["diag4_normal_value"].ToString(), _dataRow["diag4_actual_value"].ToString(), _dataRow["diag5_normal_value"].ToString(), _dataRow["diag5_actual_value"].ToString(), _dataRow["diag6_normal_value"].ToString(), _dataRow["diag6_actual_value"].ToString(), _dataRow["doctor_comments"].ToString(), _dataRow["Otherinfo"].ToString() ) ); } return(testresults); } else { return(new List <TestResultdetails>()); } } catch (Exception ex) { return(new List <TestResultdetails>()); } }
public DataTable DALGetPackageId(string userId) { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("DALGetPackageId", _sqlConnection); _sqlCommand.CommandType = CommandType.StoredProcedure; _sqlCommand.Parameters.Add("@userId", SqlDbType.Int).Value = userId; SqlDataAdapter _sqlDataAdapter = new SqlDataAdapter(_sqlCommand); DataTable _dataTable = new DataTable(); _sqlDataAdapter.Fill(_dataTable); return(_dataTable); }
public bool RegDoctorDetails(DoctorDetails doctorDetails) { try { if (doctorDetails != null) { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); _sqlConnection.Open(); SqlCommand _sqlCommand = new SqlCommand("RegisterDoctordetails", _sqlConnection); _sqlCommand.CommandType = System.Data.CommandType.StoredProcedure; _sqlCommand.Connection = _sqlConnection; //_sqlCommand.CommandText = "insert into Doctor(FirstName,LastName,Age,Gender,DoB,ContactNumber,AltContactNumber,EmailId,UserName,Password,AddressLine1,AddressLine2,City,State,Zipcode,Degree,Speciality,Workhours,HospitalName,MedicareServiceID) values(@Firstname,@Lastname,@Age,@Gender,@DoB,@ContactNumber,@AltContactNumber,@Emailid,@UserName,@Password,@AddressLine1,@AddressLine2,@City,@State,@Zipcode,@Degree,@Speciality,@Workhours,@HospitalName,@MedicareServiceID)"; _sqlCommand.Parameters.AddWithValue("@FirstName", doctorDetails.FirstName1); _sqlCommand.Parameters.AddWithValue("@LastName", doctorDetails.LastName1); _sqlCommand.Parameters.AddWithValue("@Age", doctorDetails.Age1); _sqlCommand.Parameters.AddWithValue("@Gender", doctorDetails.Gender1); _sqlCommand.Parameters.AddWithValue("@DoB", doctorDetails.DoB1); _sqlCommand.Parameters.AddWithValue("@ContactNumber", doctorDetails.ContactNumber1); _sqlCommand.Parameters.AddWithValue("@AltContactNumber", doctorDetails.AltContactNumber1); _sqlCommand.Parameters.AddWithValue("@Emailid", doctorDetails.EmailID1); _sqlCommand.Parameters.AddWithValue("@UserName", doctorDetails.UserName1); _sqlCommand.Parameters.AddWithValue("@Password", doctorDetails.Password1); _sqlCommand.Parameters.AddWithValue("@AddressLine1", doctorDetails.AddressLine11); _sqlCommand.Parameters.AddWithValue("@AddressLine2", doctorDetails.AddressLine21); _sqlCommand.Parameters.AddWithValue("@City", doctorDetails.City1); _sqlCommand.Parameters.AddWithValue("@State", doctorDetails.State1); _sqlCommand.Parameters.AddWithValue("@Zipcode", doctorDetails.Zipcode1); _sqlCommand.Parameters.AddWithValue("@Degree", doctorDetails.Degree1); _sqlCommand.Parameters.AddWithValue("@Specialty", doctorDetails.Specialty1); _sqlCommand.Parameters.AddWithValue("@Workhours", doctorDetails.Workhours1); _sqlCommand.Parameters.AddWithValue("@HospitalName", doctorDetails.HospitalName1); _sqlCommand.Parameters.AddWithValue("@MedicareServiceID", doctorDetails.MedicareServiceID1); //_sqlCommand.Parameters.AddWithValue("@Isapproved", doctorDetails.Isapproved1); //_sqlCommand.Parameters.AddWithValue("@IsApprovedOn", doctorDetails.Isapproved_On1); int result1 = _sqlCommand.ExecuteNonQuery(); _sqlConnection.Close(); return(true); } else { return(false); } } catch (Exception ex) { return(false); } }
public List <AdminDetails> DisplayAdminDetails() { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("getadmindetails", _sqlConnection); _sqlCommand.CommandType = CommandType.Text; _sqlCommand.CommandType = System.Data.CommandType.StoredProcedure; _sqlCommand.Connection = _sqlConnection; SqlDataAdapter _sqlDataAdapter = new SqlDataAdapter(_sqlCommand); DataTable _dataTable = new DataTable(); _sqlDataAdapter.Fill(_dataTable); List <AdminDetails> adminDetails = new List <AdminDetails>(); if (_dataTable.Rows.Count > 0) { foreach (DataRow _dataRow in _dataTable.Rows) { adminDetails.Add(new AdminDetails ( int.Parse(_dataRow["AdminId"].ToString()), _dataRow["FirstName"].ToString(), _dataRow["LastName"].ToString(), int.Parse(_dataRow["Age"].ToString()), _dataRow["Gender"].ToString(), _dataRow["DoB"].ToString(), double.Parse(_dataRow["ContactNumber"].ToString()), double.Parse(_dataRow["AltContactNumber"].ToString()), _dataRow["EmailId"].ToString(), _dataRow["UserName"].ToString(), _dataRow["Password"].ToString(), _dataRow["Isapproved"].ToString().Equals("True") ? true : false, DateTime.Parse(_dataRow["Isapproved_on"].ToString()) ) ); } return(adminDetails); } else { return(new List <AdminDetails>()); } } catch (Exception ex) { return(new List <AdminDetails>()); } }
public void RemoveMedicareServices(string name) { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); _sqlConnection.Open(); SqlCommand _sqlCommand = new SqlCommand(); _sqlCommand.Connection = _sqlConnection; _sqlCommand.CommandType = CommandType.StoredProcedure; _sqlCommand.CommandText = "removemedicareservices"; _sqlCommand.Parameters.AddWithValue("@MedicareService", name); int res = _sqlCommand.ExecuteNonQuery(); _sqlConnection.Close(); } catch (Exception ex) { } }
public void RemoveDoctor(int DoctorID) { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); _sqlConnection.Open(); SqlCommand _sqlCommand = new SqlCommand(); _sqlCommand.CommandType = CommandType.Text; _sqlCommand.Connection = _sqlConnection; _sqlCommand.CommandText = "delete from Doctor where DoctorID=@doctorid"; _sqlCommand.Parameters.AddWithValue("@doctorid", DoctorID); int res = _sqlCommand.ExecuteNonQuery(); _sqlConnection.Close(); } catch (Exception ex) { } }
public void RemovePatient(string name) { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); _sqlConnection.Open(); SqlCommand _sqlCommand = new SqlCommand(); _sqlCommand.CommandType = CommandType.Text; _sqlCommand.Connection = _sqlConnection; _sqlCommand.CommandText = "delete from Patient where FirstName=@patientname"; _sqlCommand.Parameters.AddWithValue("@patientname", name); int res = _sqlCommand.ExecuteNonQuery(); _sqlConnection.Close(); } catch (Exception ex) { } }
// the staff and admin details are get bounded in web page public EmployeeDetails DALGetAdminDetails(string userId, string login_type) { SqlCommand _sqlCommand = new SqlCommand(); SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); _sqlCommand.CommandType = CommandType.Text; _sqlCommand.Connection = _sqlConnection; _sqlCommand.CommandText = "select * from Cts_Management_Master where mm_userId = @userId and mm_LoginType = @login_type"; _sqlCommand.Parameters.AddWithValue("@login_type", login_type); _sqlCommand.Parameters.AddWithValue("@userId", userId); SqlDataAdapter _sqlDataAdapter = new SqlDataAdapter(_sqlCommand); DataTable _dataTable = new DataTable(); _sqlDataAdapter.Fill(_dataTable); if (_dataTable.Rows.Count > 0) { DataRow _dataRow = _dataTable.Rows[0]; EmployeeDetails package_list = new EmployeeDetails ( _dataRow["mm_firstName "].ToString(), _dataRow["mm_lastName "].ToString(), _dataRow["mm_gender "].ToString(), _dataRow["mm_emailId "].ToString(), long.Parse(_dataRow["mm_contact "].ToString()), _dataRow["mm_userId "].ToString(), _dataRow["mm_password "].ToString(), long.Parse(_dataRow["mm_Salary "].ToString()), _dataRow["mm_Designation "].ToString(), _dataRow["mm_PerAddress "].ToString(), _dataRow["mm_CorAddress "].ToString(), _dataRow["mm_LoginType "].ToString(), bool.Parse(_dataRow["mm_isActive "].ToString()), DateTime.Parse(_dataRow["mm_created_On "].ToString()), _dataRow["mm_created_by "].ToString(), _dataRow["mm_Approved_by "].ToString(), DateTime.Parse(_dataRow["mm_Approved_on "].ToString()) ); return(package_list); } else { return(new EmployeeDetails()); } }
// the staff and admin details are get bounded in web page public List <EmployeeDetails> DALGetAdminDetails(string userId, string login_type) { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("GetAdminDetails", _sqlConnection); _sqlCommand.CommandType = CommandType.StoredProcedure; _sqlCommand.Parameters.Add("@login_type", SqlDbType.VarChar).Value = login_type; _sqlCommand.Parameters.Add("@userId", SqlDbType.VarChar).Value = userId; SqlDataAdapter _sqlDataAdapter = new SqlDataAdapter(_sqlCommand); DataTable _dataTable = new DataTable(); _sqlDataAdapter.Fill(_dataTable); if (_dataTable.Rows.Count > 0) { DataRow _dataRow = _dataTable.Rows[0]; List <EmployeeDetails> package_list = new List <EmployeeDetails>(); package_list.Add( new EmployeeDetails ( _dataRow["mm_firstName"].ToString(), _dataRow["mm_lastName"].ToString(), _dataRow["mm_gender"].ToString(), _dataRow["mm_emailId"].ToString(), long.Parse(_dataRow["mm_contact"].ToString()), _dataRow["mm_userId"].ToString(), _dataRow["mm_password"].ToString(), long.Parse(_dataRow["mm_Salary"].ToString()), _dataRow["mm_Designation"].ToString(), _dataRow["mm_PerAddress"].ToString(), _dataRow["mm_CorAddress"].ToString(), _dataRow["mm_LoginType"].ToString(), DateTime.Parse(_dataRow["mm_created_On"].ToString()), _dataRow["mm_created_by"].ToString(), _dataRow["mm_Approved_by"].ToString(), DateTime.Parse(_dataRow["mm_Approved_on"].ToString()) ) ); return(package_list); } else { return(new List <EmployeeDetails>()); } }
public void DALAddUserDetails(UserDetails user_details) { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("DALaddUserDetails", _sqlConnection); _sqlCommand.CommandType = CommandType.StoredProcedure; _sqlCommand.Parameters.Add("@first_Name", SqlDbType.VarChar).Value = user_details.First_Name; _sqlCommand.Parameters.Add("@last_Name", SqlDbType.VarChar).Value = user_details.Last_Name; _sqlCommand.Parameters.Add("@gender", SqlDbType.VarChar).Value = user_details.Gender; _sqlCommand.Parameters.Add("@email", SqlDbType.VarChar).Value = user_details.Email; _sqlCommand.Parameters.Add("@contact_Number", SqlDbType.VarChar).Value = user_details.Contact_Number; _sqlCommand.Parameters.Add("@user_Id", SqlDbType.VarChar).Value = user_details.User_Id; _sqlCommand.Parameters.Add("@password", SqlDbType.VarChar).Value = user_details.Password; _sqlCommand.Parameters.Add("@isActive", SqlDbType.Bit).Value = user_details.IsActive; _sqlCommand.Parameters.Add("@createdOn", SqlDbType.Date).Value = user_details.CreatedOn; _sqlCommand.Parameters.Add("@createdBy", SqlDbType.VarChar).Value = user_details.CreatedBy; //_sqlCommand.Parameters.AddWithValue("@first_Name", user_details.First_Name); //_sqlCommand.Parameters.AddWithValue("@last_Name", user_details.Last_Name); //_sqlCommand.Parameters.AddWithValue("@gender", user_details.Gender); //_sqlCommand.Parameters.AddWithValue("@email", user_details.Email); //_sqlCommand.Parameters.AddWithValue("@contact_Number", user_details.Contact_Number); //_sqlCommand.Parameters.AddWithValue("@user_Id", user_details.User_Id); //_sqlCommand.Parameters.AddWithValue("@password", user_details.Password); //_sqlCommand.Parameters.AddWithValue("@isActive", user_details.IsActive); //_sqlCommand.Parameters.AddWithValue("@createdOn", user_details.CreatedOn); //_sqlCommand.Parameters.AddWithValue("@createdBy", user_details.CreatedBy); try { _sqlConnection.Open(); if (_sqlConnection.State == ConnectionState.Open) { _sqlCommand.ExecuteNonQuery(); } } catch (Exception ex) { } finally { _sqlConnection.Close(); } }
public DataSet Getalldata() { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("getalldata", _sqlConnection); _sqlCommand.CommandType = CommandType.Text; _sqlCommand.CommandType = System.Data.CommandType.StoredProcedure; _sqlCommand.Connection = _sqlConnection; SqlDataAdapter _sqldataadapter = new SqlDataAdapter(_sqlCommand); DataSet ds = new DataSet(); _sqldataadapter.Fill(ds); return(ds); } catch (Exception ex) { return(new DataSet()); } }
public bool RegPatientDetails(PatientDetails patientDetails) { try { if (patientDetails != null) { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); _sqlConnection.Open(); SqlCommand _sqlCommand = new SqlCommand("Registerpatientdetails", _sqlConnection); _sqlCommand.CommandType = System.Data.CommandType.StoredProcedure; _sqlCommand.Connection = _sqlConnection; _sqlCommand.Parameters.AddWithValue("@Firstname", patientDetails.FirstName1); _sqlCommand.Parameters.AddWithValue("@Lastname", patientDetails.LastName1); _sqlCommand.Parameters.AddWithValue("@Age", patientDetails.Age1); _sqlCommand.Parameters.AddWithValue("@Gender", patientDetails.Gender1); _sqlCommand.Parameters.AddWithValue("@DoB", patientDetails.DoB1); _sqlCommand.Parameters.AddWithValue("@ContactNumber", patientDetails.ContactNumber1); _sqlCommand.Parameters.AddWithValue("@AltContactNumber", patientDetails.AltContactNumber1); _sqlCommand.Parameters.AddWithValue("@Emailid", patientDetails.EmailId1); _sqlCommand.Parameters.AddWithValue("@UserName", patientDetails.UserName1); _sqlCommand.Parameters.AddWithValue("@Password", patientDetails.Password1); _sqlCommand.Parameters.AddWithValue("@AddressLine1", patientDetails.AddressLine11); _sqlCommand.Parameters.AddWithValue("@AddressLine2", patientDetails.AddressLine21); _sqlCommand.Parameters.AddWithValue("@City", patientDetails.City1); _sqlCommand.Parameters.AddWithValue("@State", patientDetails.State1); _sqlCommand.Parameters.AddWithValue("@Zipcode", patientDetails.Zipcode1); //_sqlCommand.Parameters.AddWithValue("@Isapproved", doctorDetails.Isapproved1); //_sqlCommand.Parameters.AddWithValue("@IsApprovedOn", doctorDetails.Isapproved_On1); int result = _sqlCommand.ExecuteNonQuery(); _sqlConnection.Close(); return(true); } else { return(false); } } catch (Exception ex) { return(false); } }
public List <MedicareServices> DisplayMedicareServices() { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("getmedicareservices", _sqlConnection); _sqlCommand.CommandType = CommandType.Text; _sqlCommand.CommandType = System.Data.CommandType.StoredProcedure; _sqlCommand.Connection = _sqlConnection; SqlDataAdapter _sqlDataAdapter = new SqlDataAdapter(_sqlCommand); DataTable _dataTable = new DataTable(); _sqlDataAdapter.Fill(_dataTable); List <MedicareServices> medicareservices = new List <MedicareServices>(); if (_dataTable.Rows.Count > 0) { foreach (DataRow _dataRow in _dataTable.Rows) { medicareservices.Add(new MedicareServices( int.Parse(_dataRow["MedicareServicesId"].ToString()), _dataRow["Medicare_service"].ToString(), _dataRow["Service_Description"].ToString(), int.Parse(_dataRow["Amount"].ToString()) ) ); } return(medicareservices); } else { return(new List <MedicareServices>()); } } catch (Exception ex) { return(new List <MedicareServices>()); } }
public DataTable gettestdetails(int id) { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("gettestresultspatient", _sqlConnection); _sqlCommand.CommandType = CommandType.Text; _sqlCommand.CommandType = System.Data.CommandType.StoredProcedure; _sqlCommand.Connection = _sqlConnection; _sqlCommand.Parameters.AddWithValue("@patientid", id); SqlDataAdapter _sqldataadapter = new SqlDataAdapter(_sqlCommand); DataTable ds = new DataTable(); _sqldataadapter.Fill(ds); return(ds); } catch (Exception ex) { return(new DataTable()); } }
public void AddMedicareServices(MedicareServices medicareservices) { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand(); _sqlCommand.Connection = _sqlConnection; _sqlCommand.CommandType = CommandType.StoredProcedure; _sqlCommand.CommandText = "addmedicareservices"; _sqlCommand.Parameters.AddWithValue("@MedicareService", medicareservices.Medicare_service1); _sqlCommand.Parameters.AddWithValue("@ServiceDescription", medicareservices.Service_Description1); _sqlCommand.Parameters.AddWithValue("@Amount", medicareservices.Amount1); _sqlConnection.Open(); int result = _sqlCommand.ExecuteNonQuery(); _sqlConnection.Close(); } catch (Exception ex) { } }
public void DALAddAdminDetails(EmployeeDetails employee_Details) { SqlCommand _sqlCommand = new SqlCommand(); SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); _sqlCommand.CommandType = CommandType.Text; _sqlCommand.Connection = _sqlConnection; _sqlCommand.CommandText = "insert into Cts_Management_Master(mm_firstName,mm_lastName,mm_gender,mm_emailId,mm_contact,mm_userId,mm_password,mm_Salary,mm_Designation,mm_PerAddress,mm_CorAddress,mm_LoginType,mm_isActive,mm_created_On,mm_created_by,mm_Approved_by,mm_Approved_on)values(@first_Name,@last_Name,@gender,@email,@contact_Number,@user_Id,@password,@salary,@designation,@permanent_Address,@correspondence_Address,@login_type,@isActive,@createdOn,@createdBy,@approvedBy,@approvedOn)"; _sqlCommand.Parameters.AddWithValue("@first_Name", employee_Details.First_Name); _sqlCommand.Parameters.AddWithValue("@last_Name", employee_Details.Last_Name); _sqlCommand.Parameters.AddWithValue("@gender", employee_Details.Gender); _sqlCommand.Parameters.AddWithValue("@email", employee_Details.Email); _sqlCommand.Parameters.AddWithValue("@contact_Number", employee_Details.Contact_Number); _sqlCommand.Parameters.AddWithValue("@user_Id", employee_Details.User_Id); _sqlCommand.Parameters.AddWithValue("@password", employee_Details.Password); _sqlCommand.Parameters.AddWithValue("@salary", employee_Details.Salary); _sqlCommand.Parameters.AddWithValue("@designation", employee_Details.Designation); _sqlCommand.Parameters.AddWithValue("@permanent_Address", employee_Details.Permanent_Address); _sqlCommand.Parameters.AddWithValue("@correspondence_Address", employee_Details.Correspondence_Address); _sqlCommand.Parameters.AddWithValue("@login_type", employee_Details.Login_type); _sqlCommand.Parameters.AddWithValue("@isActive", employee_Details.IsActive); _sqlCommand.Parameters.AddWithValue("@createdOn", employee_Details.CreatedOn); _sqlCommand.Parameters.AddWithValue("@createdBy", employee_Details.CreatedBy); _sqlCommand.Parameters.AddWithValue("@approvedBy", employee_Details.ApprovedBy); _sqlCommand.Parameters.AddWithValue("@approvedOn", employee_Details.ApprovedOn); try { _sqlConnection.Open(); if (_sqlConnection.State == ConnectionState.Open) { _sqlCommand.ExecuteNonQuery(); } } catch (Exception ex) { } finally { _sqlConnection.Close(); } }
public UserDetails DALGetUserDetails(string customerId) { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("DALGetUserDetails", _sqlConnection); _sqlCommand.CommandType = CommandType.StoredProcedure; _sqlCommand.Parameters.Add("@customerId", SqlDbType.VarChar).Value = customerId; //_sqlCommand.Parameters.AddWithValue("@customerId", customerId); SqlDataAdapter _sqlDataAdapter = new SqlDataAdapter(_sqlCommand); DataTable _dataTable = new DataTable(); _sqlDataAdapter.Fill(_dataTable); if (_dataTable.Rows.Count > 0) { DataRow _dataRow = _dataTable.Rows[0]; UserDetails user_list = new UserDetails ( _dataRow["um_firstName"].ToString(), _dataRow["um_lastName"].ToString(), _dataRow["um_gender"].ToString(), _dataRow["um_emailId"].ToString(), _dataRow["um_contact"].ToString(), _dataRow["um_userId"].ToString(), _dataRow["um_password"].ToString(), bool.Parse(_dataRow["um_isActive"].ToString()), DateTime.Parse(_dataRow["um_created_On"].ToString()), _dataRow["um_created_By"].ToString() ); return(user_list); } else { return(new UserDetails()); } } catch (Exception ex) { return(new UserDetails()); } }
// the staff and admin can modify there profile public void DALModifyAdminDetails(string userId, EmployeeDetails employee_Details, string login_type) { SqlCommand _sqlCommand = new SqlCommand(); SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); _sqlCommand.CommandType = CommandType.Text; _sqlCommand.Connection = _sqlConnection; _sqlCommand.CommandText = "update Cts_Management_Master set mm_firstName=@first_Name,mm_lastName=@last_Name,mm_gender=@gender,mm_emailId=@email,mm_contact=@contact_Number,mm_password=@password,mm_Salary=@salary,mm_Designation=@designation,mm_PerAddress=@permanent_Address,mm_CorAddress=@correspondence_Address,mm_LoginType=@login_type,mm_isActive=@isActive,mm_created_On=@createdOn,mm_created_by=@createdBy,mm_Approved_by=@approvedBy,mm_Approved_on=@approvedOn where um_userId = @userId and login_type = @login_type"; _sqlCommand.Parameters.AddWithValue("@first_Name", employee_Details.First_Name); _sqlCommand.Parameters.AddWithValue("@last_Name", employee_Details.Last_Name); _sqlCommand.Parameters.AddWithValue("@gender", employee_Details.Gender); _sqlCommand.Parameters.AddWithValue("@email", employee_Details.Email); _sqlCommand.Parameters.AddWithValue("@contact_Number", employee_Details.Contact_Number); _sqlCommand.Parameters.AddWithValue("@password", employee_Details.Password); _sqlCommand.Parameters.AddWithValue("@salary", employee_Details.Salary); _sqlCommand.Parameters.AddWithValue("@designation", employee_Details.Designation); _sqlCommand.Parameters.AddWithValue("@permanent_Address", employee_Details.Permanent_Address); _sqlCommand.Parameters.AddWithValue("@orrespondence_Address", employee_Details.Correspondence_Address); _sqlCommand.Parameters.AddWithValue("@login_type", employee_Details.Login_type); _sqlCommand.Parameters.AddWithValue("@isActive", employee_Details.IsActive); _sqlCommand.Parameters.AddWithValue("@createdOn", employee_Details.CreatedOn); _sqlCommand.Parameters.AddWithValue("@createdBy", employee_Details.CreatedBy); _sqlCommand.Parameters.AddWithValue("@approvedBy", employee_Details.ApprovedBy); _sqlCommand.Parameters.AddWithValue("@approvedOn", employee_Details.ApprovedOn); try { _sqlConnection.Open(); if (_sqlConnection.State == ConnectionState.Open) { _sqlCommand.ExecuteNonQuery(); } } catch (Exception ex) { } finally { _sqlConnection.Close(); } }
public DataTable GetAdminId() { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("GetAdminId", _sqlConnection); _sqlCommand.CommandType = CommandType.StoredProcedure; SqlDataAdapter dataAdapter = new SqlDataAdapter(_sqlCommand); DataTable table = new DataTable(); dataAdapter.Fill(table); return(table); //List<string> idList = new List<string>(); //if (table.Rows.Count > 0) //{ // foreach (DataRow row in table.Rows) // { // idList.Add(row.ToString()); // } // return idList; //} //else return new List<string>(); }
public List <Appointment> Displayappointment() { try { SqlConnection con = ConnectionHandler.GetConnection(); con.Open(); SqlCommand cmd = new SqlCommand(); cmd = new SqlCommand("getappointments", con); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@doctorid", 4); SqlDataAdapter _sqlDataAdapter = new SqlDataAdapter(cmd); DataTable _dataTable = new DataTable(); _sqlDataAdapter.Fill(_dataTable); List <Appointment> Appointment_Details = new List <Appointment>(); if (_dataTable.Rows.Count > 0) { foreach (DataRow _dataRow in _dataTable.Rows) { Appointment_Details.Add(new Appointment ( _dataRow["Appointmentdate"].ToString(), int.Parse(_dataRow["Medicareserviceid"].ToString()), _dataRow["Isapproved"].ToString().Equals("True") ? true : false )); } return(Appointment_Details); } else { return(new List <Appointment>()); } } catch (Exception ex) { return(new List <Appointment>()); } }
public void AddTestResults(TestResultdetails testresultdetails) { try { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand(); _sqlCommand.Connection = _sqlConnection; _sqlCommand.CommandType = CommandType.StoredProcedure; _sqlCommand.CommandText = "addtestresults"; //_sqlCommand.Parameters.AddWithValue("@reportId", testresultdetails.ReportId); _sqlCommand.Parameters.AddWithValue("@PatientId", testresultdetails.PatientId1); _sqlCommand.Parameters.AddWithValue("@doctorid", testresultdetails.Doctorid); _sqlCommand.Parameters.AddWithValue("@medicareService", testresultdetails.MedicareService); _sqlCommand.Parameters.AddWithValue("@agentId", testresultdetails.AgentId); _sqlCommand.Parameters.AddWithValue("@servicedate", testresultdetails.Servicedate); _sqlCommand.Parameters.AddWithValue("@testresultdate", testresultdetails.Testresultdate); _sqlCommand.Parameters.AddWithValue("@diag1_normal_value", testresultdetails.Diag1_normal_value); _sqlCommand.Parameters.AddWithValue("@diag1_actual_value", testresultdetails.Diag1_actual_value); _sqlCommand.Parameters.AddWithValue("@diag2_normal_value", testresultdetails.Diag2_normal_value); _sqlCommand.Parameters.AddWithValue("@diag2_actual_value", testresultdetails.Diag2_actual_value); _sqlCommand.Parameters.AddWithValue("@diag3_normal_value", testresultdetails.Diag3_normal_value); _sqlCommand.Parameters.AddWithValue("@diag3_actual_value", testresultdetails.Diag3_actual_value); _sqlCommand.Parameters.AddWithValue("@diag4_normal_value", testresultdetails.Diag4_normal_value); _sqlCommand.Parameters.AddWithValue("@diag4_actual_value", testresultdetails.Diag4_actual_value); _sqlCommand.Parameters.AddWithValue("@diag5_normal_value", testresultdetails.Diag5_normal_value); _sqlCommand.Parameters.AddWithValue("@diag5_actual_value", testresultdetails.Diag5_actual_value); _sqlCommand.Parameters.AddWithValue("@diag6_normal_value", testresultdetails.Diag6_normal_value); _sqlCommand.Parameters.AddWithValue("@diag6_actual_value", testresultdetails.Diag6_actual_value); _sqlCommand.Parameters.AddWithValue("@doctor_comments", testresultdetails.Doctor_comments); _sqlCommand.Parameters.AddWithValue("@otherinfo", testresultdetails.Otherinfo); _sqlConnection.Open(); int result = _sqlCommand.ExecuteNonQuery(); _sqlConnection.Close(); } catch (Exception ex) { } }
public bool RegAdminDetails(AdminDetails adminDetails) { try { if (adminDetails != null) { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); _sqlConnection.Open(); SqlCommand _sqlCommand = new SqlCommand("Registeradmindetails", _sqlConnection); _sqlCommand.CommandType = System.Data.CommandType.StoredProcedure; _sqlCommand.Connection = _sqlConnection; _sqlCommand.Parameters.AddWithValue("@FirstName", adminDetails.FirstName1); _sqlCommand.Parameters.AddWithValue("@LastName", adminDetails.LastName1); _sqlCommand.Parameters.AddWithValue("@Age", adminDetails.Age1); _sqlCommand.Parameters.AddWithValue("@Gender", adminDetails.Gender1); _sqlCommand.Parameters.AddWithValue("@DoB", adminDetails.DoB1); _sqlCommand.Parameters.AddWithValue("@ContactNumber", adminDetails.ContactNumber1); _sqlCommand.Parameters.AddWithValue("@AltContactNumber", adminDetails.AltContactNumber1); _sqlCommand.Parameters.AddWithValue("@Emailid", adminDetails.EmailId1); _sqlCommand.Parameters.AddWithValue("@UserName", adminDetails.UserName1); _sqlCommand.Parameters.AddWithValue("@Password", adminDetails.Password1); int result = _sqlCommand.ExecuteNonQuery(); _sqlConnection.Close(); return(true); } else { return(false); } } catch (Exception ex) { return(false); } }
public bool approveUsers(int id, string tableName, string type) { try { SqlConnection sqlConnection = ConnectionHandler.GetConnection(); SqlCommand sqlCommand = new SqlCommand(); sqlCommand.Connection = sqlConnection; sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.CommandText = "ApproveUsers"; sqlCommand.Parameters.AddWithValue("@id", id); sqlCommand.Parameters.AddWithValue("@table", tableName); sqlCommand.Parameters.AddWithValue("@type", type); SqlDataAdapter sqlDataAdaper = new SqlDataAdapter(sqlCommand); DataTable dt = new DataTable(); sqlDataAdaper.Fill(dt); if (dt.Rows.Count > 0) { if (!dt.Rows[0][0].ToString().Contains("Fail")) { return(true); } else { return(false); } } else { return(false); } } catch (Exception ex) { return(false); } }
//Super User Acceptance public void DALSuperUserAcceptance(string userId, bool response) { SqlConnection _sqlConnection = ConnectionHandler.GetConnection(); SqlCommand _sqlCommand = new SqlCommand("DALSuperUserAcceptance", _sqlConnection); _sqlCommand.CommandType = CommandType.StoredProcedure; _sqlCommand.Parameters.Add("@userId", SqlDbType.VarChar).Value = userId; _sqlCommand.Parameters.Add("@isActive", SqlDbType.Bit).Value = response; try { _sqlConnection.Open(); if (_sqlConnection.State == ConnectionState.Open) { _sqlCommand.ExecuteNonQuery(); } } catch (Exception ex) { } finally { _sqlConnection.Close(); } }