Работает через жопу
This commit is contained in:
parent
422eba9d32
commit
681a92d13f
@ -18,12 +18,17 @@ namespace PersonnelDepartmentDatabaseImplement.Implements
|
||||
{
|
||||
using var context = new PersonnelDepartmentDatabase();
|
||||
var element = context.Deals
|
||||
.Include(x => x.Employee)
|
||||
.Include(x => x.Department)
|
||||
.Include(x => x.Type)
|
||||
.Include(x => x.Position)
|
||||
.FirstOrDefault(x => x.Id == model.Id);
|
||||
if (element == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
context.Deals.Remove(element);
|
||||
context.SaveChanges();
|
||||
return element.GetViewModel;
|
||||
}
|
||||
|
||||
@ -38,7 +43,7 @@ namespace PersonnelDepartmentDatabaseImplement.Implements
|
||||
.Include(x => x.Employee)
|
||||
.Include(x => x.Department)
|
||||
.Include(x => x.Type)
|
||||
.Include(x => x.Employee)
|
||||
.Include(x => x.Position)
|
||||
.FirstOrDefault(x => (model.Id.HasValue && model.Id == x.Id) ||
|
||||
(model.DateFrom != null && x.DateFrom == model.DateFrom) ||
|
||||
(model.DateTo != null && x.DateTo == model.DateTo) ||
|
||||
@ -55,7 +60,7 @@ namespace PersonnelDepartmentDatabaseImplement.Implements
|
||||
.Include(x => x.Employee)
|
||||
.Include(x => x.Department)
|
||||
.Include(x => x.Type)
|
||||
.Include(x => x.Employee)
|
||||
.Include(x => x.Position)
|
||||
.Where(x => (model.Id.HasValue && model.Id == x.Id) ||
|
||||
(model.DateFrom != null && x.DateFrom == model.DateFrom) ||
|
||||
(model.DateTo != null && x.DateTo == model.DateTo) ||
|
||||
|
@ -68,7 +68,7 @@ namespace PersonnelDepartmentDatabaseImplement.Models
|
||||
TypeId = TypeId,
|
||||
PositionName = Position.Name,
|
||||
DepartmentName = Department.Name,
|
||||
EmployeeName = Employee.LastName + Employee.FirstName + Employee.Patronymic,
|
||||
EmployeeName = Employee.LastName + " " + Employee.FirstName[0] + "." + Employee.Patronymic[0] + ".",
|
||||
TypeName = Type.Name
|
||||
};
|
||||
}
|
||||
|
@ -194,6 +194,7 @@
|
||||
Controls.Add(buttonCancel);
|
||||
Controls.Add(buttonSave);
|
||||
Name = "FormDeal";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Договор";
|
||||
Load += FormDeal_Load;
|
||||
ResumeLayout(false);
|
||||
|
@ -100,6 +100,7 @@
|
||||
Controls.Add(label1);
|
||||
Controls.Add(textBoxName);
|
||||
Name = "FormDepartment";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Отдел";
|
||||
Load += FormDepartment_Load;
|
||||
ResumeLayout(false);
|
||||
|
@ -96,6 +96,7 @@
|
||||
Controls.Add(buttonAdd);
|
||||
Controls.Add(dataGridView);
|
||||
Name = "FormDepartments";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Таблица Отделов";
|
||||
Load += FormDepartments_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
|
@ -120,6 +120,7 @@
|
||||
Controls.Add(label1);
|
||||
Controls.Add(textBoxFirstName);
|
||||
Name = "FormEmployee";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Сотрудник";
|
||||
Load += FormEmployee_Load;
|
||||
ResumeLayout(false);
|
||||
|
@ -96,6 +96,7 @@
|
||||
Controls.Add(buttonAdd);
|
||||
Controls.Add(dataGridView);
|
||||
Name = "FormEmployees";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Таблица Сотрудников";
|
||||
Load += FormEmployees_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
|
@ -80,6 +80,7 @@
|
||||
Controls.Add(label1);
|
||||
Controls.Add(textBoxName);
|
||||
Name = "FormPosition";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Должность";
|
||||
Load += FormPosition_Load;
|
||||
ResumeLayout(false);
|
||||
|
@ -96,6 +96,7 @@
|
||||
Controls.Add(buttonAdd);
|
||||
Controls.Add(dataGridView);
|
||||
Name = "FormPositions";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Таблица Должностей";
|
||||
Load += FormPositions_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
|
@ -80,6 +80,7 @@
|
||||
Controls.Add(label1);
|
||||
Controls.Add(textBoxName);
|
||||
Name = "FormType";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Тип договора";
|
||||
Load += FormType_Load;
|
||||
ResumeLayout(false);
|
||||
|
@ -96,6 +96,7 @@
|
||||
Controls.Add(buttonAdd);
|
||||
Controls.Add(dataGridView);
|
||||
Name = "FormTypes";
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Text = "Таблица Типов";
|
||||
Load += FormTypes_Load;
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user