Exemplo n.º 1
0
        /// <summary>
        /// get edit service item string, skip empty item
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        private string GetEServiceItemStr(CrudEitemDto item)
        {
            if (_Str.IsEmpty(item.Fid))
            {
                return("");
            }

            return("new() { " +
                   KeyValue("Fid", item.Fid, true) +
                   ServiceFid("Required", item.Required ? "true" : "") +
                   ServiceFid("Create", !item.HasCreate ? "false" : "") +
                   ServiceFid("Update", !item.HasUpdate ? "false" : "") +
                   ServiceFid("CheckType", GetCheckTypeName(item.CheckType)) +
                   ServiceFid("CheckData", item.CheckData, true) +
                   " },");
        }
Exemplo n.º 2
0
        /// <summary>
        /// get edit view header(th) string
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        private string GetEViewHeadStr(CrudEitemDto item)
        {
            //skip some types
            if (item.ItemType == QEitemTypeEstr.Hide || item.ItemType == QEitemTypeEstr.Sort)
            {
                return("");
            }

            //@await Component.InvokeAsync("XgTh", new { title = "XXX", required = true })
            return((item.Required || !_Str.IsEmpty(item.PlaceHolder))
                ? GetCompStart("XgTh") +
                   GetCols(
                       ViewTitle(item.Name),
                       ViewPlaceHolder(item.PlaceHolder),
                       ViewRequired(item.Required)) +
                   GetCompEnd()
                : string.Format("<th{0}>{1}</th>",
                                (_Str.IsEmpty(item.LayoutCols) || item.LayoutCols == "0" ? "" : " width='" + item.LayoutCols + "'"),
                                item.Name));
        }