DHTMLX Scheduler in mVC - asp.net-mvc-4

I am using DHTMLX Scheduler in my MVC Application. In my scheduler when we drag and the drop the timings a popup will be displayed which is working by default scheduler.js file. My problem is while dragging the time i need to display the custom popup window. Is it possible to do with the scheduler?
Can any one please help me.
Code for scheduler is
public ActionResult CalendarView(int? id, int? CustomerUserid)
{
//id = (int)Session["BUId"];
if (CustomerUserid == (int)Session["UserID"] || (CustomerUserid == (int)Session["UserID"] && id == (int)Session["BusinessId"]))
{
var scheduler = new DHXScheduler(this);
string val = System.Configuration.ConfigurationManager.AppSettings["UserTypeId"];
int code = Convert.ToInt32(val);
//var cuid = (int)Session["UserID"];
// List<tblUser> user = new List<tblUser>();
// var user1 = (from s in user
// where s.UserTypeId == 3 && s.UserID == cuid
// select new Appt
// {
// AddCustomer = s.DependentCustomer.ToString()
// }).ToList();
var cal = (from s
in db.tblUsers
where s.UserTypeId == code && s.UserID == id
select new Appt
{
BusinessName = s.tblBusinessCategory.BusinessName
// StartTime = s.WorkingHour.StartTime,
}).FirstOrDefault();
var sa = (from a
in db.WorkHours
where a.BusinessUserId == id
select new Appt
{
StartTime = a.StartTime,
EndTime = a.EndTime
}).FirstOrDefault();
Session["StartTime"] = sa.StartTime.Hour;
Session["EndTime"] = sa.EndTime.Hour;
Session["BUName"] = cal.BusinessName.ToString();
// var scheduler = new DHXScheduler(this);//{ InitialDate = new DateTime(2015, 1, 30) };
scheduler.Skin = DHXScheduler.Skins.Flat;
scheduler.Data.Loader.PreventCache();
scheduler.EnableDynamicLoading(SchedulerDataLoader.DynamicalLoadingMode.Week);
scheduler.Extensions.Add(SchedulerExtensions.Extension.Recurring);
//scheduler.Extensions.Add(SchedulerExtensions.Extension.ActiveLinks);
//scheduler.Extensions.Add(SchedulerExtensions.Extension.Collision);
scheduler.Extensions.Add(SchedulerExtensions.Extension.Limit);
scheduler.Config.limit_start = new DateTime(2015, 8, 25);
scheduler.Config.limit_end = new DateTime(2015, 9, 25);
scheduler.LoadData = true;
scheduler.EnableDataprocessor = true;
scheduler.Config.show_loading = true;
// scheduler.Config.buttons_left = ["dhx_save_btn","dhx_cancel_btn","locate_button"];
//var button = new LightboxButtonList();
//scheduler.Lightbox.Add();
int days = System.DateTime.Now.Day - 1;
int months = System.DateTime.Now.Month;
int years = System.DateTime.Now.Year;
int ihour = System.DateTime.Now.Hour;
int iminute = System.DateTime.Now.Minute;
int isecond = System.DateTime.Now.Second;
scheduler.TimeSpans.Add(new DHXBlockTime()
{
StartDate = new DateTime(2014, 2, 10),
EndDate = new DateTime(years, months, days + 1, ihour, iminute, isecond),
});
Session["BUId"] = id;
var parameter = new SqlParameter[1];
parameter[0] = new SqlParameter { ParameterName = "UserId", Value = id };
List<Appt> cm = new List<Appt>();
using (SYTEntities context = new SYTEntities())
{
cm = context.Database.SqlQuery<Appt>("exec spHoliday #UserId", parameter).ToList();
}
int iyear = 2015;
int imonth = 8;
int iday = 09;
//int ihour = 10;
int imin = 05;
int isec = 00;
foreach (var cp in cm)
{
iyear = cp.HolidayDate.Year;
imonth = cp.HolidayDate.Month;
iday = cp.HolidayDate.Day;
scheduler.TimeSpans.Add(new DHXMarkTime()
{
StartDate = new DateTime(iyear, imonth, iday), //new DateTime(2015, 8, 06), //hl.HolidayDate ?? default(DateTime),
EndDate = new DateTime(iyear, imonth, iday + 1),
// Day = DayOfWeek.Friday,
CssClass = "red_section",
HTML = "hos",
SpanType = DHXTimeSpan.Type.BlockEvents
});
}
var parameters = new SqlParameter[1];
parameters[0] = new SqlParameter { ParameterName = "BusinessUserId", Value = id };
List<Appt> wt = new List<Appt>();
using (SYTEntities context = new SYTEntities())
{
wt = context.Database.SqlQuery<Appt>("exec spGetWaitingList #BusinessUserId", parameters).ToList();
}
int ihr;
int imts;
int idayd;
int iyr;
int imnth;
int ihrs;
foreach (var cs in wt)
{
iyr = cs.EndTime.Year;// System.DateTime.Now.Year;
imnth = cs.EndTime.Month;// System.DateTime.Now.Month;
idayd = cs.EndTime.Day;// System.DateTime.Now.Day;
ihr = cs.EndTime.Hour; //.Hours; //.Hour;
imts = cs.EndTime.Minute; //.Minutes; //.Minute;
isec = cs.EndTime.Second; //.Seconds;
ihrs = cs.EndTime.Hour - cs.StartTime.Hour;
scheduler.TimeSpans.Add(new DHXMarkTime()
{
StartDate = new DateTime(iyr, imnth, idayd, ihr, imts, isec), //new DateTime(2015, 8, 06), //hl.HolidayDate ?? default(DateTime),
EndDate = new DateTime(iyr, imnth, idayd, ihr, imts, isec),
// Day = DayOfWeek.Friday,
CssClass = "green_section",
HTML = "",
SpanType = DHXTimeSpan.Type.BlockEvents
});
}
//for (int i = 0; i < 4; i++)
//{
// scheduler.TimeSpans.Add(new DHXMarkTime()
// {
// StartDate = new DateTime(iyear, imonth,iday,ihour, imin, isec), //new DateTime(2015, 8, 06), //hl.HolidayDate ?? default(DateTime),
// EndDate = new DateTime(iyear, imonth, iday,ihour, imin, isec),
// CssClass = "red_section",
// SpanType = DHXTimeSpan.Type.BlockEvents
// });
//}
scheduler.BeforeInit.Add("schedulerClient.init()");
//var check = new LightboxCheckbox("highlighting", "Important") { MapTo = "color", CheckedValue = "#FE7510" };
//scheduler.Lightbox.Add(check);
return View(scheduler);
}
return View();
}
Image

