Example #1
0
 /// <summary>
 /// 保存过滤IP表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="filterIPEntity">过滤IP实体</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, FilterIPEntity filterIPEntity)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         filterIPEntity.Modify(keyValue);
         Base_FilterIP filterIP = Base_FilterIP.SingleOrDefault("where FilterIPId=@0", keyValue);
         filterIP            = EntityConvertTools.CopyToModel <FilterIPEntity, Base_FilterIP>(filterIPEntity, filterIP);
         filterIP.FilterIPId = keyValue;
         filterIP.Update();
     }
     else
     {
         filterIPEntity.Create();
         Base_FilterIP filterIP = new Base_FilterIP();
         filterIP = EntityConvertTools.CopyToModel <FilterIPEntity, Base_FilterIP>(filterIPEntity, null);
         filterIP.Insert();
     }
 }
Example #2
0
        /// <summary>
        /// 过滤IP实体
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <returns></returns>
        public FilterIPEntity GetEntity(string keyValue)
        {
            var model = Base_FilterIP.SingleOrDefault("where FilterIPId=@0", keyValue);

            return(EntityConvertTools.CopyToModel <Base_FilterIP, FilterIPEntity>(model, null));
        }