Ejemplo n.º 1
0
        public DataTable GetCalendarsByNetwork(int MemberId, DateTime?Date, string condition)
        {
            if (String.Compare(WebContext.Profile.dbUserName, Config.GetFromWebConfig("Admin"), true) == 0)
            {
                CalendarManager paMgr = new CalendarManager();
                return(paMgr.GetDataEvents(condition).Table);
            }
            else
            {
                StringBuilder cond = new StringBuilder();

                cond.Append(" and " + GetRelationQueryByMember(MemberId));
                if (Date != null)
                {
                    cond.Append(string.Format(" and DateAdded>='{0}'", Date));
                }


                string sql = string.Format("select * from CalendarsFullView where 1=1" + (condition != null ? condition : "") + " {0}",
                                           cond.ToString());

                return(DBUtils.GetDataSet(sql, _lib).Tables[0]);
            }
        }