@foreach (var it in ViewBag.roles)
{
if(item.Sort ==1)
{
<td>
<input type="text" class="form-control btn-block" id="@item.Id _@it.Plans.Id" readonly />
</td>
}
else
{
<td>
<input type="text" class="mat_count" id="1_mat_1" @* id="@item.Id _@it.Plans.Id" *@ value="0" />
</td>
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace MyTest
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
TimerCallback timeCB = new TimerCallback(TimerCallback);
Timer time = new Timer(timeCB, null, 0, 20000);
}
static void TimerCallback(object state)
{
File.AppendAllText(@"C:/Users/sov/Downloads/Test.txt", "Текущее время: "+ DateTime.Now.ToString() + "\n");
File.AppendAllText(@"C:/Users/sov/Downloads/Test.txt", "-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n");
}
protected override void OnStop()
{
}
}
}
int index = -1;
XWPFTable table3 = doc.CreateTable(listkom.Count, 3);
table3.Width = 5000;
//table3.SetColumnWidth(0, 1500);
//table3.SetColumnWidth(1, 1500);
//table3.SetColumnWidth(2, 1500);
table3.SetLeftBorder(XWPFTable.XWPFBorderType.NONE, 4, 0, "FF0000");
table3.SetRightBorder(XWPFTable.XWPFBorderType.NONE, 4, 0, "FF0000");
table3.SetBottomBorder(XWPFTable.XWPFBorderType.NONE, 4, 0, "FF0000");
table3.SetTopBorder(XWPFTable.XWPFBorderType.NONE, 4, 0, "FF0000");
table3.SetInsideHBorder(XWPFTable.XWPFBorderType.NONE, 4, 0, "FF0000");
table3.SetInsideVBorder(XWPFTable.XWPFBorderType.NONE, 4, 0, "FF0000");
foreach (var item in listkom)
{
index++;
XWPFTableCell cell31 = table3.GetRow(index).GetCell(0);
XWPFTableCell cell32 = table3.GetRow(index).GetCell(1);
XWPFTableCell cell33 = table3.GetRow(index).GetCell(2);
XWPFParagraph para31 = cell31.AddParagraph();
XWPFParagraph para32 = cell32.AddParagraph();
XWPFParagraph para33 = cell33.AddParagraph();
XWPFRun run31 = para31.CreateRun();
XWPFRun run32 = para32.CreateRun();
XWPFRun run33 = para33.CreateRun();
run31.FontFamily = "Times New Roman";
run32.FontFamily = "Times New Roman";
run33.FontFamily = "Times New Roman";
run31.SetText(item.Status.Name.Trim());
run32.SetText("---");
run33.SetText(item.Employee.LastName.Substring(0, 1) + "." + item.Employee.MiddleName.Substring(0, 1) + "." + item.Employee.FirstName);
para31.Alignment = ParagraphAlignment.LEFT;
para32.Alignment = ParagraphAlignment.CENTER;
para33.Alignment = ParagraphAlignment.LEFT;
cell31.SetVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER);
cell32.SetVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER);
cell33.SetVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER);
var Paragraph1 = app.ActiveDocument.Paragraphs.Add();
var tableRange1 = Paragraph1.Range;
Table tOsttest = doc.Tables.Add(tableRange1, 1, 2);
tOst.Borders.Enable = 1;
foreach (var i in ListOstatDat)
{
}