Пример #1
0
        internal static string GetLayer(ListDataRightEventArgs e)
        {
            IParamBuilder builder = SqlParamBuilder.CreateEqualSql(e.Context, "ORG_ID", TkDataType.Int, e.User.MainOrgId);
            string        layer   = DbUtil.ExecuteScalar(SQL, e.Context, builder).ToString();

            return(layer);
        }
Пример #2
0
 protected virtual IParamBuilder GetDataRight(IInputData input)
 {
     if (SupportData && DataRight != null)
     {
         ListDataRightEventArgs e = new ListDataRightEventArgs(Context,
                                                               BaseGlobalVariable.Current.UserInfo, MainResolver);
         return(DataRight.GetListSql(e));
     }
     return(null);
 }
Пример #3
0
        public IParamBuilder GetListSql(ListDataRightEventArgs e)
        {
            if (e.User.UserId == null || e.User.MainOrgId == null)
            {
                return(SqlParamBuilder.NoResult);
            }

            string layer = GetLayer(e);
            string sql   = string.Format(ObjectUtil.SysCulture, RETURN_SQL, fField.FieldName, layer, e.User.UserId);

            return(ParamBuilder.CreateSql(sql));
        }
 protected override void FillUpdateTables(TableResolver resolver, IInputData input)
 {
     if (SupportData)
     {
         var fieldInfo            = resolver.GetFieldInfo(ParentKey);
         ListDataRightEventArgs e = new ListDataRightEventArgs(Context,
                                                               BaseGlobalVariable.Current.UserInfo, resolver);
         var builder = DataRight.GetListSql(e);
         builder = ParamBuilder.CreateParamBuilder(
             SqlParamBuilder.CreateEqualSql(Context, fieldInfo, fParentKey), builder);
         resolver.Select(builder);
     }
     else
     {
         resolver.SelectWithParam(ParentKey, fParentKey);
     }
 }