Esempio n. 1
0
        public override Advert SaveAdvert(
              int id, int index, int categoryID, ADPosition position, ADType adType, bool available, string title
            , string href, string text, int fontsize, string color, string src
            , int width, int height, DateTime beginDate, DateTime endDate, string code, string targets, string floor)
        {
            using (SqlQuery query = new SqlQuery())
            {
                query.CommandText = "bx_SaveAdvert";
                query.CommandType = CommandType.StoredProcedure;

                query.CreateParameter<int>("@ADID", id, SqlDbType.Int);
                query.CreateParameter<int>("@CategoryID", categoryID, SqlDbType.Int);
                query.CreateParameter<byte>("@Position", (byte)position, SqlDbType.TinyInt);
                query.CreateParameter<byte>("@AdType", (byte)adType, SqlDbType.TinyInt);
                query.CreateParameter<bool>("@Available", available, SqlDbType.Bit);
                query.CreateParameter<string>("@Title", title, SqlDbType.NVarChar, 50);
                query.CreateParameter<string>("@Href", href, SqlDbType.NVarChar, 500);
                query.CreateParameter<string>("@Text", text, SqlDbType.NVarChar, 200);
                query.CreateParameter<int>("@FontSize", fontsize, SqlDbType.Int);
                query.CreateParameter<string>("@Color", color, SqlDbType.VarChar, 50);
                query.CreateParameter<string>("@Src", src, SqlDbType.NVarChar, 500);
                query.CreateParameter<int>("@Height", height, SqlDbType.Int);
                query.CreateParameter<int>("@Width", width, SqlDbType.Int);
                query.CreateParameter<DateTime>("@BeginDate", beginDate, SqlDbType.DateTime);
                query.CreateParameter<DateTime>("@EndDate", endDate, SqlDbType.DateTime);
                query.CreateParameter<string>("@Code", code, SqlDbType.NText);
                query.CreateParameter<string>("@Targets", targets, SqlDbType.NText);
                query.CreateParameter<int>("@Index", index, SqlDbType.Int);
                query.CreateParameter<string>("@Floor", floor, SqlDbType.VarChar, 1000);

                using (XSqlDataReader reader = query.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        return new Advert(reader);
                    }
                }
            }
            return null;
        }
Esempio n. 2
0
 public static string itemString(ADType t)
 {
     if (t == ADType.OU)
         return ADOU;
     else
     {
         if (t == ADType.User)
             return ADUser;
         return "";
     }
 }
Esempio n. 3
0
 public ADItem createChild(string name, ADType t)
 {
     name = name.Trim();
     ADItem item = this.getChild(name);
     if (item != null)
         return null;
     DirectoryEntry de = de_.Children.Add(itemPrefix(t) + "=" + name, itemString(t));
     if (de == null)
         return null;
     try
     {
         de.CommitChanges();
     }
     catch (Exception)
     {
         return null;
     }
     return new ADItem(de);
 }
Esempio n. 4
0
 /// <summary>
 /// 隐藏广告
 /// </summary>
 /// <param name="adType"></param>
 public static void CloseAD(string SDKName, ADType adType, string tag = "")
 {
 }
Esempio n. 5
0
 public static string itemPrefix(ADType t)
 {
     if (t == ADType.OU)
         return "OU";
     else
     {
         if (t == ADType.User)
             return "CN";
         return "";
     }
 }
Esempio n. 6
0
 /// <summary>
 /// 显示广告
 /// </summary>
 public static void PlayAD(ADType adType, string tag = "")
 {
 }
Esempio n. 7
0
 /// <summary>
 /// 隐藏广告
 /// </summary>
 /// <param name="adType"></param>
 public static void CloseAD(ADType adType, string tag = "")
 {
 }
