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

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}";
[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)
{

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace RegistrationPatientsPolyclinic.Entities;
public class MedicalHistory // сущность пополнения, наподобие FeedReplenushment
public class MedicalHistory
{
public int Id { get; private set; }
@ -49,19 +49,7 @@ public class MedicalHistory // сущность пополнения, напо
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)
{
if (drugMedicalHistory != null && drugMedicalHistory.Any())

View File

@ -16,8 +16,6 @@ namespace RegistrationPatientsPolyclinic.Forms
{
public partial class FormDoctor : Form
{
// Понадобиться интерфейс работника
// так же будет сеттер с id
private readonly IDoctorRepository _doctorRepository;
@ -53,7 +51,7 @@ namespace RegistrationPatientsPolyclinic.Forms
_doctorRepository = 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)

View File

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

View File

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

View File

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