예제 #1
0
 public static HtmlBuilder GanttBody(
     this HtmlBuilder hb,
     Context context,
     SiteSettings ss,
     Column groupBy,
     Column sortBy,
     int period,
     DateTime startDate,
     GanttRange range,
     EnumerableRowCollection <DataRow> dataRows,
     bool inRange)
 {
     hb
     .Hidden(
         controlId: "GanttMinDate",
         value: startDate.ToLocal(context: context).ToString(
             "d", context.CultureInfo()))
     .Hidden(
         controlId: "GanttMaxDate",
         value: startDate.AddDays(period).ToLocal(context: context).ToString(
             "d", context.CultureInfo()))
     .Hidden(
         controlId: "GanttPrevious",
         value: startDate.AddDays(-7).ToLocal(context: context).ToString(
             "d", context.CultureInfo()))
     .Hidden(
         controlId: "GanttNext",
         value: startDate.AddDays(7).ToLocal(context: context).ToString(
             "d", context.CultureInfo()))
     .Hidden(
         controlId: "GanttFirstDay",
         value: range.Min.ToLocal(context: context).ToString(
             "d", context.CultureInfo()))
     .Hidden(
         controlId: "GanttToday",
         value: DateTime.Today.ToLocal(context: context).ToString(
             "d", context.CultureInfo()))
     .Hidden(
         controlId: "ShowGanttProgressRate",
         value: ss.ShowGanttProgressRate.ToBool().ToOneOrZeroString());
     if (!inRange)
     {
         return(hb);
     }
     return(dataRows != null
         ? hb
            .Svg(id : "Gantt")
            .Svg(id: "GanttAxis")
            .Hidden(
                controlId: "GanttJson",
                value: new Gantt(
                    context: context,
                    ss: ss,
                    dataRows: dataRows,
                    groupBy: groupBy,
                    sortBy: sortBy)
                .Json(groupBy, sortBy))
         : hb);
 }
예제 #2
0
 public static HtmlBuilder Gantt(
     this HtmlBuilder hb,
     SiteSettings ss,
     string groupBy,
     string sortBy,
     int period,
     DateTime startDate,
     GanttRange range,
     EnumerableRowCollection <DataRow> dataRows,
     bool inRange = true)
 {
     return(hb.Div(css: "both", action: () => hb
                   .FieldDropDown(
                       controlId: "GanttGroupBy",
                       fieldCss: "field-auto-thin",
                       controlCss: " auto-postback",
                       labelText: Displays.GroupBy(),
                       optionCollection: ss.GanttGroupByOptions(),
                       selectedValue: groupBy,
                       insertBlank: true,
                       method: "post")
                   .FieldDropDown(
                       controlId: "GanttSortBy",
                       fieldCss: "field-auto-thin",
                       controlCss: " auto-postback",
                       labelText: Displays.SortBy(),
                       optionCollection: ss.GanttSortByOptions(),
                       selectedValue: sortBy,
                       insertBlank: true,
                       method: "post")
                   .Div(css: "field-auto-thin", action: () => hb
                        .FieldTextBox(
                            textType: HtmlTypes.TextTypes.DateTime,
                            fieldCss: "field-auto-thin",
                            controlId: "GanttStartDate",
                            controlCss: " w100 auto-postback",
                            labelText: Displays.StartDate(),
                            text: startDate.ToLocal().InRange()
                     ? startDate.ToLocal().ToString(
                                "d", Sessions.CultureInfo())
                     : string.Empty,
                            format: Displays.YmdDatePickerFormat(),
                            method: "post")
                        .Button(
                            controlId: "GanttPreviousButton",
                            text: Displays.Previous(),
                            controlCss: "button-icon",
                            accessKey: "b",
                            onClick: "$p.moveGantt('Previous');",
                            icon: "ui-icon-seek-prev")
                        .Button(
                            controlId: "GanttNextButton",
                            text: Displays.Next(),
                            controlCss: "button-icon",
                            accessKey: "n",
                            onClick: "$p.moveGantt('Next');",
                            icon: "ui-icon-seek-next")
                        .Button(
                            controlId: "GanttFirstDayButton",
                            text: Displays.FirstDay(),
                            controlCss: "button-icon",
                            onClick: "$p.moveGantt('FirstDay');",
                            icon: "ui-icon-calendar")
                        .Button(
                            controlId: "GanttTodayButton",
                            text: Displays.Today(),
                            controlCss: "button-icon",
                            onClick: "$p.moveGantt('Today');",
                            icon: "ui-icon-calendar"))
                   .FieldSlider(
                       controlId: "GanttPeriod",
                       fieldCss: "field-auto-thin",
                       controlCss: " auto-postback",
                       labelText: Displays.Period(),
                       min: Parameters.General.GanttPeriodMin,
                       max: range.Period,
                       step: 1,
                       value: period,
                       method: "post")
                   .Div(id: "GanttBody", action: () => hb
                        .GanttBody(
                            ss: ss,
                            groupBy: groupBy,
                            sortBy: sortBy,
                            period: period,
                            startDate: startDate,
                            range: range,
                            dataRows: dataRows,
                            inRange: inRange))));
 }