Esempio n. 8
0
    public static UIASSETS_ID GetMoreActivityID(ADType type)
    {
        switch (type)
        {
        case ADType.ADT_Cards:
            return(UIASSETS_ID.UIASSETS_MoreActivityCards);

        case ADType.ADT_ChargeTotal:
            return(UIASSETS_ID.UIASSETS_GoodActivityTotalPanel);

        case ADType.ADT_ChargeEvery:
            return(UIASSETS_ID.UIASSETS_GoodaActivityOnePanel);

        case ADType.ADT_DiscountStore:
            return(UIASSETS_ID.UIASSETS_GoodActivityShopPanel);

        case ADType.ADT_LoginTotal:
            return(UIASSETS_ID.UIASSETS_GoodActivitySigninPanel);

        case ADType.ADT_OnlineReward:
            return(UIASSETS_ID.UIASSETS_OnlinePanel);

        case ADType.ADT_HotRole:
            return(UIASSETS_ID.UIASSETS_MoreActivityHotRole);

        case ADType.ADT_Foundation:
            return(UIASSETS_ID.UIASSETS_GrowthfundPanel);

        case ADType.ADT_SelfChargeTotal:
            return(UIASSETS_ID.UIASSETS_GoodActivitySelfTotalPanel);

        case ADType.ADT_SelfChargeEvery:
            return(UIASSETS_ID.UIASSETS_GoodaActivitySelfOnePanel);

        case ADType.ADT_SelfDiscountStore:
            return(UIASSETS_ID.UIASSETS_GoodActivitySelfShopPanel);

        case ADType.ADT_7Days:
            return(UIASSETS_ID.UIASSETS_7DaysPanel);

        case ADType.ADT_BuyEmployee:
            return(UIASSETS_ID.UIASSETS_MoreBuyEmp);

        case ADType.ADT_Level:
            return(UIASSETS_ID.UIASSETS_MoreLevel);

        case ADType.ADT_PhoneNumber:
            return(UIASSETS_ID.UIASSETS_PhoneBinding);

        case ADType.ADT_Sign:
            return(UIASSETS_ID.UIASSETS_SignUpUI);

        case ADType.ADT_Zhuanpan:
            return(UIASSETS_ID.UIASSETS_LotteryPanel);

        case ADType.ADT_IntegralShop:
            return(UIASSETS_ID.UIASSETS_JiFenShop);

        default:
            return((UIASSETS_ID)0);
        }
    }
Esempio n. 9
0
 /// <summary>
 /// 加载广告,默认访问第一个接口
 /// </summary>
 public static void LoadAD(ADType adType, string tag = "")
 {
 }
Esempio n. 10
0
        static void Work()
        {
            var big   = XmlHelper.GetDitrict();
            var codes = big.Select(e => e.Substring(0, 4)).ToList();
            var dict  = ADController.GetGroupDict();

            foreach (var entry in dict)
            {
                var    name = entry.Key;
                ADType type = ADType.Other;
                if (name == "目录权限")//目录权限
                {
                    #region 更新目录权限组
                    type = ADType.Catalog;
                    #endregion
                }
                else
                {
                    if (name.Length >= 4)
                    {
                        var key = name.Substring(0, 4);
                        if (codes.Contains(key))//浙江省行政区权限组
                        {
                            type = ADType.Organication;

                            #region 更新城市权限组
                            //var current = oldgranication.FirstOrDefault(e => e.Name.ToUpper() == name.ToUpper());
                            //if (current == null)
                            //{
                            //    current = manager.Save(new Model.ADGroup { Name = name });
                            //    var insertgroup = entry.Value.Select(e => new ADGroup { Name = e.Name, Type = ADType.Group, OID = current.ID }).ToList();
                            //    manager.Save(insertgroup);
                            //}
                            //else
                            //{
                            //    var oldgroup = manager.GetByOID(current.ID);
                            //    oldgranication.Remove(current);
                            //    foreach (var item in entry.Value)
                            //    {
                            //        var gname = item.Name;
                            //        var gcurrent = oldgroup.FirstOrDefault(e => e.Name.ToUpper() == gname.ToUpper());
                            //        if (gcurrent == null)
                            //        {
                            //            gcurrent = manager.Save(new ADGroup { Name = gname, OID = current.ID });
                            //        }
                            //        else
                            //        {
                            //            oldgroup.Remove(gcurrent);
                            //            if (gcurrent.OID != current.ID)
                            //            {
                            //                gcurrent.OID = current.ID;
                            //                manager.Update(gcurrent);
                            //            }
                            //        }
                            //    }
                            //    if (oldgroup.Count > 0)
                            //    {
                            //        manager.Remove(oldgroup);
                            //    }
                            //}
                            #endregion
                        }
                    }
                }
                CheckRecord(name, type, entry.Value);
            }

            if (_parents.Count > 0)
            {
                _manager.Remove(_parents);
            }
        }
