Пример #1
0
        public fileToSend GetPartTimeTemplate(int idEmployee, int idDocument) //старая версия  документа
        {
            fileToSend file = new fileToSend();

            byte[] docForm = GetOldDocumentFormById(idDocument); //id графика "трудовой договор для совместителей.docx" в бд 3
            if (docForm == null)
            {
                return(null);
            }

            PartTimeDataModel data = GetPartTimeData(idEmployee);

            if (data == null)
            {
                file.data = docForm;
                file.name = "trudovoi dogovor dla sovmestiteley";
                file.mime = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
                return(file);
            }
            else
            {
                byte[] result = WordShedule.CreatePartTimeDoc(data, docForm);
                file.data = result;
                file.name = Translit(data.fullName) + "  trudovoi dogovor dla sovmestiteley";
                file.mime = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
                return(file);
            }
        }