private void SetOrder()
{
this.btnGetValue.Enabled = false;
this.btnSave.Enabled = false;
ISGetData8 = AllowUpdate.No;
ISGetData20 = AllowUpdate.No;
bool dd1 = ModulePrivilegeUtility.CheckFunctionPrivilege("ScheduleNodeDefault", "003");
if (dd1 == true)
{
this.btnGetValue.Enabled = true;
this.btnSave.Enabled = true;
ISGetData8 = AllowUpdate.Yes;
ISGetData20 = AllowUpdate.Yes;
}
else
{
bool dd2 = ModulePrivilegeUtility.CheckFunctionPrivilege("ScheduleNodeDefault", "002");
if (dd2 == true)
{
this.btnGetValue.Enabled = false;
this.btnSave.Enabled = false;
if (DropDownList1.SelectedValue == "all")
{
this.btnGetValue.Enabled = false;
this.btnSave.Enabled = false;
}
else if (DropDownList1.SelectedValue == startDayClass.ToString())
{
if (DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")) >= DateTime.Parse(this.txtDateTime.Text + " " + startDayClass.ToString()) && DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")) < DateTime.Parse(this.txtDateTime.Text + " " + endDayClass.ToString()))
{
ISGetData8 = AllowUpdate.Yes;
ISGetData20 = AllowUpdate.No;
DropDownList1.SelectedValue = startDayClass.ToString();
this.btnGetValue.Enabled = true;
this.btnSave.Enabled = true;
}
}
else if (DropDownList1.SelectedValue == startNightClass.ToString())
{
if (DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")) >= DateTime.Parse(this.txtDateTime.Text + " " + startNightClass.ToString()) || DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")) < DateTime.Parse(this.txtDateTime.Text + " " + endNightClass.ToString()))
{
ISGetData8 = AllowUpdate.No;
ISGetData20 = AllowUpdate.Yes;
DropDownList1.SelectedValue = startNightClass.ToString();
this.btnGetValue.Enabled = true;
this.btnSave.Enabled = true;
}
}
if (DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")) > DateTime.Parse(this.txtDateTime.Text))
{
ISGetData8 = AllowUpdate.No;
ISGetData20 = AllowUpdate.No;
btnGetValue.Enabled = false;
this.btnSave.Enabled = false;
}
}
}
setUltraGridColumnUpdate(ISGetData8, ISGetData20);
if (this.UltraWebGrid1.Columns.FromKey("EQUIP") != null)
{
this.UltraWebGrid1.Columns.FromKey("EQUIP").CellStyle.Wrap = true;
this.UltraWebGrid1.Columns.FromKey("MAT").CellStyle.Wrap = true;
this.UltraWebGrid1.Columns.FromKey("UNIT").CellStyle.Wrap = true;
this.UltraWebGrid1.Columns.FromKey("EQUIP1").CellStyle.Wrap = true;
this.UltraWebGrid1.Columns.FromKey("MAT").CellStyle.Wrap = true;
this.UltraWebGrid1.Columns.FromKey("UNIT1").CellStyle.Wrap = true;
this.UltraWebGrid1.Columns.FromKey("EQUIP2").CellStyle.Wrap = true;
this.UltraWebGrid1.Columns.FromKey("MAT2").CellStyle.Wrap = true;
this.UltraWebGrid1.Columns.FromKey("MAT").CellStyle.Wrap = true;
this.UltraWebGrid1.Columns.FromKey("UNIT2").CellStyle.Wrap = true;
this.UltraWebGrid1.Columns.FromKey("CAP2").CellStyle.Wrap = true;
this.UltraWebGrid1.Columns.FromKey("TYPEEQUIP2").CellStyle.Wrap = true;
bool dayClass = true;
bool nightClass = true;
if (DropDownList1.SelectedValue == startDayClass.ToString())
{
dayClass = false;
}
else if (DropDownList1.SelectedValue == startNightClass.ToString())
{
nightClass = false;
}
else
{
dayClass = false;
nightClass = false;
}
this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION6").Hidden = dayClass;
this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION18").Hidden = nightClass;
this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION61").Hidden = dayClass;
this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION181").Hidden = nightClass;
this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION62").Hidden = dayClass;
this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION182").Hidden = nightClass;
}
}