Do you mean you need to show some kind of popup showing additional info during task move/resize?
If so, you can use template for task content - if the current task is being dragged or resized, a template should return an absolute positioned popup with a custom content
E.g.
JS:
scheduler.attachEvent("onSchedulerReady", function () {
var headerTemplate = scheduler.templates.event_header;
scheduler.templates.event_header = function (start, end, event) {
var content = headerTemplate(start, end, event);
if (scheduler.getState().drag_id == event.id) {
var dragPopup = "<div class='drag-popup'>" + headerTemplate(start, end, event) + "</div>";
content += dragPopup;
}
return content;
};
});
CSS:
.drag-popup{
position: absolute;
right:0;
top: 0;
margin-right: 120px;
padding: 10px;
width: 100px;
background-color: inherit;
color: inherit;
z-index: 5;
}
Result:
Although, with this approach you'll need to manage tooltip position more thoughtfully than i did in this sample. Since popup is nested in event's DOM element, it will be limited by a scheduler container. E.g. when event is in left-most column - you'll need to locate popup at right, otherwise it will be cutted.
Here are the related API methods
http://docs.dhtmlx.com/scheduler/api__scheduler_getstate.html
http://docs.dhtmlx.com/scheduler/api__scheduler_event_header_template.html

Related

EPPlus two color conditional date format

I have a column with dates and I want to conditionally color any cell that is older that 2 week yellow, and any that is older than 90 days red. I can't figure out how to do that.
Should be able to just add the conditions like any other. You can use the TODAY() function in excel and subtract:
[TestMethod]
public void Conditional_Formatting_Date()
{
//https://stackoverflow.com/questions/56741642/epplus-two-color-conditional-date-format
var file = new FileInfo(#"c:\temp\Conditional_Formatting_Date.xlsx");
if (file.Exists)
file.Delete();
//Throw in some data
var dataTable = new DataTable("tblData");
dataTable.Columns.AddRange(new[] {
new DataColumn("Col1", typeof(DateTime)),
new DataColumn("Col3", typeof(string))
});
var rnd = new Random();
for (var i = 0; i < 100; i++)
{
var row = dataTable.NewRow();
row[0] = DateTime.Now.AddDays(-rnd.Next(1, 100));
row[1] = $"=TODAY() - A{i +1}";
dataTable.Rows.Add(row);
}
//Create a test file
using (var package = new ExcelPackage(file))
{
//Make the stylesheet
var ws = package.Workbook.Worksheets.Add("table");
var range = ws.Cells[1, 1].LoadFromDataTable(dataTable, false);
ws.Column(1).Style.Numberformat.Format = "mm-dd-yy";
ws.Column(1).AutoFit();
//Add the calc check
var count = 0;
foreach (DataRow row in dataTable.Rows)
ws.Cells[++count, 2].Formula = row[1].ToString();
//Add the conditions - order matters
var rangeA = range.Offset(0, 0, count, 1);
var condition90 = ws.ConditionalFormatting.AddExpression(rangeA);
condition90.Style.Font.Color.Color = Color.White;
condition90.Style.Fill.PatternType = ExcelFillStyle.Solid;
condition90.Style.Fill.BackgroundColor.Color = Color.Red;
condition90.Formula = "TODAY() - A1> 90";
condition90.StopIfTrue = true;
var condition14 = ws.ConditionalFormatting.AddExpression(rangeA);
condition14.Style.Font.Color.Color = Color.Black;
condition14.Style.Fill.PatternType = ExcelFillStyle.Solid;
condition14.Style.Fill.BackgroundColor.Color = Color.Yellow;
condition14.Formula = "TODAY() - A1> 14";
package.Save();
}
}
Which gives this in the output:
I am assuming that you have the column number of the date column and number of rows in your records. Also, the following loop is under assumption that the first row is your column header and records begin from second row. Change the loop counter's initialization and assignment accordingly.
int rowsCount; //get your no of rows
int dateColNumber; //Assign column number in excel file of your date column
string cellValue;
DateTime dateValue;
DateTime today = DateTime.Now;
double daysCount;
for(int i=1;i<rowsCount;i++)
{
cellValue = ws.Cells[i + 1, dateColNumber].Text.ToString(); //First row is header start from second
if(DateTime.TryParse(cellValue,out dateValue))
{
daysCount = (today - dateValue).Days;
if(daysCount>90)
{
ws.Cells[i + 1,dateColNumber].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
ws.Cells[i + 1,dateColNumber].Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.Red);
}
else if(daysCount>14)
{
ws.Cells[i + 1, dateColNumber].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
ws.Cells[i + 1, dateColNumber].Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.Yellow);
}
}
}

Optaplanner ScoreDirector continuous planning DayOff Request

