Beispiel #1
0
        /// <summary>
        /// 为模型的自定义字段生成Html输入界面代码
        /// </summary>
        /// <param name="ModelID"></param>
        public string GetHtmlOrder(int type)
        {
            StringBuilder builder = new StringBuilder();
            DataTable     olddt   = SelectType(type);

            if (olddt != null)
            {
                if (olddt.Rows.Count > 0)
                {
                    olddt.DefaultView.Sort = "  OrderId asc";
                    DataTable dt    = olddt.Clone();
                    DataRow[] drarr = olddt.Select("1=1", "  OrderId asc");

                    //.Enabled = this.GetEnableValid("FaceHeight");

                    for (int x = 0; x < drarr.Length; x++)
                    {
                        dt.ImportRow((DataRow)drarr[x]);
                    }

                    B_ModelField bmf = new B_ModelField();
                    if (dt != null)
                    {
                        if (dt.Rows.Count > 0)
                        {
                            for (int i = 0; i < dt.Rows.Count; i++)
                            {
                                builder.Append(bmf.GetShowStyleUser(dt.Rows[i]["FieldID"].ToString(), dt.Rows[i]["FieldAlias"].ToString(), dt.Rows[i]["FieldName"].ToString(), DataConverter.CBool(dt.Rows[i]["IsNotNull"].ToString()), dt.Rows[i]["FieldType"].ToString(), dt.Rows[i]["Content"].ToString(), dt.Rows[i]["Description"].ToString(), 0, 0));
                            }
                        }
                    }
                }
            }
            return(builder.ToString());
        }
Beispiel #2
0
        /// <summary>
        /// 获取内容值
        /// </summary>
        /// <param name="GeneralID"></param>
        /// <returns></returns>
        public DataTable GetContent(int GeneralID)
        {
            B_ModelField bmodelfield = new B_ModelField();
            M_CommonData info        = GetCommonData(GeneralID);

            //读取内容信息
            return(dal.GetContent(info));
        }
Beispiel #3
0
        //用dt传输报错,所以统上使用上方方法远程验证
        public string GetUpdateHtml(DataTable dt1)
        {
            DataTable     dt      = Select_All();
            StringBuilder builder = new StringBuilder();
            B_ModelField  bmf     = new B_ModelField();

            if (dt1.Rows.Count > 0)
            {
                DataRow dr = dt1.Rows[0];

                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        builder.Append(bmf.GetUserShowStyle(dt.Rows[i]["FieldAlias"].ToString(), dt.Rows[i]["FieldName"].ToString(), DataConverter.CBool(dt.Rows[i]["IsNotNull"].ToString()), dt.Rows[i]["FieldType"].ToString(), dt.Rows[i]["Content"].ToString(), dt.Rows[i]["Description"].ToString(), 0, 0, dr));
                    }
                }
            }
            return(builder.ToString());
        }
Beispiel #4
0
        /// <summary>
        /// 字段权限
        /// </summary>
        /// <param name="ModelId">模型ID</param>
        /// <param name="fieldsname">字段名称</param>
        /// <param name="Usergroup">用户组</param>
        private string Fieldsinfo(int ModelId, string fieldsname, int Usergroup)
        {
            B_Permission pll     = new B_Permission();
            int          Fieldid = 0;

            #region 从模型表中找到字段的ID
            B_ModelField mfll    = new B_ModelField();
            DataTable    mftable = mfll.SelectTableName("ZL_ModelField", "FieldName = '" + fieldsname + "' and ModelId=" + ModelId + "");

            if (mftable.Rows.Count > 0)
            {
                Fieldid = DataConverter.CLng(mftable.Rows[0]["FieldID"]);
            }
            else
            {
                Fieldid = 0;
            }
            #endregion

            return(Nodeinfo(Usergroup, 3, Fieldid.ToString()));
        }
Beispiel #5
0
        public string GetHtml()
        {
            DataTable     dt      = Select_All();
            StringBuilder builder = new StringBuilder();
            //string row = "";
            B_ModelField bmf = new B_ModelField();

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    //返回tr,需要将两行整为一行
                    string str = bmf.GetShowStyle(dt.Rows[i]["FieldAlias"].ToString(), dt.Rows[i]["FieldName"].ToString(), DataConverter.CBool(dt.Rows[i]["IsNotNull"].ToString()), dt.Rows[i]["FieldType"].ToString(), dt.Rows[i]["Content"].ToString(), dt.Rows[i]["Description"].ToString(), 0, 0);
                    builder.Append(str);
                    //str = str.Replace("<tr>", "").Replace("</tr>", "");
                    //row += str;
                    //if (((i + 1) % 2) == 0) { builder += "<tr>" + row + "</tr>"; row = ""; }
                }
            }
            //if (!string.IsNullOrEmpty(row)) { builder += "<tr>" + row + "</tr>"; row = ""; }
            return(builder.ToString());
        }
Beispiel #6
0
        public string GetHtml()
        {
            DataTable    dt      = Sel();
            string       builder = "";
            B_ModelField bmf     = new B_ModelField();

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string str = bmf.GetShowStyle(dt.Rows[i]["FieldAlias"].ToString(), dt.Rows[i]["FieldName"].ToString(), DataConverter.CBool(dt.Rows[i]["IsNotNull"].ToString()), dt.Rows[i]["FieldType"].ToString(), dt.Rows[i]["Content"].ToString(), dt.Rows[i]["Description"].ToString(), 0, 0);
                    if ((i + 1) % 2 == 0)
                    {
                        str     = str.Replace("<tr class=\"tdbg\">", "").Replace("</tr>", "");
                        builder = builder.Insert(builder.LastIndexOf("</tr>"), str);
                    }
                    else
                    {
                        builder += str;
                    }
                }
            }
            return(builder.ToString());
        }
Beispiel #7
0
 /// <summary>
 /// 获取内容值
 /// </summary>
 /// <param name="GeneralID"></param>
 /// <returns></returns>
 public DataTable GetContent(int GeneralID)
 {
     B_ModelField bmodelfield = new B_ModelField();
     M_CommonData info = GetCommonData(GeneralID);
     //读取内容信息
     return dal.GetContent(info);
 }