Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     var clickQuery = DB.Select( ).From<SysAdsClickSetting>( );
     clickGrid = new EditableGrid<SysAdsClickSetting>(SysAdsClickSetting.table.Name, clickQuery);
     clickGrid.AddShowColumn(SysAdsClickSetting.OrderSumLimitColumn)
              .AddShowColumn(SysAdsClickSetting.ClickCountLimitColumn);
     clickGrid.MaxAllowRow = 5;
     clickGrid.OnBeforSave += new EditableGrid<SysAdsClickSetting>.OnEditableGridSaveHandler(clickGrid_OnBeforSave);
     sb = new StringBuilder( );
     gridContainer.SetRenderMethodDelegate((w, c) =>
         {
             w.Write(sb);
         });
     txtMessage.InnerHtml = string.Empty;
 }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CompanyBLL.GetCompanyType(AppContext.Context.Company.CompanyType) == CompanyType.MealCompany)
            {
                txtMessage.InnerHtml = "你暂不允许使用此功能";
                return;
            }
            var pointQuery = DB.Select( ).From<SysCompanyAdsPointSetting>( )
                                 .Where(SysCompanyAdsPointSetting.AdsIDColumn).IsEqualTo(AdsID);
            EditableGrid<SysCompanyAdsPointSetting> pointGrid = new EditableGrid<SysCompanyAdsPointSetting>(SysCompanyAdsPointSetting.table.Name, pointQuery);
            pointGrid.IsNeedLoadScript = false;
            pointGrid.AddShowColumn(SysCompanyAdsPointSetting.OrderSumLimitColumn);
            pointGrid.AddShowColumn(SysCompanyAdsPointSetting.AdsPointColumn);
            pointGrid.MaxAllowRow = 5;
            pointGrid.OnBeforSave += new EditableGrid<SysCompanyAdsPointSetting>.OnEditableGridSaveHandler(pointGrid_OnBeforSave);

            formView.DataSource = DB.Select( ).From<SysCompanyAd>( )
                                    .Where(SysCompanyAd.AdsIDColumn).IsEqualTo(AdsID)
                                    .And(SysCompanyAd.AdsCompanyIDColumn).IsEqualTo(AppContext.Context.Company.Id)
                                    .And(SysCompanyAd.IsDeletedColumn).IsEqualTo(false);
            formView.AddShowColumn(SysCompanyAd.AdsTitleColumn)
                                .AddGridColumn(pointGrid, "奖励设置")
                                .AddCustomColumn("AdsImages", "广告图片", AdsID == 0 ? Guid.NewGuid( ).ToString("D") : Request.Params["id"])
                                .AddShowColumn(SysCompanyAd.AreaDepthColumn)
                                .AddShowColumn(SysCompanyAd.SexLimitColumn, "0")
                                .AddShowColumn(SysCompanyAd.AdsMemberLimitColumn, "0", false, "浏览对象")
                                .AddShowColumn(SysCompanyAd.AdsClickLimitColumn, "1", false, "浏览频率")
                                .AddShowColumn(SysCompanyAd.AdsQuestionColumn, "", false, "互动问答", "", 400)
                                .AddShowColumn(SysCompanyAd.AdsAnswer1Column, "", false, "答案A", "", 400)
                                .AddShowColumn(SysCompanyAd.AdsAnswer2Column, "", false, "答案B", "", 400)
                                .AddShowColumn(SysCompanyAd.AdsAnswer3Column, "", false, "答案C", "", 400)
                                .AddShowColumn(SysCompanyAd.AdsAnswer4Column, "", false, "答案D", "", 400)
                                .AddShowColumn(SysCompanyAd.AdsRightAnswerColumn, "", false, "正确答案")
                                .AddShowColumn(SysCompanyAd.AdsDayLimitAmountColumn, "", false, "日最高浏览量")
                                .AddShowColumn(SysCompanyAd.AdsDayLimitSumColumn, "", false, "日最高投放额")
                                .AddShowColumn(SysCompanyAd.AdsDateColumn, DateTime.Today.ToString("yyyy-MM-dd"), false, "开始日期")
                                .AddShowColumn(SysCompanyAd.AdsEndDateColumn, DateTime.Today.AddDays(7).ToString("yyyy-MM-dd"), false, "截止日期"); //有效期限
            formView.OnBeforeSaved += new Web.Controls.OnFormViewSaveHandle(formView_OnBeforeSaved);
            formView.OnAfterSaved += new OnFormViewSaveHandle(formView_OnAfterSaved);
            formView.OnValidate += new Web.Controls.OnFormViewValidate(formView_OnValidate);
            formView.OnDataBindRow += new Web.Controls.OnFormViewDataBindRow(formView_OnDataBindRow);
            txtMessage.InnerHtml = string.Empty;
        }