private void BindOpenGrid()
    {
        sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString();
        DataSet ds = new DataSet();

        BusinessLogic bl    = new BusinessLogic(sDataSource);
        string        sDate = string.Empty;

        sDate = txtDate.Text.Trim();
        ds    = bl.GetStockOpeningItems(sDate);
        EditableGrid.DataSource = ds;
        EditableGrid.DataBind();
    }
Esempio n. 2
0
        // The first time we create a node
        private void SetInitialNodeValue(int rowNumber, int colNumber, int value)
        {
            Node node = Node.Create(rowNumber, colNumber, value);

            node.Domain    = DefaultDomain.ToList();
            node.Neighbors = new List <Node>();
            Grid.Add(node);

            if (value == 0)
            {
                node.Editable = true;
                EditableGrid.Add(node);
            }
        }
Esempio n. 3
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;
 }
    private void BindGrid()
    {
        sDataSource = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString();
        DataSet ds = new DataSet();

        BusinessLogic bl    = new BusinessLogic(sDataSource);
        string        sDate = string.Empty;

        sDate = txtDate.Text.Trim();
        string Branch = drpBranchAdd.SelectedValue;

        ds = bl.GetStockItem(sDate, Branch);

        if (ds == null || ds.Tables[0].Rows.Count == 0)
        {
            err.Visible = true;
            err.Text    = "No Physical Stock stored for the Date";
        }
        else
        {
            err.Visible = false;

            var checkIfExists = bl.GetClosingStock(txtDate.Text, Branch);

            if (checkIfExists == null || (checkIfExists != null && checkIfExists.Tables[0].Rows.Count == 0))
            {
                err.Visible = true;
                err.Text    = "No Physical Stock stored for the Date";
            }
            else
            {
                err.Visible = true;
                err.Text    = "Physical stock values are stored for the Date";
            }
        }

        EditableGrid.DataSource = ds;
        EditableGrid.DataBind();
    }
Esempio n. 5
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;
        }