private void BindData()
    {
        int dataId = WebParmKit.GetRequestString("key", 0);

        if (dataId > 0)
        {
            string whereString = "GroupCode='" + this.GroupCode + "' and Id=" + dataId;

            var model = _infoBus.QueryModel(whereString);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);
                this.InfoTitle.Text = model.Title;

                ShowThumb(model.Thumb);
            }
        }
        if (Request.QueryString["m"] == "content")
        {
            string whereString = "GroupCode='" + this.GroupCode + "'";

            var model = _infoBus.QueryModel(whereString);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);
                this.InfoTitle.Text = model.Title;
            }
        }
    }
Exemplo n.º 2
0
    private void BindData()
    {
        var userId = WebParmKit.GetRequestString("key", 0);

        if (userId > 0)
        {
            var model = _userBus.QueryModel("Id=" + userId);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);

                var data = _dataBus.QueryModel("UserAccount='" + model.Account + "'");
                if (data != null)
                {
                    BindKit.BindModelToContainer(this.editor, data);

                    this.Id.Value = model.Id.ToString();
                }

                this._userOrg.Visible  = true;
                this._userRole.Visible = true;
            }
        }
        else
        {
            this._userOrg.Visible  = false;
            this._userRole.Visible = false;
        }
    }
Exemplo n.º 3
0
    private void BindData()
    {
        var userId = WebParmKit.GetRequestString("key", 0);

        if (userId > 0)
        {
            var model = _userBus.QueryModel("Id=" + userId);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);

                //this.Account.ReadOnly = true;

                var data = _dataBus.QueryModel("UserAccount='" + model.Account + "'");
                if (data != null)
                {
                    BindKit.BindModelToContainer(this.editor, data);

                    this.Id.Value = model.Id.ToString();
                }
            }
        }

        BindKit.BindToListControl(this.Partner, _dibbus.Query(" GroupCode ='partner' and IsEnabled =1"), "Name", "Name");
    }
Exemplo n.º 4
0
    protected void tree_SelectedNodeChanged(object sender, EventArgs e)
    {
        var val  = this.tree.SelectedValue;
        var data = _bus.GetGroup(Convert.ToInt32(val));

        if (data != null)
        {
            BindKit.BindModelToContainer(this.editor, data);
            SetControlStatus();
        }
    }
Exemplo n.º 5
0
    private void BindData()
    {
        var dataId = WebParmKit.GetRequestString("key", 0);

        if (dataId > 0)
        {
            var model = _bus.QueryModel("Id=" + dataId);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);
            }
        }
    }
Exemplo n.º 6
0
    protected void tree_SelectedNodeChanged(object sender, EventArgs e)
    {
        ClearControls();
        var val  = this.tree.SelectedValue;
        var data = _bus.GetMenuItem(Convert.ToInt32(val));

        if (data != null)
        {
            BindKit.BindModelToContainer(this.editor, data);
            this.CurName.Text = data.Name;
            SetControlStatus();
        }
    }
Exemplo n.º 7
0
    private void BindData()
    {
        int Id = WebParmKit.GetRequestString("key", 0);

        if (Id > 0)
        {
            var model = _bus.QueryModel("Id=" + Id);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.container, model);
                //this.Value.Color = model.Value;
            }
        }
    }
Exemplo n.º 8
0
    private void DataBind()
    {
        int Id = WebParmKit.GetRequestString("key", 0);

        if (Id > 0)
        {
            var model = _bus.QueryModel("Id=" + Id);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.container, model);
                this.OldCode.Value = model.Code;
            }
        }
    }
Exemplo n.º 9
0
    private void BindData()
    {
        var advId = Convert.ToInt32(this.Id.Value);

        if (advId > 0)
        {
            var model = _bus.QueryModel("Id=" + advId);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);

                ShowThumb(model.Image);
            }
        }
    }
Exemplo n.º 10
0
    private void BindData()
    {
        var contentId = WebParmKit.GetRequestString("id", 0);

        if (contentId > 0)
        {
            var model = _bus.QueryModel("Id=" + contentId);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);
                this.ContentTitle.Text = model.Title;

                ShowThumb(model.Thumb);
            }
        }
    }
Exemplo n.º 11
0
    private void BindData()
    {
        var user = LoginKit.GetCurrentMember();

        if (user == null)
        {
            this.Alert("无法获取用户信息!");
            return;
        }

        SysMemberDataBus bus = new SysMemberDataBus();

        var model = bus.QueryModel(" IsDel = 0 and UserId=" + user.Id);

        if (model != null)
        {
            BindKit.BindModelToContainer(this.frm, model);
        }
    }
Exemplo n.º 12
0
    private void BindData()
    {
        var userId = ConvertKit.ConvertValue(this.Id.Value, 0);

        if (userId > 0)
        {
            var model = _userBus.QueryModel("Id=" + userId);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);

                var data = _dataBus.QueryModel("UserAccount='" + model.Account + "'");
                if (data != null)
                {
                    BindKit.BindModelToContainer(this.editor, data);

                    this.Id.Value = model.Id.ToString();
                }
            }
        }
    }
Exemplo n.º 13
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            var model = new InfoContentPage();
            BindKit.FillModelFromContainer(this.editor, model);

            if (!string.IsNullOrEmpty(this.Thumb.FileName))
            {
                //清理老图像
                if (!string.IsNullOrEmpty(this.PreviewThumb.ImageUrl))
                {
                    var f = new FileInfo(Server.MapPath(this.PreviewThumb.ImageUrl));
                    if (f.Exists)
                    {
                        f.Delete();
                    }
                }
                //更新新图
                if (this.Thumb.PostedFile.ContentLength > 0)
                {
                    if (FileKit.IsImage(this.Thumb.PostedFile.FileName))
                    {
                        model.Thumb = FileKit.SaveZoomImage(this.Thumb.PostedFile, 1024, 1024);
                    }
                    else
                    {
                        this.Alert("您上传的不是图片!");
                    }
                }
                ShowThumb(model.Thumb);
            }

            if (Request.QueryString["m"] == "content")
            {
                model.Title = this.InfoTitle.Text;
                if (!_infoBus.Update(model, "GroupCode='" + this.GroupCode + "'"))
                {
                    model.GroupCode  = this.GroupCode;
                    model.CategoryId = 0;
                    model.Click      = 0;
                    model.CreateDate = DateTime.Now;
                    model.IsEnabled  = 1;
                    model.Author     = this.CurrentUserName;
                    model.Id         = _infoBus.InsertIdentity(model);
                    BindKit.BindModelToContainer(this.editor, model);
                }
            }
            else
            {
                if (string.IsNullOrEmpty(this.Id.Value) || this.Id.Value == "0")
                {
                    model.Title      = this.InfoTitle.Text;
                    model.GroupCode  = this.GroupCode;
                    model.CategoryId = 0;
                    model.Click      = 0;
                    model.CreateDate = DateTime.Now;
                    model.IsEnabled  = 1;
                    model.Author     = this.CurrentUserName;

                    //_infoBus.Insert(model);
                    model.Id      = _infoBus.InsertIdentity(model);
                    this.Id.Value = model.Id.ToString();
                }
                else
                {
                    model.Title = this.InfoTitle.Text;
                    _infoBus.Update(model, null);
                }
            }
            this.promptControl.ShowSuccess("保存成功!");
        }
    }