/// <summary>
/// Add Date Time/Time script dynamically
/// </summary>
/// <param name="controlType"></param>
/// <param name="controlID"></param>
/// <returns></returns>
public static string GenerateDynamicScript(string controlType, string controlID, string hdfToRange, string fromDate, string hdfFrmDate)
{
string script = string.Empty;
switch ((ControlTypes)(Enum.Parse(typeof(ControlTypes), controlType)))
{
case ControlTypes.TimePicker:
script = "$('input:text[id$=" + controlID + "]').timepicker();";
break;
case ControlTypes.DateTime:
script = "ERPScriptUtils.DatePickerCommon('" + controlID + "');";
script = script + "$('input:text[id$=" + controlID + "_Time]').timepicker();";
break;
case ControlTypes.Date:
script = "ERPScriptUtils.DatePickerCommon('" + controlID + "');";
break;
case ControlTypes.DateRange:
script = "ERPScriptUtils.AddDateRangeCommon('" + fromDate + "', '" + hdfFrmDate + "', '" + controlID + "', '" + hdfToRange + "', false, false);";
break;
case ControlTypes.MonthPicker:
script = "ControlID= '" + controlID + "';";
break;
}
return script;
}
/// Add Date Time/Time script dynamically
/// </summary>
/// <param name="controlType"></param>
/// <param name="controlID"></param>
/// <returns></returns>
public static string GenerateDynamicScript(string controlType, string controlID, string hdfToRange, string fromDate, string hdfFrmDate)
{
string script = string.Empty;
switch ((ControlTypes)(Enum.Parse(typeof(ControlTypes), controlType)))
{
case ControlTypes.TimePicker:
script = "$('input:text[id$=" + controlID + "]').timepicker();";
break;
case ControlTypes.DateTime:
script = "ERPScriptUtils.DatePickerCommon('" + controlID + "');";
script = script + "$('input:text[id$=" + controlID + "_Time]').timepicker();";
break;
case ControlTypes.Date:
script = "ERPScriptUtils.DatePickerCommon('" + controlID + "');";
break;
case ControlTypes.DateRange:
script = "ERPScriptUtils.AddDateRangeCommon('" + fromDate + "', '" + hdfFrmDate + "', '" + controlID + "', '" + hdfToRange + "', false, false);";
break;
case ControlTypes.MonthPicker:
script = "ControlID= '" + controlID + "';";
break;
}
return script;
}
No comments:
Post a Comment