public CaptchaHtml(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId, isFormReadOnly) { this.SiteKey = DomainUtility.toString(obj["sitekey"]); this.PrivateKey = DomainUtility.toString(obj["privatekey"]); this.Language = DomainUtility.toString(obj["language"]); this.FillValue(); }
public OptionHtml(JObject obj) { this.Label = DomainUtility.toString(obj["label"]); this.Value = DomainUtility.toString(obj["value"]); this.Selected = (obj["selected"] != null && (bool)obj["selected"]) || (obj["checked"] != null && (bool)obj["checked"]); }
public override bool Execute(ICodeBase codeBase) { string subject = this.EmailSubject; string content = this.EmailBody; List <string> toEmailList = this.EmailTo.ToStringObj().Trim().Split(',').Where(c => !string.IsNullOrWhiteSpace(c)).ToList(); //replace variable tokens with its values. for (int i = 0; i < toEmailList.Count; i++) { foreach (string item in DomainUtility.GetRegularValue("[", "]", EmailTo).Distinct()) { toEmailList[i] = toEmailList[i].Replace("[" + item + "]", codeBase.VariableHelper.GetValue(item.Trim()).ToStringObj()); } } //replace variable tokens with its values. if (!string.IsNullOrWhiteSpace(subject)) { foreach (string item in DomainUtility.GetRegularValue("[", "]", subject).Distinct()) { subject = subject.Replace("[" + item + "]", codeBase.VariableHelper.GetValue(item.Trim()).ToStringObj()); } } //replace variable tokens with its values. if (!string.IsNullOrWhiteSpace(content)) { foreach (string item in DomainUtility.GetRegularValue("[", "]", content).Distinct()) { content = content.Replace("[" + item + "]", codeBase.VariableHelper.GetValue(item.Trim()).ToStringObj()); } } return(codeBase.MessageHelper.SendEmail(this.EmailAccountID, toEmailList, "", "", subject, content)); }
public ImageHtml(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId, isFormReadOnly) { this.Width = obj["width"] != null && !string.IsNullOrWhiteSpace(obj["width"].ToString()) ? Convert.ToInt32(obj["width"]) : (int?)null; this.Height = obj["height"] != null && !string.IsNullOrWhiteSpace(obj["height"].ToString()) ? Convert.ToInt32(obj["height"]) : (int?)null; this.Address = DomainUtility.toString(obj["address"]); this.FillValue(); }
public BindingElementBase(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId) { this.Fill = DomainUtility.toString(obj["fillBinding"]); this.Map = DomainUtility.toString(obj["mapBinding"]); this.Parameter = obj["parameter"].ToStringObj(); this.IsReadonly = isFormReadOnly ? true : (obj["readOnly"] != null ? ((bool)obj["readOnly"]) : (bool?)null); this.ValidationGroup = string.IsNullOrWhiteSpace(obj["validationGroup"].ToStringObj()) ? "nextAction" : obj["validationGroup"].ToStringObj().Trim(); }
public CheckBoxListHtml(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId, isFormReadOnly) { this.IsRequired = obj["isRequired"] != null && (bool)obj["isRequired"]; this.FontIconCssClass = DomainUtility.toString(obj["fontIconCssClass"]); this.IsInline = obj["isInline"] != null && obj["isInline"].ToBoolObj(); this.Options = new List <OptionHtml>(); this.FillValue(obj); }
public ListItemElementBase(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId, isFormReadOnly) { this.Key = DomainUtility.toString(obj["fillKey"]); this.Text = DomainUtility.toString(obj["fillText"]); this.Text = string.IsNullOrWhiteSpace(this.Text) ? nameof(this.Text) : this.Text; this.Key = string.IsNullOrWhiteSpace(this.Key) ? nameof(this.Key) : this.Key; this.FillList = DomainUtility.toString(obj["fillListBinding"]); }
public List <object> FindDependentControls() { return(this.Rows.SelectMany(r => (r is RowHtml ? ((RowHtml)r).Columns : ((AccordionHtml)r).GetListColumn()).SelectMany(c => { return c.children.Where(child => (!string.IsNullOrWhiteSpace(DomainUtility.GetPropValue(child, nameof(BindingElementBase.Parameter)).ToStringObj())) || child is ContentHtml).SelectMany(child => child is ContentHtml ? ((ContentHtml)child).FindDependentControls() : new List <object>() { child }); })).ToList()); }
public TextBoxHtml(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId, isFormReadOnly) { this.IsRequired = obj["isRequired"] != null && ((bool)obj["isRequired"]); this.FontIconCssClass = DomainUtility.toString(obj["fontIconCssClass"]); this.SubType = DomainUtility.toString(obj["subtype"]); this.PlaceHolderText = DomainUtility.toString(obj["placeholderText"]); this.IsMultiline = obj["isMultiline"] != null && ((bool)obj["isMultiline"]); this.Pattern = obj["pattern"].ToStringObj(); this.MaxLength = obj["maxLength"]?.ToIntObj(); this.FillValue(); }
public TableSchemaModel(DataRow row) { this.TABLE_NAME = row["TABLE_NAME"].ToString(); this.ORDINAL_POSITION = DomainUtility.toInt(row["ORDINAL_POSITION"]); this.COLUMN_NAME = row["COLUMN_NAME"].ToString(); this.IS_NULLABLE = row["IS_NULLABLE"].ToString() == "YES"; this.DATA_TYPE = row["DATA_TYPE"].ToString() == "int" ? EntityPropertyModel.e_dbType.Integer : row["DATA_TYPE"].ToString() == "decimal" ? EntityPropertyModel.e_dbType.Decimal : row["DATA_TYPE"].ToString() == "bigint" ? EntityPropertyModel.e_dbType.Long : row["DATA_TYPE"].ToString() == "nvarchar" ? EntityPropertyModel.e_dbType.String : EntityPropertyModel.e_dbType.String; this.CHARACTER_MAXIMUM_LENGTH = row["CHARACTER_MAXIMUM_LENGTH"].ToString(); }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------ public static int ToIntObj(this object obj) { int OutInt = 0; if (!string.IsNullOrEmpty(obj.ToStringObj())) { if (!int.TryParse(DomainUtility.toString(obj), out OutInt)) { OutInt = 0; } } return(OutInt); }
public DownloadLinkHtml(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId, isFormReadOnly) { this.VariableId = DomainUtility.toString(obj["entityVariableId"]); this.DocumentDefId = DomainUtility.toString(obj["documentDefId"]).ToGuidObjNull(); this.DocumentFolderId = obj["documentFolderId"].ToGuidObjNull(); this.ListDocument = new List <Guid>(); if (base.Helper.FormAction == HtmlElementHelperModel.e_FormAction.Onload && (this.DocumentFolderId.HasValue || this.DocumentDefId.HasValue)) { this.ListDocument = base.Helper?.DocumentEngine?.GetList(this.DocumentDefId.ToGuidObjNull(), this.VariableId.ToGuidObjNull(), this.DocumentFolderId).Select(c => new { c.GUID, c.CaptionOf }).ToList(); } }
public FileUploadHtml(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId, isFormReadOnly) { this.VariableId = DomainUtility.toString(obj["entityVariableId"]); this.DocumentdefId = DomainUtility.toString(obj["documentDefId"]); this.DocumentFolderId = obj["documentFolderId"].ToStringObj(); this.Multiple = !string.IsNullOrWhiteSpace(DomainUtility.toString(obj["multiple"])) && Convert.ToBoolean(obj["multiple"]); this.DeleteClass = DomainUtility.toString(obj["deleteClass"]); this.DownloadClass = DomainUtility.toString(obj["downloadClass"]); this.DeleteCaption = DomainUtility.toString(obj["deleteCaption"]); this.DownloadCaption = DomainUtility.toString(obj["downloadCaption"]); this.ListDocument = new List <QueryModel>(); this.FillValue(); }
private static string GetResx() { string strResxControl; if (DomainUtility.GetCulture() != string.Empty) { strResxControl = LangUtility.root + Localization.LocalResourceDirectory + "/Shared" + "." + DomainUtility.GetCulture() + ".resx"; } else { strResxControl = LangUtility.root + Localization.LocalResourceDirectory + "/Shared" + ".resx"; } return(strResxControl); }
private static string GetResx(string modelName) { string strResxControl = string.Empty; if (DomainUtility.GetCulture() != string.Empty && System.IO.File.Exists(LangUtility.root + Localization.LocalResourceDirectory + "/" + modelName + "." + DomainUtility.GetCulture() + ".resx")) { strResxControl = LangUtility.root + Localization.LocalResourceDirectory + "/" + modelName + "." + DomainUtility.GetCulture() + ".resx"; } else { strResxControl = LangUtility.root + Localization.LocalResourceDirectory + "/" + modelName + ".resx"; } return(strResxControl); }
public static Guid?ToGuidObjNull(this object obj) { Guid OutInt = Guid.Empty; if (!string.IsNullOrEmpty(obj.ToStringObj())) { if (!Guid.TryParse(DomainUtility.toString(obj), out OutInt)) { return(null); } } else { return(null); } return(OutInt); }
public ChartHtml(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId, isFormReadOnly) { this.ChartDataSet = DomainUtility.toString(obj["chartDataSet"]); this.ChartLabelDataField = DomainUtility.toString(obj["chartLabelDataField"]); this.ChartFillListLabel = DomainUtility.toString(obj["chartFillListLabel"]); this.DisplayLegend = obj["displayLegend"].ToBoolObj(); this.IsSmooth = obj["isSmooth"].ToBoolObj(); if (!string.IsNullOrWhiteSpace(obj["chartType"].ToStringObj())) { this.ChartType = (e_ChartType)Enum.Parse(typeof(e_ChartType), obj["chartType"].ToStringObj(), true); } if (!string.IsNullOrWhiteSpace(obj["colorType"].ToStringObj())) { this.ColorType = (e_ColorType)Enum.Parse(typeof(e_ColorType), obj["colorType"].ToStringObj(), true); } this.PieColorName = obj["pieColorName"].ToStringObj(); this.FillValue(); }
public ColumnItemModel(JObject obj) { this.ID = obj["id"].ToStringObj(); this.Type = obj["type"].ToStringObj(); this.Name = obj["name"].ToStringObj(); this.ClassName = obj["className"].ToStringObj(); this.FormID = obj["formId"].ToStringObj(); this.Params = obj["params"].ToStringObj(); this.HasConfirm = DomainUtility.toString(obj["hasConfirm"]).ToLower() == "true"; this.ConfirmText = DomainUtility.toString(obj["confirmText"]); this.HasExpressionConfirm = DomainUtility.toString(obj["hasExpressionConfirm"]).ToLower() == "true"; this.ExpressionConfirmText = DomainUtility.toString(obj["expressionConfirmText"]); this.ExpressionConfirmCode = DomainUtility.toString(obj["expressionConfirmCode"]); this.ExpressionConfirmHasFalseAction = DomainUtility.toString(obj["expressionConfirmHasFalseAction"]).ToLower() == "true"; this.RunCodeData = DomainUtility.toString(obj["runCodeData"]); this.FormWidth = obj["formWidth"].ToIntObj(); this.FormHeight = obj["formHeight"].ToIntObj(); }
public ButtonHtml(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId) { this.IsReadonly = isFormReadOnly; this.subtype = (e_subtype)Enum.Parse(typeof(e_subtype), DomainUtility.toString(obj["subtype"]), true); this.BackendCoding = DomainUtility.toString(obj["backendCoding"]).FromBase64(); this.OpenFormId = obj["openFormId"].ToStringObj(); this.OpenFormParameter = obj["openFormParameter"].ToStringObj(); this.OpenFormCallBackScript = obj["openFormCallBackScript"].ToStringObj().FromBase64(); //confirm setting this.ConfirmText = obj["confirmText"].ToStringObj(); this.HasConfirm = obj["hasConfirm"].ToStringObj().ToLower() == "true"; this.HasExpressionConfirm = obj["hasExpressionConfirm"].ToStringObj().ToLower() == "true"; this.ExpressionConfirmText = obj["expressionConfirmText"].ToStringObj(); this.ExpressionConfirmCode = obj["expressionConfirmCode"].ToStringObj().FromBase64(); if (!string.IsNullOrWhiteSpace(this.ExpressionConfirmCode)) { this.ConfirmDesignCodeModel = DesignCodeUtility.GetDesignCodeFromXml(this.ExpressionConfirmCode); } this.ExpressionConfirmHasFalseAction = obj["expressionConfirmHasFalseAction"].ToStringObj().ToLower() == "true"; this.FormWidth = obj["formWidth"].ToStringObj(); this.FormHeight = obj["formHeight"].ToStringObj(); if (!string.IsNullOrWhiteSpace(this.OpenFormId)) { if (this.Helper?.FormAction != HtmlElementHelperModel.e_FormAction.FillMode && this.Helper?.FormAction != HtmlElementHelperModel.e_FormAction.Preview) { base.AddElementEventModel(new ElementEventScriptModel() { EventName = ElementBase.e_EventName.click.ToString(), FunctionName = "openForm" + this.Id, ScriptBody = $@"function openForm{this.Id}(target){{ FormControl.openFormPopUp(target.element,'{this.OpenFormId}','{this.GetParameter}',function(){{ {this.OpenFormCallBackScript} }},{(string.IsNullOrWhiteSpace(this.FormWidth) ? "null" : this.FormWidth)},{(string.IsNullOrWhiteSpace(this.FormHeight) ? "null" : this.FormHeight)});}}", }, true); } } this.ValidationGroup = string.IsNullOrWhiteSpace(obj["validationGroup"].ToStringObj()) ? "nextAction" : obj["validationGroup"].ToStringObj().Trim(); this.HasPostBack = this.subtype == ButtonHtml.e_subtype.submit || (DesignCodeUtility.GetDesignCodeFromXml(this.BackendCoding).CodeObjects?.Any() ?? false); }
public DataGridHtml(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId, isFormReadOnly) { this.ColumnSetting = DomainUtility.toString(obj["columnSetting"]); if (string.IsNullOrWhiteSpace(this.ColumnSetting)) { this.DataGridColumns = new List <DataGridColumsSetting>(); } else { this.DataGridColumns = DataGridColumsSetting.ConvertTo(JArray.Parse(this.ColumnSetting)); } //paging this.HasPaging = DomainUtility.toString(obj["hasPaging"]).ToLower() == "true"; this.PageSize = obj["pageSize"].ToIntObj() > 0 ? obj["pageSize"].ToIntObj() : 10; this.ShowExcel = DomainUtility.toString(obj["showExcel"]).ToLower() == "true"; this.ShowPdf = obj["showPdf"].ToStringObj().ToLower() == "true"; //report this.ReportHeader = obj["reportHeader"].ToStringObj(); this.ReportFooter = obj["reportFooter"].ToStringObj(); this.ReportGridHeaderColor = obj["reportGridHeaderColor"].ToStringObj(); this.ReportGridFooterColor = obj["reportGridFooterColor"].ToStringObj(); this.ReportGridEvenColor = obj["reportGridEvenColor"].ToStringObj(); this.ReportGridOddColor = obj["reportGridOddColor"].ToStringObj(); this.ReportPaperSize = obj["reportPaperSize"].ToStringObj(); this.ReportShowDate = obj["reportShowDate"].ToStringObj().ToLower() == "true"; //default sorting if (obj["sortColumn"] != null) { this.SortColumn = obj["sortColumn"].ToStringObj(); this.SortType = !string.IsNullOrWhiteSpace(DomainUtility.toString(obj["sortType"])) ? (PagingProperties.e_OrderByType)Enum.Parse(typeof(PagingProperties.e_OrderByType), DomainUtility.toString(obj["sortType"]), true) : (PagingProperties.e_OrderByType.Asc); } //if this.Parameter is null ,it means that it is not dependent to other controls. if (string.IsNullOrWhiteSpace(this.Parameter)) { this.FillData(); } }
public static decimal toDecimal(object obj) { decimal OutDecimal = 0; if (!string.IsNullOrEmpty(DomainUtility.toString(obj))) { obj = obj.ToString().Replace(",", "").Replace("،", "").Replace("/", "."); System.Globalization.CultureInfo culInfo = new System.Globalization.CultureInfo("en-GB", true); if (!decimal.TryParse(DomainUtility.toString(obj), NumberStyles.AllowDecimalPoint, culInfo, out OutDecimal)) { return(0); } } else { return(0); } return(OutDecimal); }
public void FillElementEventModel(JObject obj) { if (obj["events"] != null) { this.EventDataAttributes = new List <EventDataAttributesModel>(); obj["events"].Select(c => (JObject)c).ToList().ForEach(c => { this.EventDataAttributes.Add(new EventDataAttributesModel() { AttrName = ("data-eventfunction-" + DomainUtility.toString(c["eventName"])), FunctionName = DomainUtility.toString(c["eventFunction"]), }); this.Helper.AddScript(DomainUtility.toString(c["eventCode"])); }); } else { this.EventDataAttributes = new List <EventDataAttributesModel>(); } }
public ElementBase(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId) { this.DynamicFormID = dynamicFormId; this.Id = DomainUtility.toString(obj["id"]); this.Type = DomainUtility.toString(obj["type"]); this.CssClass = DomainUtility.toString(obj["cssClass"]); this.HtmlType = DomainUtility.toString(obj["htmlType"]); this.ExpressionVisibilityCode = obj["expressionVisibilityCode"].ToStringObj().FromBase64(); if (!string.IsNullOrWhiteSpace(this.ExpressionVisibilityCode)) { this.VisibilityDesignCodeModel = DesignCodeUtility.GetDesignCodeFromXml(this.ExpressionVisibilityCode); } this.Label = DomainUtility.toString(obj["label"]); this.HelpMessageText = DomainUtility.toString(obj["helpMessageText"]); this.AccessType = !string.IsNullOrWhiteSpace(DomainUtility.toString(obj["accessType"])) ? (e_AccessType)Enum.Parse(typeof(e_AccessType), DomainUtility.toString(obj["accessType"]), true) : (e_AccessType?)null; this.Helper = _helper; this.FillElementEventModel(obj); }
public TitleHtml(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId, isFormReadOnly) { this.TitleType = DomainUtility.toString(obj["titleType"]); this.FillValue(); }
public ComboSearchHtml(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly) : base(obj, _helper, dynamicFormId, isFormReadOnly) { this.IsRequired = obj["isRequired"] != null && (bool)obj["isRequired"]; this.FontIconCssClass = DomainUtility.toString(obj["fontIconCssClass"]); this.FillValue(); }