using System;
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using static [Link];
namespace [Link]
{
public partial class WINCC_CIPReport : UserControl
{
#region Property
//
private bool windowsAuthentication;
private string serverName;
private string databaseName;
private string userName;
private string password;
private string iniPath = "C:\\AppConfig\\[Link]";
private string _FileAppPath = "C:\\AppConfig\\";
//Add Tag
[Description("Select Tag for control")]
[TypeConverter(typeof(bool)), CategoryAttribute("HTEN Settings")]
public bool WindowsAuthentication { get => windowsAuthentication; set =>
windowsAuthentication = value; }
[Description("Select Tag for control")]
[TypeConverter(typeof(string)), CategoryAttribute("HTEN Settings")]
public string ServerName { get => serverName; set => serverName = value; }
[Description("Select Tag for control")]
[TypeConverter(typeof(string)), CategoryAttribute("HTEN Settings")]
public string DatabaseName { get => databaseName; set => databaseName =
value; }
[Description("Select Tag for control")]
[TypeConverter(typeof(string)), CategoryAttribute("HTEN Settings")]
public string UserName { get => userName; set => userName = value; }
[Description("Select Tag for control")]
[TypeConverter(typeof(string)), CategoryAttribute("HTEN Settings")]
public string Password { get => password; set => password = value; }
[Description("Select Tag for control")]
[TypeConverter(typeof(string)), CategoryAttribute("HTEN Settings")]
public string IniPath { get => iniPath; set => iniPath = value; }
[Description("Select Tag for control")]
[TypeConverter(typeof(string)), CategoryAttribute("HTEN Settings")]
public string FileAppPath { get => _FileAppPath; set => _FileAppPath =
value; }
#endregion Property
public static string objectId = "rptCIP";
U_DateTimeFilter u = new U_DateTimeFilter() { Dock = [Link] };
public WINCC_CIPReport()
{
InitializeComponent();
[Link](u);
[Link] += BtnFilter_Click;
[Link] = false;
}
private void BtnFilter_Click(object sender, EventArgs e)
{
LoadData();
}
private void LoadData()
{
using (var db = new HTENEntities([Link]()))
{
string sql;
sql = [Link]("Select * from CIPMaster_Report where
StartTimeLDT >'" + [Link]("yyyy -MM-dd HH:mm:ss") + "' and EndTimeLDT
<'" + [Link]("yyyy-MM-dd HH:mm:ss") + "' Order by ID");
List<CIPMaster_Report> result =
[Link]<CIPMaster_Report>(sql).ToList();
[Link] = result;
[Link] = result;
[Link]();
}
}
private void WINCC_CIPReport_Load(object sender, EventArgs e)
{
if (DesignMode) { return; }
#region Xử lý chuỗi kết nối database
if ([Link](ServerName) ||
[Link](DatabaseName) || [Link](UserName) ||
[Link](Password))
{
//string location =
[Link]().Location;
string directoryPath = IniPath;
IniFile ini = new IniFile(directoryPath);
[Link] =
[Link]([Link]("WindowsAuthentication", "Config"));
[Link] = [Link]("ServerName", "Config");
[Link] = [Link]("DatabaseName", "Config");
[Link] = [Link]("UserName", "Config");
[Link] = [Link]("Password", "Config");
}
else
{
[Link] = windowsAuthentication;
[Link] = serverName;
[Link] = databaseName;
[Link] = userName;
[Link] = password;
}
// [Link] =
[Link]();
#endregion
// [Link](this, objectId);
[Link](gridMain, objectId, FileAppPath);
//[Link] += cbType_Change;
LoadData();
}
private void btnExportExcel_ItemClick(object sender,
[Link] e)
{
[Link](bandedGridView3, objectId, "From " +
[Link] + " To " + [Link]);
}
}
}