示例#1
0
        private bool DoAdd()
        {
            bool result = false;

            Model.wx_userweixin    weixin = GetWeiXinCode();
            Model.wx_travel_scenic model  = new Model.wx_travel_scenic
            {
                wid                 = weixin.id,
                Name                = txtName.Text.Trim(),
                Description         = txtDescription.InnerText.Trim(),
                TemplateId          = 1,
                FirstBgImg          = txtFirstBgImg.Text,
                IdentifyImg         = txtIdentifyImg.Text,
                DisplayAction       = rblDiaplayAction.SelectedItem.Value,
                SecondBgImg         = txtSecondBgImg.Text.Trim(),
                AutoDisplayNextPage = rblAutoDisplayNextPage.SelectedItem.Value == "1",
                Delay               = Convert.ToInt32(txtDelay.Text)
            };


            if (_bll.Add(model) > 0)
            {
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "微旅游添加景区导览:" + model.Name); //记录日志
                result = true;
            }
            return(result);
        }
示例#2
0
        public void Add()
        {
            BLL.wx_travel_scenic   bll   = new BLL.wx_travel_scenic();
            Model.wx_travel_scenic model = new Model.wx_travel_scenic();
            model.Name                = "qweqwe";
            model.Description         = "qweqwe";
            model.TemplateId          = 1;
            model.FirstBgImg          = "qweqwe";
            model.IdentifyImg         = "qweqwe";
            model.DisplayAction       = "qweqwe";
            model.SecondBgImg         = "qweqwe";
            model.AutoDisplayNextPage = true;
            model.Delay               = 1000;
            model.AudioPath           = "qweqwe";
            model.AutoPlayAudio       = true;
            model.AudioLoop           = true;
            model.VideoPath           = "123123123123";
            model.AutoPlayVideo       = true;
            model.extInt1             = 1;
            model.extInt2             = 1;
            model.extStr1             = "qweqwe";
            model.extStr2             = "qweqwe";
            int result = bll.Add(model);

            Assert.AreNotEqual(result, 0);
        }