Для отчета подготовка
This commit is contained in:
parent
2240cbd791
commit
c6f749afda
@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace AcademicProgressBusinessLogic.BindingModels
|
||||||
|
{
|
||||||
|
// <summary>
|
||||||
|
/// Информация по выгрузке отчета
|
||||||
|
/// </summary>
|
||||||
|
public class ReportBindingModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Путь до папки, куда выгружать отчет
|
||||||
|
/// </summary>
|
||||||
|
public string FolderName { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,9 @@
|
|||||||
using System;
|
using AcademicProgressBusinessLogic.BindingModels;
|
||||||
|
using AcademicProgressBusinessLogic.Interfaces;
|
||||||
|
using DepartmentBusinessLogic.Interfaces;
|
||||||
|
using ModuleTools.BusinessLogics;
|
||||||
|
using ModuleTools.Enums;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -6,7 +11,40 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace AcademicProgressBusinessLogic.BusinessLogics
|
namespace AcademicProgressBusinessLogic.BusinessLogics
|
||||||
{
|
{
|
||||||
public class ReportBusinessLogic
|
/// <summary>
|
||||||
|
/// Логика работы с отчетами
|
||||||
|
/// </summary>
|
||||||
|
public class ReportBusinessLogic : CoreBusinessLogic
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Серивс для работы с отчетами
|
||||||
|
/// </summary>
|
||||||
|
private readonly IReportService _service;
|
||||||
|
|
||||||
|
private readonly IStudentService _studentService;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Логика работы с отчетом
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="service"></param>
|
||||||
|
public ReportBusinessLogic(IReportService service, IStudentService _studentService)
|
||||||
|
{
|
||||||
|
this._studentService = _studentService;
|
||||||
|
_service = service;
|
||||||
|
_serviceOperation = AccessOperation.Отчет_успеваемость;
|
||||||
|
_entity = "Отчеты для успеваемости";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveReportToWordFile(ReportBindingModel model)
|
||||||
|
{
|
||||||
|
/* SaveToWord.CreateDoc(new WordInfo
|
||||||
|
{
|
||||||
|
FileName = model.FolderName,
|
||||||
|
Title = "Список заявок",
|
||||||
|
RequestFlowers = GetRequestPlaces()
|
||||||
|
});*/
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace AcademicProgressBusinessLogic.BusinessLogics
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class StudentAcademicProgressBusinessLogic : GenericBusinessLogic<StudentAcademicProgressGetBindingModel, StudentAcademicProgressSetBindingModel, StudentAcademicProgressListViewModel, StudentAcademicProgressViewModels>
|
public class StudentAcademicProgressBusinessLogic : GenericBusinessLogic<StudentAcademicProgressGetBindingModel, StudentAcademicProgressSetBindingModel, StudentAcademicProgressListViewModel, StudentAcademicProgressViewModels>
|
||||||
{
|
{
|
||||||
public StudentAcademicProgressBusinessLogic(IStudentAcademicProgress service) : base(service, "Записи учебного прогресса", AccessOperation.Записи_Учебного_Прогресса) { }
|
public StudentAcademicProgressBusinessLogic(IStudentAcademicProgressService service) : base(service, "Записи учебного прогресса", AccessOperation.Записи_Учебного_Прогресса) { }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
using AcademicProgressBusinessLogic.BindingModels;
|
||||||
|
using ModuleTools.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace AcademicProgressBusinessLogic.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Сервис работы по выгрузке отчета
|
||||||
|
/// </summary>
|
||||||
|
public interface IReportService
|
||||||
|
{
|
||||||
|
OperationResultModel SaveReportToWordFile(ReportBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
@ -7,5 +7,5 @@ namespace AcademicProgressBusinessLogic.Interfaces
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Хранение учебного прогресса
|
/// Хранение учебного прогресса
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IStudentAcademicProgress : IGenerticEntityService<StudentAcademicProgressGetBindingModel, StudentAcademicProgressSetBindingModel> { }
|
public interface IStudentAcademicProgressService : IGenerticEntityService<StudentAcademicProgressGetBindingModel, StudentAcademicProgressSetBindingModel> { }
|
||||||
}
|
}
|
@ -10,7 +10,7 @@ namespace AcademicProgressDatabaseImplementation
|
|||||||
{
|
{
|
||||||
public void RegisterServices()
|
public void RegisterServices()
|
||||||
{
|
{
|
||||||
DependencyManager.Instance.RegisterType<IStudentAcademicProgress, StudentAcademicProgressService>();
|
DependencyManager.Instance.RegisterType<IStudentAcademicProgressService, StudentAcademicProgressService>();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ namespace AcademicProgressDatabaseImplementation.Implementations
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class StudentAcademicProgressService :
|
public class StudentAcademicProgressService :
|
||||||
AbstractGenerticEntityService<StudentAcademicProgressGetBindingModel, StudentAcademicProgressSetBindingModel, StudentAcademicProgress, StudentAcademicProgressListViewModel, StudentAcademicProgressViewModels>,
|
AbstractGenerticEntityService<StudentAcademicProgressGetBindingModel, StudentAcademicProgressSetBindingModel, StudentAcademicProgress, StudentAcademicProgressListViewModel, StudentAcademicProgressViewModels>,
|
||||||
IStudentAcademicProgress
|
IStudentAcademicProgressService
|
||||||
{
|
{
|
||||||
protected override OperationResultModel AdditionalCheckingWhenAdding(DbContext context, StudentAcademicProgressSetBindingModel model) => OperationResultModel.Success(null);
|
protected override OperationResultModel AdditionalCheckingWhenAdding(DbContext context, StudentAcademicProgressSetBindingModel model) => OperationResultModel.Success(null);
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@ namespace AcademicProgressWindowsDesktop.SpecialControls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly ReportBusinessLogic _reportLogic;
|
private readonly ReportBusinessLogic _reportLogic;
|
||||||
|
|
||||||
private IStudentService _studentLogic;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Событие, вызываемое при закрытии контрола
|
/// Событие, вызываемое при закрытии контрола
|
||||||
|
@ -90,6 +90,7 @@ namespace AcademicProgressWindowsDesktop.SpecialControls
|
|||||||
this.buttonSaveSelectFolder.TabIndex = 21;
|
this.buttonSaveSelectFolder.TabIndex = 21;
|
||||||
this.buttonSaveSelectFolder.Text = "Выбрать папку";
|
this.buttonSaveSelectFolder.Text = "Выбрать папку";
|
||||||
this.buttonSaveSelectFolder.UseVisualStyleBackColor = true;
|
this.buttonSaveSelectFolder.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonSaveSelectFolder.Click += new System.EventHandler(this.buttonSaveSelectFolder_Click);
|
||||||
//
|
//
|
||||||
// buttonSave
|
// buttonSave
|
||||||
//
|
//
|
||||||
@ -99,6 +100,7 @@ namespace AcademicProgressWindowsDesktop.SpecialControls
|
|||||||
this.buttonSave.TabIndex = 22;
|
this.buttonSave.TabIndex = 22;
|
||||||
this.buttonSave.Text = "Сохранить";
|
this.buttonSave.Text = "Сохранить";
|
||||||
this.buttonSave.UseVisualStyleBackColor = true;
|
this.buttonSave.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click);
|
||||||
//
|
//
|
||||||
// textBoxSaveFolderName
|
// textBoxSaveFolderName
|
||||||
//
|
//
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
using DepartmentWindowsDesktop.EntityControls;
|
using AcademicProgressBusinessLogic.BindingModels;
|
||||||
|
using AcademicProgressBusinessLogic.BusinessLogics;
|
||||||
|
using DepartmentWindowsDesktop.EntityControls;
|
||||||
using DesktopTools.BaseControls;
|
using DesktopTools.BaseControls;
|
||||||
|
using DesktopTools.Helpers;
|
||||||
using DesktopTools.Interfaces;
|
using DesktopTools.Interfaces;
|
||||||
using DesktopTools.Models;
|
using DesktopTools.Models;
|
||||||
|
using ModuleTools.BusinessLogics;
|
||||||
using ModuleTools.Enums;
|
using ModuleTools.Enums;
|
||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@ -14,12 +18,24 @@ namespace AcademicProgressWindowsDesktop.SpecialControls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ControlStudentGraduate : UserControl, IControl
|
public partial class ControlStudentGraduate : UserControl, IControl
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
|
/// <summary>
|
||||||
|
/// Класс с бизнес-логикой работы с отчетом
|
||||||
|
/// </summary>
|
||||||
|
private readonly ReportBusinessLogic _reportLogic;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
/// Событие, вызываемое при закрытии контрола
|
/// Событие, вызываемое при закрытии контрола
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private event Action<Guid> CloseEvent;
|
private event Action<Guid> CloseEvent;
|
||||||
public ControlStudentGraduate()
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Контрол для работы с отчетом приложения к диплому
|
||||||
|
/// </summary>
|
||||||
|
public ControlStudentGraduate()
|
||||||
{
|
{
|
||||||
|
_reportLogic = DependencyManager.Instance.Resolve<ReportBusinessLogic>();
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Title = "Приложение к диплому";
|
Title = "Приложение к диплому";
|
||||||
//что за цифры тут откуда брать...
|
//что за цифры тут откуда брать...
|
||||||
@ -66,12 +82,7 @@ namespace AcademicProgressWindowsDesktop.SpecialControls
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void buttonSave_Click_1(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadGroupBoxReportInfo()
|
private void LoadGroupBoxReportInfo()
|
||||||
{
|
{
|
||||||
@ -100,5 +111,30 @@ namespace AcademicProgressWindowsDesktop.SpecialControls
|
|||||||
groupBoxReportInfo.Controls.Add(controlStudentGroup);
|
groupBoxReportInfo.Controls.Add(controlStudentGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
private void buttonSaveSelectFolder_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var fbd = new FolderBrowserDialog();
|
||||||
|
if (fbd.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
textBoxSaveFolderName.Text = fbd.SelectedPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_reportLogic.SaveReportToWordFile(new ReportBindingModel
|
||||||
|
{
|
||||||
|
FolderName = textBoxSaveFolderName.Text
|
||||||
|
});
|
||||||
|
DialogHelper.MessageInformation("Сохранение прошло успешно", "Результат");
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
DialogHelper.MessageException(_reportLogic.Errors, "Ошибки при сохранении");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,8 @@
|
|||||||
Для_выпускников = 703,
|
Для_выпускников = 703,
|
||||||
|
|
||||||
Академическая_разница = 704,
|
Академическая_разница = 704,
|
||||||
|
|
||||||
|
Отчет_успеваемость = 705,
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user