I am trying to enable continuous planning and requests. I have tried to follow the computer example provided within the doco. Code below. I can see the values updated during debug. Code below. What am I doing wrong
public void addEmployeeDayOff(final Employee employee,final DayOffRequest dayOffRequest) {
logger.info("Scheduling employee dayoff ({}).", dayOffRequest);
doProblemFactChange(scoreDirector -> {
NurseRoster nurseRoster = scoreDirector.getWorkingSolution();
Employee workingEmployee = scoreDirector.lookUpWorkingObject(employee);
DayOffRequest dayoffRequest = scoreDirector.lookUpWorkingObject(dayOffRequest);
scoreDirector.beforeProblemPropertyChanged(workingEmployee);
if (workingEmployee == null) {
return;
}
ArrayList<DayOffRequest> requestoffList = new ArrayList<>(nurseRoster.getDayOffRequestList());
nurseRoster.setDayOffRequestList(requestoffList);
scoreDirector.beforeProblemFactAdded(dayoffRequest);
workingEmployee.getDayOffRequestMap().put(dayoffRequest.getShiftDate(), dayoffRequest);
scoreDirector.afterProblemPropertyChanged(workingEmployee);
nurseRoster.getDayOffRequestList().add(dayoffRequest);
scoreDirector.afterProblemPropertyChanged(dayoffRequest);
scoreDirector.triggerVariableListeners();
});
The above is called from here:
List<DayOffRequest> dayOffRequestList;
//updating from database .. not sure if this is the issue
List<DayOffData> dayOffElementList = (List<DayOffData>) rosterService.listDayOffData();
dayOffRequestList = new ArrayList<>(dayOffElementList.size());
long nextdayoffId =0L;
for (DayOffData element : dayOffElementList) {
if (nextdayoffId <= element.getId()) {
nextdayoffId = element.getId() + 1L;
}
DayOffRequest dayOffRequest = new DayOffRequest();
String empID = element.getEmployee().getName();
int weight = element.getWeight();
LocalDate shiftDate = element.getShiftDate();
ShiftDate date1 = shiftDateMap.get(shiftDate);
Employee employee = employeeMap.get(empID);
dayOffRequest.setId(nextdayoffId);
dayOffRequest.setWeight(weight);
dayOffRequest.setEmployee(employee);
dayOffRequest.setShiftDate(date1);
dayOffRequestList.add(dayOffRequest);
//If this is not enabled the values don't pass to the addEmployeeDayOff method is this correct??
scoreDirector.afterProblemFactAdded(dayOffRequest);
scoreDirector.afterProblemFactAdded(employee);
addEmployeeDayOff(employee,dayOffRequest);
}
I found this worked but not sure if this is the correct way to approach the problem.
public void addEmployeeDayOff(final Employee employee, final DayOffRequest dayOffRequest) {
logger.info("Scheduling employee dayoff ({}).", dayOffRequest);
doProblemFactChange(scoreDirector -> {
NurseRoster nurseRoster = (NurseRoster) scoreDirector.getWorkingSolution();
Employee workingEmployee = scoreDirector.lookUpWorkingObject(employee);
DayOffRequest dayoffRequest = (DayOffRequest) scoreDirector.lookUpWorkingObject(dayOffRequest);
scoreDirector.beforeProblemPropertyChanged(workingEmployee);
if (workingEmployee == null) {
return;
}
ArrayList<DayOffRequest> requestoffList = new ArrayList<>(nurseRoster.getDayOffRequestList());
nurseRoster.setDayOffRequestList(requestoffList);
scoreDirector.afterProblemFactAdded(requestoffList);
scoreDirector.afterProblemPropertyChanged(requestoffList);
ArrayList<Employee> beforeempList = new ArrayList<>(nurseRoster.getEmployeeList());
nurseRoster.setEmployeeList(beforeempList);
nurseRoster.getEmployeeList().remove(workingEmployee);
scoreDirector.beforeProblemFactRemoved(workingEmployee);
scoreDirector.afterProblemFactRemoved(workingEmployee);
ArrayList<Employee> empList = new ArrayList<>(nurseRoster.getEmployeeList());
nurseRoster.setEmployeeList(empList);
workingEmployee.getDayOffRequestMap().put(dayOffRequest.getShiftDate(), dayOffRequest);
nurseRoster.getEmployeeList().add(workingEmployee);
scoreDirector.beforeProblemFactAdded(workingEmployee);
scoreDirector.afterProblemFactAdded(workingEmployee);
scoreDirector.triggerVariableListeners();
});
I have uploaded the xml and Java file here https://github.com/rod182211/Optaplanner in to hope someone can advise why when I advance 14 days not all rule continue to apply. I assumed scoredirector only needed to be made aware of changes.
14 Day advance taking into account Requests via the below.
doProblemFactChange(scoreDirector -> {
NurseRoster nurseRoster = scoreDirector.getWorkingSolution();
NurseRosterParametrization nurseRosterParametrization = nurseRoster
.getNurseRosterParametrization();
List<ShiftDate> shiftDateList = nurseRoster.getShiftDateList();
Shift oldLastShift = nurseRoster.getShiftList()
.get(nurseRoster.getShiftList().size() - 1);
long shiftId = oldLastShift.getId() + 1L;
int shiftIndex = oldLastShift.getIndex() + 1;
ShiftDate oldLastShiftDate = shiftDateList
.get(shiftDateList.size() - 1);
long shiftDateId = (oldLastShiftDate.getId() + 1L);
int shiftDayIndex = (oldLastShiftDate.getDayIndex() + 1);
// long parmId = nurseRoster.getNurseRosterParametrization().getId()
// + 1L;
scoreDirector
.beforeProblemPropertyChanged(nurseRosterParametrization);
// Update to get the first day along with adding 14 days to the run
LocalDate startDate = (oldLastShiftDate.getDate().plusDays(1));
LocalDate endDate = (oldLastShiftDate.getDate().plusDays(14));
int maxDayIndex = Math.toIntExact(DAYS.between(startDate, endDate));
int shiftDateSize = maxDayIndex + 1;
List<ShiftDate> shiftDateList1 = new ArrayList<>(shiftDateSize);
shiftDateMap = new HashMap<>(shiftDateSize);
LocalDate date = startDate;
for (int i = 0; i < shiftDateSize; i++) {
ShiftDate shiftDate = new ShiftDate();
shiftDate.setId(shiftDateId);
shiftDate.setDayIndex(shiftDayIndex);
shiftDate.setDate(date);
shiftDate.setShiftList(new ArrayList<>());
shiftDateMap.put(date, shiftDate);
shiftDateId++;
shiftDayIndex++;
date = date.plusDays(1);
nurseRoster.getShiftDateList().add(shiftDate);
shiftDateList1.add(shiftDate);
scoreDirector.afterProblemFactAdded(shiftDate);
}
List<Skill> skillList;
List<Skill> skillElementList = (List<Skill>) nurseRoster
.getSkillList();
skillList = new ArrayList<>(skillElementList.size());
skillMap = new HashMap<>(skillElementList.size());
long id = 0L;
for (Skill element : skillElementList) {
Skill skill = new Skill();
skill.setId(id);
skill.setCode(element.getCode());
skillList.add(skill);
if (skillMap.containsKey(skill.getCode())) {
throw new IllegalArgumentException(
"There are 2 skills with the same code ("
+ skill.getCode() + ").");
}
skillMap.put(skill.getCode(), skill);
id++;
}
List<Contract> contractElementList = (List<Contract>) nurseRoster
.getContractList();
List<Contract> contractList = new ArrayList<>(
contractElementList.size());
contractMap = new HashMap<>(contractElementList.size());
for (Contract element : contractElementList) {
Contract contract = new Contract();
long Id = element.getId();
contract.setId(Id);
contract.setCode(element.getCode());
contract.setDescription(element.getDescription());
WeekendDefinition weekend = element.getWeekendDefinition();
contract.setWeekendDefinition(weekend);
contract.setContractLineList(new ArrayList<ContractLine>());
contractMap.put(contract.getCode(), contract);
contractList.add(contract);
}
List<ShiftTypeSkillRequirement> coverRequirementElementList = (List<ShiftTypeSkillRequirement>) nurseRoster
.getShiftTypeSkillRequirementList();
List<ShiftType> shiftTypeElementList = (List<ShiftType>) rosterService
.listShiftType();
List<ShiftType> shiftTypeList = new ArrayList<>(
shiftTypeElementList.size());
shiftTypeMap = new HashMap<>(shiftTypeElementList.size());
long Id = 0L;
int index = 0;
long shiftTypeSkillRequirementId = 0L;
List<ShiftTypeSkillRequirement> shiftTypeSkillRequirementList = new ArrayList<>(
shiftTypeElementList.size() * 2);
for (ShiftType element : shiftTypeElementList) {
ShiftType shiftType = new ShiftType();
shiftType.setId(Id);
shiftType.setCode(element.getCode());
shiftType.setIndex(index);
String startTimeString = element.getStartTimeString();
shiftType.setStartTimeString(startTimeString);
String endTimeString = element.getEndTimeString();
shiftType.setEndTimeString(endTimeString);
shiftType
.setNight(startTimeString.compareTo(endTimeString) > 0);
shiftType.setDescription(element.getDescription());
for (ShiftTypeSkillRequirement skillElement : coverRequirementElementList) {
ShiftTypeSkillRequirement shiftTypeSkillRequirement = new ShiftTypeSkillRequirement();
shiftTypeSkillRequirement
.setId(shiftTypeSkillRequirementId);
shiftTypeSkillRequirement.setShiftType(shiftType);
Skill skill = skillMap
.get(skillElement.getSkill().getCode());
if (skill == null) {
throw new IllegalArgumentException("The skill ("
+ skillElement.getSkill().getCode()
+ ") of shiftType (" + shiftType.getCode()
+ ") does not exist.");
}
shiftTypeSkillRequirement.setSkill(skill);
shiftTypeSkillRequirementList
.add(shiftTypeSkillRequirement);
shiftTypeSkillRequirementId++;
}
shiftTypeList.add(shiftType);
if (shiftTypeMap.containsKey(shiftType.getCode())) {
throw new IllegalArgumentException(
"There are 2 shiftTypes with the same code ("
+ shiftType.getCode() + ").");
}
shiftTypeMap.put(shiftType.getCode(), shiftType);
Id++;
index++;
}
nurseRoster.setShiftTypeList(shiftTypeList);
nurseRoster.setShiftTypeSkillRequirementList(
shiftTypeSkillRequirementList);
int shiftListSize = shiftDateMap.size() * shiftTypeList.size();
List<Shift> shiftList1 = new ArrayList<>(shiftListSize);
dateAndShiftTypeToShiftMap = new HashMap<>(shiftListSize);
dayOfWeekAndShiftTypeToShiftListMap = new HashMap<>(
7 * shiftTypeList.size());
for (ShiftDate shiftDate : shiftDateList1) {
for (ShiftType shiftType : shiftTypeList) {
Shift shift = new Shift();
shift.setId(shiftId);
shift.setShiftDate(shiftDate);
shiftDate.getShiftList().add(shift);
shift.setShiftType(shiftType);
shift.setIndex(shiftIndex);
shift.setRequiredEmployeeSize(0); // Filled in later
shiftList1.add(shift);
dateAndShiftTypeToShiftMap.put(
Pair.of(shiftDate.getDate(), shiftType.getCode()),
shift);
addShiftToDayOfWeekAndShiftTypeToShiftListMap(shiftDate,
shiftType, shift);
shiftId++;
shiftIndex++;
nurseRoster.getShiftList().add(shift);
scoreDirector.afterProblemFactAdded(shift);
}
}
List<DayOffRequest> dayOffRequestList;
List<DayOffRequest> requestList = (List<DayOffRequest>) nurseRoster.getDayOffRequestList();
DayOffRequest oldLastDayOff = requestList.get(requestList.size() - 1);
long DayOffId = (oldLastDayOff.getId() + 1l);
List<DayOffDate> dayOffElementList = rosterService.listDayOffDate();
dayOffRequestList = new ArrayList<>(dayOffElementList.size());
for (DayOffDate element : dayOffElementList) {
DayOffRequest dayOffRequest = new DayOffRequest();
int weight = element.getWeight();
LocalDate shiftDate = element.getDate();
ShiftDate date1 = shiftDateMap.get(shiftDate);
Employee employee = element.getEmployee();
Employee workingEmployee = scoreDirector.lookUpWorkingObject(employee);
dayOffRequest.setId(DayOffId);
DayOffId++;
dayOffRequest.setWeight(weight);
dayOffRequest.setEmployee(workingEmployee);
dayOffRequest.setShiftDate(date1);
workingEmployee.getDayOffRequestMap().put(date1, dayOffRequest);
nurseRoster.getDayOffRequestList().add(dayOffRequest);
}
List<DayOnRequest> dayOnRequestList;
List<DayOnDate> dayOnElementList1 = rosterService.listDayOnDate();
dayOnRequestList = new ArrayList<>(dayOnElementList1.size());
for (DayOnDate element : dayOnElementList1) {
DayOnRequest dayOnRequest = new DayOnRequest();
long DayOnId = element.getId();
int weight = element.getWeight();
LocalDate localshiftDate = element.getDate();
ShiftDate dateon = shiftDateMap.get(localshiftDate);
Employee employee = element.getEmployee();
Employee workingEmployee = scoreDirector.lookUpWorkingObject(employee);
dayOnRequest.setId(DayOnId);
dayOnRequest.setWeight(weight);
dayOnRequest.setEmployee(workingEmployee);
dayOnRequest.setShiftDate(dateon);
dayOnRequestList.add(dayOnRequest);
workingEmployee.getDayOnRequestMap().put(dateon, dayOnRequest);
nurseRoster.getDayOnRequestList().add(dayOnRequest);
}
List<ShiftOffRequest> shiftOffRequestList;
List<ShiftOffDate> shiftOffElementList = (List<ShiftOffDate>) rosterService.listShiftOffDate();
shiftOffRequestList = new ArrayList<>(shiftOffElementList.size());
for (ShiftOffDate element : shiftOffElementList) {
ShiftOffRequest shiftOffRequest = new ShiftOffRequest();
long ShiftonId = element.getId();
int weight = element.getWeight();
Employee employee = element.getEmployee();
Employee workingEmployee = scoreDirector.lookUpWorkingObject(employee);
LocalDate date1 = element.getDate();
String shiftcode = element.getShiftType().getCode();
Shift shift = dateAndShiftTypeToShiftMap.get(Pair.of(date1, shiftcode));
shiftOffRequest.setId(ShiftonId);
shiftOffRequest.setEmployee(workingEmployee);
shiftOffRequest.setShift(shift);
shiftOffRequest.setWeight(weight);
shiftOffRequestList.add(shiftOffRequest);
workingEmployee.getShiftOffRequestMap().put(shift, shiftOffRequest);
nurseRoster.setShiftOffRequestList(shiftOffRequestList);
}
List<ShiftOnRequest> shiftOnRequestList;
List<ShiftOnDate> shiftOnElementList = (List<ShiftOnDate>) rosterService.listShiftOnDate();
shiftOnRequestList = new ArrayList<>(shiftOnElementList.size());
for (ShiftOnDate element : shiftOnElementList) {
ShiftOnRequest shiftOnRequest = new ShiftOnRequest();
long ShiftonId = element.getId();
int weight = element.getWeight();
Employee employee = element.getEmployee();
Employee workingEmployee = scoreDirector.lookUpWorkingObject(employee);
LocalDate date1 = element.getDate();
String shiftcode = element.getShiftType().getCode();
Shift shift = dateAndShiftTypeToShiftMap.get(Pair.of(date1, shiftcode));
shiftOnRequest.setId(ShiftonId);
shiftOnRequest.setEmployee(workingEmployee);
shiftOnRequest.setShift(shift);
shiftOnRequest.setWeight(weight);
shiftOnRequestList.add(shiftOnRequest);
workingEmployee.getShiftOnRequestMap().put(shift, shiftOnRequest);
nurseRoster.setShiftOnRequestList(shiftOnRequestList);
}
List<CoverRequirements> coverRequirementElementList1 = (List<CoverRequirements>) rosterService
.listCoverRequirements();
for (CoverRequirements element : coverRequirementElementList1) {
String type = element.getShiftType().getCode();
DayOfWeek day = element.getDayOfWeek();
int req = element.getRequiredEmployeesize();
ShiftType shiftType = shiftTypeMap.get(type);
Pair<DayOfWeek, ShiftType> key = Pair.of(day, shiftType);
List<Shift> shiftList = dayOfWeekAndShiftTypeToShiftListMap
.get(key);
for (Shift shift : shiftList) {
shift.setRequiredEmployeeSize(
shift.getRequiredEmployeeSize() + req);
}
}
List<ShiftAssignment> shiftAssignmentList = new ArrayList<>(
shiftList1.size());
long shiftAssignmentId = nurseRoster.getShiftAssignmentList()
.get(nurseRoster.getShiftAssignmentList().size() - 1)
.getId() + 1L;
for (Shift shift : shiftList1) {
for (int i = 0; i < shift.getRequiredEmployeeSize(); i++) {
ShiftAssignment newShiftAssignment = new ShiftAssignment();
newShiftAssignment.setId(shiftAssignmentId);
shiftAssignmentId++;
newShiftAssignment.setShift(shift);
newShiftAssignment.setIndexInShift(i);
shiftAssignmentList.add(newShiftAssignment);
nurseRoster.getShiftAssignmentList()
.add(newShiftAssignment);
scoreDirector.afterEntityAdded(newShiftAssignment);
}
}
//This should move the planning window
nurseRosterParametrization.setFirstShiftDate(shiftDateList1.get(0));
nurseRosterParametrization.setLastShiftDate(shiftDateList1.get(shiftDateList1.size() - 1));
nurseRosterParametrization.setPlanningWindowStart(shiftDateList1.get(0));
nurseRoster.setNurseRosterParametrization(nurseRosterParametrization);
scoreDirector.afterProblemPropertyChanged(nurseRosterParametrization);
scoreDirector.triggerVariableListeners();
}, true);
}

Colouring Excel cell with condition using DocumentFormat.OpenXml

I would like to know if someone have worked on DocumentFormat.OpenXml as I have an issue with the colouring of sheet cell on condition using DocumentFormat.Spreadsheet.
Now I can create the colour for the 1st time but I need to open the same excel sheet and based on the condition I need to colour a particular cell. E.g. if cell D1 is yellow then D2 may be green or yellow.
e.g.
Name IpAddress Region Details
Switch 10.1.1.1 EMEA Based on Condition the cell would be coloured 
Switch 10.1.1.2 AMER Based on Condition the cell would be coloured 
Switch 10.1.1.3 APAC Based on Condition the cell would be coloured 
Switch 10.1.1.2 AMER Based on Condition the cell would be coloured 
Switch 10.1.1.2 AMER Based on Condition the cell would be coloured 
I’m writing each row at a time and when I want to open existing excel sheet I would pass the value i.e. _valuecolour and based its value it would colour the particular cell along with the alignment of the other cells.
I have used the code below.
public static bool InsertRowExcel(string filepath, string _sb, string _switchinput)
{
int i = 0;
string[] _arr = _switchinput.Split(',');
bool bl = false;
int k = 0;
try
{
using (SpreadsheetDocument myDoc = SpreadsheetDocument.Open(filepath, true))
{
//Get workbookpart
WorkbookPart workbookPart = myDoc.WorkbookPart;
WorkbookStylesPart stylePart = workbookPart.WorkbookStylesPart;
Row row = new Row();
//then access to the worksheet part
IEnumerable<WorksheetPart> worksheetPart = workbookPart.WorksheetParts;
foreach (WorksheetPart WSP in worksheetPart)
{
//find sheet data
IEnumerable<SheetData> sheetData = WSP.Worksheet.Elements<SheetData>();
// Iterate through every sheet inside Excel sheet
foreach (SheetData SD in sheetData)
{
IEnumerable<Row> rows = SD.Elements<Row>(); // Get the row IEnumerator
i = (rows.Count()); // Will give you the count of rows
do
{ row = new Row();
row.Append(
ConstructCell(_arr[0], CellValues.String),
ConstructCell(_arr[1], CellValues.String),
ConstructCell(_arr[2], CellValues.String),
ConstructCell(_sb, CellValues.String,2U)
);
}
while (k > 0);
/* HERE I NEED TO ADD STYLE TO THE CELL. */
}
}
bl = true;
}
}
catch (Exception ex)
{
bl = false;
throw ex;
}
return bl;
}
private static Stylesheet GenerateStylesheet(bool _valuecolour)
{
Stylesheet styleSheet = null;
Fills fills = new Fills();
if (_valuecolour)
{
fills = new Fills(
new Fill(new PatternFill() { PatternType = PatternValues.None }), // Index 0 - default
new Fill(new PatternFill() { PatternType = PatternValues.Gray125 }), // Index 1 - default
new Fill(new PatternFill(new ForegroundColor { Rgb = new HexBinaryValue() { Value = "FFFFFF00" } })
{ PatternType = PatternValues.Solid })
);
}
else
{
fills = new Fills(
new Fill(new PatternFill() { PatternType = PatternValues.None }), // Index 0 - default
new Fill(new PatternFill() { PatternType = PatternValues.Gray125 }), // Index 1 - default
new Fill(new PatternFill(new ForegroundColor { Rgb = new HexBinaryValue() { Value = "008000" } })
{ PatternType = PatternValues.Solid }) // Index 2 - body
);
}
CellFormats cellFormats = new CellFormats(
new CellFormat(), // default
new CellFormat(new Alignment() { Horizontal = HorizontalAlignmentValues.Left, Vertical = VerticalAlignmentValues.Top, WrapText = true })
{ FontId = 0, FillId = 0, BorderId = 1, ApplyAlignment = true },
new CellFormat(new Alignment() { Horizontal = HorizontalAlignmentValues.Left, Vertical = VerticalAlignmentValues.Top, WrapText = true }){ FontId = 1, FillId = 2, BorderId = 1, ApplyFill = true }); // header
styleSheet = new Stylesheet(fills, cellFormats);
return styleSheet;
}
private static Cell ConstructCell(string value, CellValues dataType,uint styleIndex = 0)
{
return new Cell()
{
CellValue = new CellValue(value),
DataType = new EnumValue<CellValues>(dataType),
StyleIndex = styleIndex
};
}
Here is the code which works as expected
enter code here
#region ReadWriteExcel File
public static bool ReadWriteExcel(string _sb, string _switchinput, bool _checkinitial)
{
string _str = string.Empty;
bool _checkStatus = false;
bool bl = false;
String[] _arr;
_arr = _switchinput.Split(',');
int i = 0;
string filepath = _directoryPath + DateTime.Now.ToString("dd.MM.yyyy") + ".xlsx";
bl = (File.Exists(filepath) ? true : false);
if (bl) // && _checkinitial
{
//_sb = string.Empty;
//LogWrite("Just Before InsertRowExcel " + _switchinput);
_checkStatus = InsertRowExcel(filepath, _sb.ToString(), _switchinput);
}
else
{
using (SpreadsheetDocument document = SpreadsheetDocument.Create(filepath, SpreadsheetDocumentType.Workbook))
{
try
{
WorkbookPart workbookPart = document.AddWorkbookPart();
workbookPart.Workbook = new Workbook();
WorksheetPart worksheetPart = workbookPart.AddNewPart<WorksheetPart>();
WorkbookStylesPart stylePart = workbookPart.AddNewPart<WorkbookStylesPart>();
worksheetPart.Worksheet = new Worksheet();
Sheets sheets = workbookPart.Workbook.AppendChild(new Sheets());
Sheet sheet = new Sheet() { Id = workbookPart.GetIdOfPart(worksheetPart), SheetId = 1, Name = "SAN Switch Health Check" };
sheets.Append(sheet);
stylePart.Stylesheet = GenerateStylesheetDefault();
stylePart.Stylesheet.Save();
workbookPart.Workbook.Save();
SheetData sheetData = worksheetPart.Worksheet.AppendChild(new SheetData());
// Constructing header
Row row = new Row();
row.Append(
ConstructCell("Device_type", CellValues.String),
ConstructCell("Name", CellValues.String),
ConstructCell("IP Address", CellValues.String),
ConstructCell("Status", CellValues.String)
);
// Insert the header row to the Sheet Data
sheetData.AppendChild(row);
do
{
//for (int i = 0; i < _arr.Length - 1; i++)
//{
row = new Row();
row.Append(
ConstructCell(_arr[0], CellValues.String, 1U),
ConstructCell(_arr[1], CellValues.String, 1U),
ConstructCell(_arr[2], CellValues.String, 1U));//,
//ConstructCell(_sb, CellValues.String,2U));
//sheetData.AppendChild(row);
}
while (i > 0);
if (_sb != "Normal")
{
row.Append(
ConstructCell(_sb, CellValues.String, 2U));
}
else
{
row.Append(
ConstructCell(_sb, CellValues.String, 3U));
}
sheetData.AppendChild(row);
//stylePart.Stylesheet.Save();
worksheetPart.Worksheet.Save();
_checkStatus = true;
}
catch (Exception ex)
{
_checkStatus = false;
//LogWrite(ex.StackTrace.ToString());
throw ex;
}
document.Close();
document.Dispose();
}
}
return _checkStatus;
}
private static Cell ConstructCell(string value, CellValues dataType, uint styleIndex = 0)
{
return new Cell()
{
CellValue = new CellValue(value),
DataType = new EnumValue<CellValues>(dataType),
StyleIndex = styleIndex
};
}
public static bool InsertRowExcel(string filepath, string _sb, string _switchinput)
{
// LogWrite("InsertRowExcel " + _switchinput);
int i = 0; int k = 0; bool bl = false; string[] _arr = _switchinput.Split(',');
using (SpreadsheetDocument myDoc = SpreadsheetDocument.Open(filepath, true))
{
//Get workbookpart
WorkbookPart workbookPart = myDoc.WorkbookPart;
WorkbookStylesPart stylePart = workbookPart.WorkbookStylesPart;
Row row = new Row();
stylePart.Stylesheet = GenerateStylesheetDefault();
stylePart.Stylesheet.Save();
//then access to the worksheet part
IEnumerable<WorksheetPart> worksheetPart = workbookPart.WorksheetParts;
foreach (WorksheetPart WSP in worksheetPart)
{//find sheet data
SheetData sheetData = WSP.Worksheet.Elements<SheetData>().First();
IEnumerable<Row> rows = sheetData.Elements<Row>(); // Get the row IEnumerator
i = (rows.Count()); // Will give you the count of rows
/* HERE I NEED TO ADD STYLE TO THE CELL on condition. */
do
{
row = new Row();
row.Append(
ConstructCell(_arr[0], CellValues.String),
ConstructCell(_arr[1], CellValues.String),
ConstructCell(_arr[2], CellValues.String)
);
if (_sb != "Normal")
{
row.Append(
ConstructCell(_sb, CellValues.String, 2U));
}
else
{
row.Append(
ConstructCell(_sb, CellValues.String, 3U));
}
sheetData.Append(row);
} while (k > 0);
}
bl = true;
myDoc.Close();
myDoc.Dispose();
}
return bl;
}
public static Stylesheet GenerateStylesheetDefault()
{
Stylesheet stylesheet1 = new Stylesheet();
Fonts fonts = new Fonts(
new Font(
new FontSize() { Val = 11D },
new Color() { Theme = (UInt32Value)1U },
new FontName() { Val = "Calibri" },
new FontFamilyNumbering() { Val = 2 },
new FontScheme() { Val = FontSchemeValues.Minor }
)
);
Borders borders = new Borders(
new Border(
new LeftBorder(),
new RightBorder(),
new TopBorder(),
new BottomBorder(),
new DiagonalBorder())
);
Fills fills = new Fills();
fills = new Fills(
new Fill(
new PatternFill() { PatternType = PatternValues.None }), //0
new Fill(
new PatternFill() { PatternType = PatternValues.Gray125 }),//1
new Fill(
new PatternFill(
new ForegroundColor { Rgb = new HexBinaryValue() { Value = "FFFFFF00" } }) //2 -yellow
{ PatternType = PatternValues.Solid }),
new Fill(
new PatternFill(
new ForegroundColor { Rgb = new HexBinaryValue() { Value = "FF008000" } })// 3 -green
{ PatternType = PatternValues.Solid })
);
CellStyleFormats cellStyleFormats = new CellStyleFormats(
new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U }
);
CellFormats cellFormats = new CellFormats(
new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U },
new CellFormat(
new Alignment() { Horizontal = HorizontalAlignmentValues.Left, Vertical = VerticalAlignmentValues.Top, WrapText = true })
{ FontId = 0, FillId = 0, BorderId = 0, ApplyAlignment = true },
new CellFormat(
new Alignment() { Horizontal = HorizontalAlignmentValues.Left, Vertical = VerticalAlignmentValues.Top, WrapText = true })
{ FontId = 0, FillId = 2, BorderId = 0, ApplyFill = true },
new CellFormat(
new Alignment() { Horizontal = HorizontalAlignmentValues.Left, Vertical = VerticalAlignmentValues.Top, WrapText = true })
{ FontId = 0, FillId = 3, BorderId = 0, ApplyFill = true }
);
stylesheet1.Append(fonts);
stylesheet1.Append(fills);
stylesheet1.Append(borders);
stylesheet1.Append(cellStyleFormats);
stylesheet1.Append(cellFormats);
return stylesheet1;
}
#endregion

