private void WhenShowNextFieldIsChecked() { var model = new CheckboxModel(); model.TickCheckboxToShowNextField = true; _page.FillSingleForm(model); }
public FormElementsDemoModel() { MyInformMeModel = new InformMeModel(); MyDetailsModel = new DetailsModel(); MyCheckboxModel = new CheckboxModel(); MyCityRadioModel = new CityRadioModel() { CityRadio = "IST" }; MyEnumModel = new EnumModel(); }
public ActionResult AddUserForm() { Users user = new Users(); CheckboxModel c1 = new CheckboxModel("Day1", false); CheckboxModel c2 = new CheckboxModel("Day2", false); CheckboxModel c3 = new CheckboxModel("Day3", false); List <CheckboxModel> list = new List <CheckboxModel>(); list.Add(c1); list.Add(c2); list.Add(c3); user.boxes = list; user.RegDate = DateTime.Today.Date; return(View(user)); }
private string DisplayCheckboxIndicator(RowIndicatorViewModel indicator) { var checkboxModel = new CheckboxModel( false, "indicator-radio-button", indicator.IndicatorId.ToString(), dataAttributes: new Dictionary <string, string>() { { "tableSelectable", "true" }, }, htmlClass: "radiobutton-selectable", jsonModel: indicator); return(this.RenderRazorViewToString("Controls/Inputs/Checkbox", checkboxModel)); }
public static void Initialize(EONDbContext context) { context.Database.EnsureCreated(); if (context.users.Any()) { return; } Users user1 = new Users("Italo Calvino", "*****@*****.**", "Male", DateTime.Today, "To provide rooms"); Users user2 = new Users("Milan Kundera", "*****@*****.**", "Male", DateTime.Today.AddDays(-1), "To provide beer"); Users user3 = new Users("Garcia Marquez", "*****@*****.**", "Male", DateTime.Today.AddDays(-2), "To provide chocolate"); CheckboxModel c1 = new CheckboxModel("Day1", true); CheckboxModel c2 = new CheckboxModel("Day2", false); CheckboxModel c3 = new CheckboxModel("Day3", true); List <CheckboxModel> list = new List <CheckboxModel>(); list.Add(c1); list.Add(c2); list.Add(c3); foreach (CheckboxModel cm in list) { context.boxes.Add(cm); } user1.selectedDays = list; context.users.Add(user1); context.SaveChanges(); user2.selectedDays = new List <CheckboxModel>() { new CheckboxModel("Day1", false), new CheckboxModel("Day2", true), new CheckboxModel("Day3", false) }; context.users.Add(user2); context.SaveChanges(); user3.selectedDays = new List <CheckboxModel>() { new CheckboxModel("Day1", true), new CheckboxModel("Day2", false), new CheckboxModel("Day3", false) }; context.users.Add(user3); context.SaveChanges(); }
public IActionResult Test(CheckboxModel model) { return(View("Index")); }
public ActionResult ShowInlineEditing(ITableColumnService tableColumnService, ILocalizationService localizationService, TableColumnModel column, int index, string tableName) { if (column.ColumnDataTypeId == 470 || column.ColumnDataTypeId == 471) { var model = new TextEditorModel() { LabelName = localizationService.GetLocalizedData(column.Id.ToString() + ";" + DataType.TableName + ";ColumnName"), Name = tableName + "[" + index.ToString() + "]." + column.ColumnName, Value = column.ColumnValue, PlaceHolder = localizationService.GetLocalizedData(column.Id.ToString() + ";" + DataType.TableName + ";ColumnName") }; if (column.ColumnDataTypeId == 471) { model.Type = "Number"; } return(PartialView(UrlHelpers.FloatingTemplate("_TextEditor.cshtml"), model)); } else if (column.ColumnDataTypeId == 472) { var model = new DatePickerModel() { LabelName = localizationService.GetLocalizedData(column.Id.ToString() + ";" + DataType.TableName + ";ColumnName"), Name = tableName + "[" + index.ToString() + "]." + column.ColumnName, DateFormat = "dd/MM/yyyy", Vertical = "top", PlaceHolder = localizationService.GetLocalizedData(column.Id.ToString() + ";" + DataType.TableName + ";ColumnName") }; if (column.ColumnValue != null && !string.IsNullOrEmpty(column.ColumnValue)) { model.Value = DateTime.Parse(column.ColumnValue); } else { model.Value = null; } return(PartialView(UrlHelpers.FloatingTemplate("_DatePicker.cshtml"), model)); } else if (column.ColumnDataTypeId == 473) { var model = new DropdownListModel() { LabelName = localizationService.GetLocalizedData(column.Id.ToString() + ";" + DataType.TableName + ";ColumnName"), DataType = DataType.MasterData, PropertyName = "Name", IsAnimationLabel = false, IsTagsInput = false, IsMultipleLanguage = false, ValueField = "Id", DisplayField = "Name", Name = tableName + "[" + index.ToString() + "]." + column.ColumnName, Value = column.ColumnValue }; var responseColumn = tableColumnService.ExcuteSqlString(column.SqlData); if (responseColumn != null) { var resultColumn = JsonConvert.DeserializeObject <HrmResultModel <dynamic> >(responseColumn); if (!CheckPermission(resultColumn)) { //return to Access Denied } else { model.Data = resultColumn.Results; } } return(PartialView(UrlHelpers.FloatingTemplate("_Dropdown.cshtml"), model)); } else if (column.ColumnDataTypeId == 10519) { var model = new CheckboxModel() { LabelName = localizationService.GetLocalizedData(column.Id.ToString() + ";" + DataType.TableName + ";ColumnName"), Name = tableName + "[" + index.ToString() + "]." + column.ColumnName, Value = column.ColumnValue, }; return(PartialView(UrlHelpers.FloatingTemplate("_Checkbox.cshtml"), model)); } else { return(Content("<div class=\"hrm-v2-td-template\"><span id=\"original-row-column-\"" + column.Id + ">" + column.ColumnValue + "</span></div>")); } }