убрал часть комментариев

This commit is contained in:
Bulat 2024-12-20 10:01:46 +04:00
parent a30b24aaa1
commit 0d85b6f4b4
9 changed files with 9 additions and 34 deletions

View File

@ -20,7 +20,7 @@ public class Doctor
public string FullName => $"{Last_Name} {First_Name}"; public string FullName => $"{Last_Name} {First_Name}";
[DisplayName("Должность")] [DisplayName("Должность")]
public DoctorPost DoctorPost { get; private set; } // объявляется свойство DoctorPost, которое имеет тип DoctorPost public DoctorPost DoctorPost { get; private set; }
public static Doctor CreateEntity(int id, string first_Name, string last_Name, DoctorPost doctorPost) public static Doctor CreateEntity(int id, string first_Name, string last_Name, DoctorPost doctorPost)
{ {

View File

@ -24,8 +24,6 @@ public class DoctorPayments
public int Count_Patient { get; private set; } public int Count_Patient { get; private set; }
//[DisplayName("Дата оплаты")]
//public DateTime DoctorPaymentData { get; private set; }
[DisplayName("Оплата")] [DisplayName("Оплата")]
public int Payment { get; private set; } public int Payment { get; private set; }
@ -37,7 +35,6 @@ public class DoctorPayments
IdDoctor = idDoctor, IdDoctor = idDoctor,
Month = month, Month = month,
Count_Patient = count_patient, Count_Patient = count_patient,
// DoctorPaymentData = DateTime.Now,
Payment = payment Payment = payment
}; };
} }

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace RegistrationPatientsPolyclinic.Entities; namespace RegistrationPatientsPolyclinic.Entities;
public class Drug // Наподобие Feed public class Drug
{ {
public int Id { get; private set; } public int Id { get; private set; }

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace RegistrationPatientsPolyclinic.Entities; namespace RegistrationPatientsPolyclinic.Entities;
public class DrugMedicalHistory // Тоже самое что FeedFeedRepleshments public class DrugMedicalHistory
{ {
public int Id { get; private set; } public int Id { get; private set; }

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace RegistrationPatientsPolyclinic.Entities; namespace RegistrationPatientsPolyclinic.Entities;
public class MedicalHistory // сущность пополнения, наподобие FeedReplenushment public class MedicalHistory
{ {
public int Id { get; private set; } public int Id { get; private set; }
@ -49,19 +49,7 @@ public class MedicalHistory // сущность пополнения, напо
DrugMedicalHistory = drugMedicalHistory DrugMedicalHistory = drugMedicalHistory
}; };
} }
/*
public static MedicalHistory CreateOpeartion(TempDrugMedicalHistory tempDrugMedicalHistory, IEnumerable<DrugMedicalHistory> drugMedicalHistories)
{
return new MedicalHistory
{
Id = tempDrugMedicalHistory.Id,
PatientId = tempDrugMedicalHistory.PatientId,
DoctorId = tempDrugMedicalHistory.DoctorId,
VisitDate = tempDrugMedicalHistory.VisitDate,
DrugMedicalHistory = drugMedicalHistories
};
}
*/
public void SetDrugMedHistory(IEnumerable<DrugMedicalHistory> drugMedicalHistory) public void SetDrugMedHistory(IEnumerable<DrugMedicalHistory> drugMedicalHistory)
{ {
if (drugMedicalHistory != null && drugMedicalHistory.Any()) if (drugMedicalHistory != null && drugMedicalHistory.Any())

View File

@ -16,8 +16,6 @@ namespace RegistrationPatientsPolyclinic.Forms
{ {
public partial class FormDoctor : Form public partial class FormDoctor : Form
{ {
// Понадобиться интерфейс работника
// так же будет сеттер с id
private readonly IDoctorRepository _doctorRepository; private readonly IDoctorRepository _doctorRepository;
@ -53,7 +51,7 @@ namespace RegistrationPatientsPolyclinic.Forms
_doctorRepository = doctorRepository ?? _doctorRepository = doctorRepository ??
throw new ArgumentNullException(nameof(doctorRepository)); throw new ArgumentNullException(nameof(doctorRepository));
comboBoxPost.DataSource = Enum.GetValues(typeof(DoctorPost)); // вытащи значение из этого перечисления, вернет массив строк, т.е. массив тпеих элементов(DoctorPost) comboBoxPost.DataSource = Enum.GetValues(typeof(DoctorPost));
} }
private void ButtonSave_Click(object sender, EventArgs e) private void ButtonSave_Click(object sender, EventArgs e)

View File

@ -36,18 +36,15 @@ namespace RegistrationPatientsPolyclinic.Forms
throw new Exception("Имеются не заполненные поля"); throw new Exception("Имеются не заполненные поля");
} }
// Получаем значение из первой строки колонки ColumnMonth
string month = dataGridViewPayment.Rows[0].Cells["ColumnMonth"].Value?.ToString(); string month = dataGridViewPayment.Rows[0].Cells["ColumnMonth"].Value?.ToString();
int countPatient = int.Parse(dataGridViewPayment.Rows[0].Cells["ColumnCount"].Value?.ToString() ?? "0"); int countPatient = int.Parse(dataGridViewPayment.Rows[0].Cells["ColumnCount"].Value?.ToString() ?? "0");
int payment = int.Parse(dataGridViewPayment.Rows[0].Cells["ColumnPayment"].Value?.ToString() ?? "0"); int payment = int.Parse(dataGridViewPayment.Rows[0].Cells["ColumnPayment"].Value?.ToString() ?? "0");
// Проверяем, что месяц не пустой
if (string.IsNullOrEmpty(month)) if (string.IsNullOrEmpty(month))
{ {
throw new Exception("Месяц не заполнен"); throw new Exception("Месяц не заполнен");
} }
// Создаем элемент DoctorPayments
_doctorPaymentsRepository.CreateDoctorPayments(DoctorPayments.CreateElement(0, (int)comboBoxDoctor.SelectedValue!, month, countPatient, payment)); _doctorPaymentsRepository.CreateDoctorPayments(DoctorPayments.CreateElement(0, (int)comboBoxDoctor.SelectedValue!, month, countPatient, payment));
@ -71,7 +68,6 @@ namespace RegistrationPatientsPolyclinic.Forms
{ {
continue; continue;
} }
// ДОДЕЛАТЬ!!!
list.Add(DoctorPayments.CreateElement(0, 0, row.Cells["ColumnMonth"].Value.ToString(), Convert.ToInt32(row.Cells["ColumnCount"].Value), list.Add(DoctorPayments.CreateElement(0, 0, row.Cells["ColumnMonth"].Value.ToString(), Convert.ToInt32(row.Cells["ColumnCount"].Value),
Convert.ToInt32(row.Cells["ColumnPayment"].Value))); Convert.ToInt32(row.Cells["ColumnPayment"].Value)));
} }

View File

@ -15,8 +15,6 @@ namespace RegistrationPatientsPolyclinic.Forms
{ {
public partial class FormDoctors : Form public partial class FormDoctors : Form
{ {
// Здесь понадобится экземпляр IUnity контейнер через который мы будем создавать объекты FormDoctor и вызывать его
// IPatientRepository через который мы будем получать список
private readonly IUnityContainer _container; private readonly IUnityContainer _container;
@ -25,7 +23,7 @@ namespace RegistrationPatientsPolyclinic.Forms
public FormDoctors(IUnityContainer container, IDoctorRepository doctorRepository) public FormDoctors(IUnityContainer container, IDoctorRepository doctorRepository)
{ {
InitializeComponent(); InitializeComponent();
_container = container ?? // мы получаем через контейнер объект _container = container ??
throw new ArgumentNullException(nameof(container)); throw new ArgumentNullException(nameof(container));
_doctorRepository = doctorRepository ?? _doctorRepository = doctorRepository ??
throw new ArgumentNullException(nameof(doctorRepository)); ; throw new ArgumentNullException(nameof(doctorRepository)); ;
@ -33,7 +31,6 @@ namespace RegistrationPatientsPolyclinic.Forms
private void FormDoctors_Load(object sender, EventArgs e) private void FormDoctors_Load(object sender, EventArgs e)
{ {
// метод, при загрузки формы будет прогружаться все данные
try try
{ {
LoadList(); LoadList();
@ -43,7 +40,6 @@ namespace RegistrationPatientsPolyclinic.Forms
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
} }
// отдельный метод который будет загружать в GridView
private void LoadList() private void LoadList()
{ {

View File

@ -57,13 +57,13 @@ internal class TableReport
.AddParagraph($"За период с {startOfMonth:MMMM yyyy} по {endOfMonth:MMMM yyyy}", 0) .AddParagraph($"За период с {startOfMonth:MMMM yyyy} по {endOfMonth:MMMM yyyy}", 0)
.AddParagraph($"Врач: {doctorFullName}", 0) .AddParagraph($"Врач: {doctorFullName}", 0)
.AddTable(new[] { 25, 25, 25 }, tableData); .AddTable(new[] { 25, 25, 25 }, tableData);
/*
excelBuilder.AddParagraph("", 0); excelBuilder.AddParagraph("", 0);
excelBuilder excelBuilder
.AddHeader("Назначенные лекарства", 0, 2) .AddHeader("Назначенные лекарства", 0, 2)
.AddTable(new[] { 25, 25 }, GetDrugData(doctorId, startOfMonth, endOfMonth)); .AddTable(new[] { 25, 25 }, GetDrugData(doctorId, startOfMonth, endOfMonth));
*/
excelBuilder.Build(); excelBuilder.Build();
return true; return true;
} }