public void GenerateCard() { ReportCardModel model = new ReportCardModel(); ReportCard report = new ReportCard(); report.CreateDocument("D:\\Testing\\", model, 2021); }
public void TestOfficialXlsx() { ReportCardModel model = new ReportCardModel() { SettingParameters = new SettingParameters() { TabelNumber = "7751-00-548", Year = 2021, IdDepartment = 8, Type = new Type() { IdType = 1, NameType = "Полный" }, View = new View() { IdView = 0, NameView = "Первичный" }, Mouth = new Mouth() { NumberMouthString = "09", NameMouth = "Сентябрь", NumberMouth = 9 } } }; SqlConnectionType sql = new SqlConnectionType(); SelectImns selectFrames = new SelectImns(); XmlReadOrWrite xml = new XmlReadOrWrite(); SelectSql select = new SelectSql(); select.SelectCardModelLeader(ref model); var command = string.Format(selectFrames.UserReportCard, model.SettingParameters.LeaderD.NameDepartment, $"{model.SettingParameters.Year}-{model.SettingParameters.Mouth.NumberMouthString}-01"); var userReportCard = sql.XmlString("Data Source=i7751-app020;Initial Catalog=imns51;Integrated Security=True;MultipleActiveResultSets=True", command); userReportCard = string.Concat("<SettingParameters>", userReportCard, "</SettingParameters>"); model.SettingParameters.UsersReportCard = ((SettingParameters)xml.ReadXmlText(userReportCard, typeof(SettingParameters))).UsersReportCard; foreach (var usersReportCard in model.SettingParameters.UsersReportCard) { var commandVacation = string.Format(selectFrames.ItemVacationNew, usersReportCard.Tab_num, $"{model.SettingParameters.Year}", $"{model.SettingParameters.Year}"); var userVacation = sql.XmlString("Data Source=i7751-app020;Initial Catalog=imns51;Integrated Security=True;MultipleActiveResultSets=True", commandVacation); userVacation = string.Concat("<UsersReportCard>", userVacation, "</UsersReportCard>"); usersReportCard.ItemVacation = ((UsersReportCard)xml.ReadXmlText(userVacation, typeof(UsersReportCard))).ItemVacation; var commandDisability = string.Format(selectFrames.Disability, usersReportCard.Tab_num, $"{model.SettingParameters.Year}"); var userDisability = sql.XmlString("Data Source=i7751-app020;Initial Catalog=imns51;Integrated Security=True;MultipleActiveResultSets=True", commandDisability); userDisability = string.Concat("<UsersReportCard>", userDisability, "</UsersReportCard>"); usersReportCard.Disability = ((UsersReportCard)xml.ReadXmlText(userDisability, typeof(UsersReportCard))).Disability; var commandBusiness = string.Format(selectFrames.Business, usersReportCard.Tab_num, $"{model.SettingParameters.Year}"); var userBusiness = sql.XmlString("Data Source=i7751-app020;Initial Catalog=imns51;Integrated Security=True;MultipleActiveResultSets=True", commandBusiness); userBusiness = string.Concat("<UsersReportCard>", userBusiness, "</UsersReportCard>"); usersReportCard.Business = ((UsersReportCard)xml.ReadXmlText(userBusiness, typeof(UsersReportCard))).Business; } ReportCard report = new ReportCard(); report.CreateDocument("D:\\Testing\\", model); }