Label Printing using iTextSharp

I have a logic to export avery label pdf. The logic exports the pdf with labels properly but when i print that pdf, the page size measurements (Page properties) that i pass isn't matching with the printed page.
Page Properties
Width="48.5" Height="25.4" HorizontalGapWidth="0" VerticalGapHeight="0" PageMarginTop="21" PageMarginBottom="21" PageMarginLeft="8" PageMarginRight="8" PageSize="A4" LabelsPerRow="4" LabelRowsPerPage="10"
The above property values are converted equivalent to point values first before applied.
Convert to point
private float mmToPoint(double mm)
{
return (float)((mm / 25.4) * 72);
}
Logic
public Stream SecLabelType(LabelProp _label)
{
List<LabelModelClass> Model = new List<LabelModelClass>();
Model = RetModel(_label);
bool IncludeLabelBorders = false;
FontFactory.RegisterDirectories();
Rectangle pageSize;
switch (_label.PageSize)
{
case "A4":
pageSize = iTextSharp.text.PageSize.A4;
break;
default:
pageSize = iTextSharp.text.PageSize.A4;
break;
}
var doc = new Document(pageSize,
_label.PageMarginLeft,
_label.PageMarginRight,
_label.PageMarginTop,
_label.PageMarginBottom);
var output = new MemoryStream();
var writer = PdfWriter.GetInstance(doc, output);
writer.CloseStream = false;
doc.Open();
var numOfCols = _label.LabelsPerRow + (_label.LabelsPerRow - 1);
var tbl = new PdfPTable(numOfCols);
var colWidths = new List<float>();
for (int i = 1; i <= numOfCols; i++)
{
if (i % 2 > 0)
{
colWidths.Add(_label.Width);
}
else
{
colWidths.Add(_label.HorizontalGapWidth);
}
}
var w = iTextSharp.text.PageSize.A4.Width - (doc.LeftMargin + doc.RightMargin);
var h = iTextSharp.text.PageSize.A4.Height - (doc.TopMargin + doc.BottomMargin);
var size = new iTextSharp.text.Rectangle(w, h);
tbl.SetWidthPercentage(colWidths.ToArray(), size);
//var val = System.IO.File.ReadLines("C:\\Users\\lenovo\\Desktop\\test stock\\testing3.txt").ToArray();
//var ItemNoArr = Model.Select(ds => ds.ItemNo).ToArray();
//string Header = Model.Select(ds => ds.Header).FirstOrDefault();
int cnt = 0;
bool b = false;
int iAddRows = 1;
for (int iRow = 0; iRow < ((Model.Count() / _label.LabelsPerRow) + iAddRows); iRow++)
{
var rowCells = new List<PdfPCell>();
for (int iCol = 1; iCol <= numOfCols; iCol++)
{
if (Model.Count() > cnt)
{
if (iCol % 2 > 0)
{
var cellContent = new Phrase();
if (((iRow + 1) >= _label.StartRow && (iCol) >= (_label.StartColumn + (_label.StartColumn - 1))) || b)
{
b = true;
try
{
var StrArr = _label.SpineLblFormat.Split('|');
foreach (var x in StrArr)
{
string Value = "";
if (x.Contains(","))
{
var StrCommaArr = x.Split(',');
foreach (var y in StrCommaArr)
{
if (y != "")
{
Value = ChunckText(cnt, Model, y, Value);
}
}
if (Value != null && Value.Replace(" ", "") != "")
{
cellContent.Add(new Paragraph(Value));
cellContent.Add(new Paragraph("\n"));
}
}
else
{
Value = ChunckText(cnt, Model, x, Value);
if (Value != null && Value.Replace(" ", "") != "")
{
cellContent.Add(new Paragraph(Value));
cellContent.Add(new Paragraph("\n"));
}
}
}
}
catch (Exception e)
{
var fontHeader1 = FontFactory.GetFont("Verdana", BaseFont.CP1250, true, 6, 0);
cellContent.Add(new Chunk("NA", fontHeader1));
}
cnt += 1;
}
else
iAddRows += 1;
var cell = new PdfPCell(cellContent);
cell.FixedHeight = _label.Height;
cell.HorizontalAlignment = Element.ALIGN_LEFT;
cell.Border = IncludeLabelBorders ? Rectangle.BOX : Rectangle.NO_BORDER;
rowCells.Add(cell);
}
else
{
var gapCell = new PdfPCell();
gapCell.FixedHeight = _label.Height;
gapCell.Border = Rectangle.NO_BORDER;
rowCells.Add(gapCell);
}
}
else
{
var gapCell = new PdfPCell();
gapCell.FixedHeight = _label.Height;
gapCell.Border = Rectangle.NO_BORDER;
rowCells.Add(gapCell);
}
}
tbl.Rows.Add(new PdfPRow(rowCells.ToArray()));
_label.LabelRowsPerPage = _label.LabelRowsPerPage == null ? 0 : _label.LabelRowsPerPage;
if ((iRow + 1) < _label.LabelRowsPerPage && _label.VerticalGapHeight > 0)
{
tbl.Rows.Add(CreateGapRow(numOfCols, _label));
}
}
doc.Add(tbl);
doc.Close();
output.Position = 0;
return output;
}
private PdfPRow CreateGapRow(int numOfCols, LabelProp _label)
{
var cells = new List<PdfPCell>();
for (int i = 0; i < numOfCols; i++)
{
var cell = new PdfPCell();
cell.FixedHeight = _label.VerticalGapHeight;
cell.Border = Rectangle.NO_BORDER;
cells.Add(cell);
}
return new PdfPRow(cells.ToArray());
}
A PDF document may have very accurate measurements, but then those measurements get screwed up because the page is scaled during the printing process. That is a common problem: different printers will use different scaling factors with different results when you print the document using different printers.
How to avoid this?
In the print dialog of Adobe Reader, you can choose how the printer should behave:
By default, the printer will try to "Fit" the content on the page, but as not every printer can physically use the full page size (due to hardware limitations), there's a high chance the printer will scale the page down if you use "Fit".
It's better to choose the option "Actual size". The downside of using this option is that some content may get lost because it's too close to the border of the page in an area that physically can't be reached by the printer, but the advantage is that the measurements will be preserved.
You can set this option programmatically in your document by telling the document it shouldn't scale:
writer.AddViewerPreference(PdfName.PRINTSCALING, PdfName.NONE);
See How to set initial view properties? for more info about viewer preferences.