Esempio n. 11
0
 public AdShowController(ADType adType)
 {
     adsAll      = new List <AdBase> ();
     this.adType = adType;
 }
Esempio n. 12
0
 /// <summary>
 /// 隐藏广告
 /// </summary>
 /// <param name="adType"></param>
 public static void CloseAD <T>(string SDKName, ADType adType, string tag = "") where T : ADInterface
 {
 }
Esempio n. 13
0
 /// <summary>
 /// 显示广告
 /// </summary>
 public static void PlayAD(string SDKName, ADType adType, string tag = "")
 {
 }
Esempio n. 14
0
        private void SaveAdvert()
        {
            MessageDisplay msgDisplay = CreateMessageDisplay("src", "code", "width", "height", "href", "text", "floor");

            int        adid = 0, height = 0, width = 0, fontsize = 14, categoryId, index;
            ADType     adtype = ADType.Code;
            string     href = "", resourcehref = "", floor = ",0,", text = "", color = "", code = "", title = "", targets = "", floorLast = "";
            DateTime   begindate, enddate;
            bool       available = true;
            ADPosition position;

            position   = _Request.Get <ADPosition>("position", Method.Post, ADPosition.None);
            begindate  = DateTimeUtil.ParseBeginDateTime(_Request.Get("begindate", Method.Post));
            enddate    = DateTimeUtil.ParseEndDateTime(_Request.Get("enddate", Method.Post));
            adid       = _Request.Get <int>("adid", Method.Get, 0);
            adtype     = _Request.Get <ADType>("adtype", Method.Post, ADType.Code);
            title      = _Request.Get("title", Method.Post);
            available  = _Request.Get <bool>("Available", Method.Post, false);
            categoryId = Category.ID;
            targets    = _Request.Get("targets", Method.Post, "");
            index      = _Request.Get <int>("index", Method.Post, 0);
            floor      = _Request.Get("floor", Method.Post);
            floorLast  = _Request.Get("floorLast", Method.Post, "");

            if (!string.IsNullOrEmpty(floorLast))
            {
                floor += "," + floorLast;//最底楼特殊处理,拼接上去
            }
            switch (adtype)
            {
            case ADType.Code:
                code = _Request.Get("code", Method.Post, "", false);
                break;

            case ADType.Flash:
                resourcehref = _Request.Get("flashsrc", Method.Post);
                height       = _Request.Get <int>("flashheight", Method.Post, 0);
                width        = _Request.Get <int>("flashwidth", Method.Post, 0);
                break;

            case ADType.Image:
                resourcehref = _Request.Get("imagesrc", Method.Post);
                height       = _Request.Get <int>("imageheight", Method.Post, 0);
                width        = _Request.Get <int>("imagewidth", Method.Post, 0);
                text         = _Request.Get("alt", Method.Post);
                href         = _Request.Get("imagehref", Method.Post);
                break;

            case ADType.Text:
                text     = _Request.Get("text", Method.Post);
                href     = _Request.Get("href", Method.Post);
                color    = _Request.Get("color", Method.Post);
                fontsize = _Request.Get <int>("fontsize", Method.Post, 12);
                break;
            }

            Advert CurrentAD = null;

            using (ErrorScope es = new ErrorScope())
            {
                try
                {
                    CurrentAD = AdvertBO.Instance.SaveAdvert(
                        MyUserID, adid, index, categoryId, position
                        , adtype, available, title, href, text
                        , fontsize, color, resourcehref, width, height, begindate
                        , enddate, code, targets, floor);
                }
                catch (Exception ex)
                {
                    msgDisplay.AddException(ex);
                }

                if (CurrentAD != null)
                {
                    Return(CurrentAD, IsEditMode);
                }

                if (es.HasUnCatchedError)
                {
                    es.CatchError <ErrorInfo>(delegate(ErrorInfo error)
                    {
                        msgDisplay.AddError(error);
                    });
                }
            }
        }