public FrmEmployee(FormActionType ActionType, Employee employee) : this() { _actionType = ActionType; if (ActionType == FormActionType.Edit) { if (employee != null) { SetEmployee(employee); } else { throw new ArgumentNullException("Employee", "Can not be null"); } } if (ActionType == FormActionType.Search) { txtId.ReadOnly = false; } }
protected virtual FormlyFormParams CommonConfig(FormActionType action) { var formParams = new FormlyFormParams { SchemaName = SchemaName, Action = action, OpenApiConfigUrl = GetOpenApiConfigUrl(UrlHelper, new { name = OpenApiConfigName }), FormInstanceId = Utils.GenerateRandomHexString(), AdditionalFields = AdditionalData, Options = Options }; formParams.AddOption("basePath", UrlHelper.Content("~")); if (OpenApiConfigName != "admin-api") { formParams.AddOption("openApiConfigUrl", formParams.OpenApiConfigUrl); } formParams.UseFormSpinnerInside(); return(formParams); }
protected virtual string GetSubmitActionName(FormActionType actionType) { return(SubmitActionName ?? (actionType == FormActionType.Create ? "Create" : "Patch")); }