Dhtmlx scheduler in mvc 4

I am using dhtmlx scheduler in my MVC project. My problem is i need to block the previous days in the scheduler. For example today is Monday means the previous day before monday should be blocked. Can anyone please help me?
Thanks in advance..
I added my code below.
public ActionResult CalendarView( int id , tblUser user )
{
string val = System.Configuration.ConfigurationManager.AppSettings["UserTypeId"];
int code = Convert.ToInt32(val);
Session["Butype"] = val;
var cal = (from s
in db.tblUsers
where s.UserTypeId == code && s.UserID == id
select new Appt
{
BusinessName = s.tblBusinessCategory.BusinessName,
StartTime = s.WorkingHour.StartTime
}).FirstOrDefault();
Session["BUName"] = cal.BusinessName.ToString();
var scheduler = new DHXScheduler(this);
scheduler.Skin = DHXScheduler.Skins.Flat;
scheduler.Data.Loader.PreventCache();
scheduler.EnableDynamicLoading(SchedulerDataLoader.DynamicalLoadingMode.Week);
scheduler.Extensions.Add(SchedulerExtensions.Extension.Recurring);
//scheduler.Extensions.Add(SchedulerExtensions.Extension.ActiveLinks);
//scheduler.Extensions.Add(SchedulerExtensions.Extension.Collision);
//scheduler.Extensions.Add(SchedulerExtensions.Extension.Limit);
scheduler.LoadData = true;
scheduler.EnableDataprocessor = true;
scheduler.Config.show_loading = true;
// scheduler.BeforeInit.Add("schedulerClient.init()");
Session["BUId"] = id;
var parameter = new SqlParameter[1];
parameter[0] = new SqlParameter { ParameterName = "UserId", Value = id };
List<Appt> cm = new List<Appt>();
using (SYTEntities context = new SYTEntities())
{
cm = context.Database.SqlQuery<Appt>("exec spHoliday #UserId", parameter).ToList();
}
int iyear = 2015;
int imonth = 8;
int iday = 09;
foreach (var cp in cm)
{
iyear = cp.HolidayDate.Year;
imonth = cp.HolidayDate.Month;
iday = cp.HolidayDate.Day;
scheduler.TimeSpans.Add(new DHXMarkTime()
{
StartDate = new DateTime(iyear, imonth, iday), //new DateTime(2015, 8, 06), //hl.HolidayDate ?? default(DateTime),
EndDate = new DateTime(iyear, imonth, iday + 1),
// Day = DayOfWeek.Friday,
CssClass = "red_section",
HTML = "hos",
SpanType = DHXTimeSpan.Type.BlockEvents
});
}
scheduler.BeforeInit.Add("schedulerClient.init()");
return View(scheduler);
}