I'm a beginner with dhtmlx scheduler, I use dbfirst with mvc4 razor syntax. So please can anybody help me to set the start time and endtime values I'm getting from the database: here is my code:
controller:
sched.Config.first_hour = 8;
sched.Config.last_hour = 19;
public string GetDbValues()
{
string strState = "";
List<tblSettings> settings = new List<tblSettings>();
settings = _config.GetSettings();
var defaultState = from setting in settings
where (setting.Desc == "start time"
|| setting.Desc == "end time")
// starttime as 08 and end time as 20 from database
select setting.Settings;
foreach (var oState in defaultState)
{strState += oState + "|";
}
strState = strState.Remove(strState.Length - 1);
return strState;
}
I get the values for first_hour and last_hour as string from the output. How to assign this string value to the first_hour and last_hour?
//I use linq to get the db values because of the table structure: ID(int), Settings(nvarchar) ,Desc (nvarchar)