zoukankan      html  css  js  c++  java
  • 使用按钮绑定数据

    public partial class Form_Jurisdiction : XtraForm
        {
            Command.BusinessCommand.ProjectExplorer.com_Project com = new Command.BusinessCommand.ProjectExplorer.com_Project();
            string p_id;
            public Form_Jurisdiction(string _p_id)
            {
                p_id = _p_id;
                InitializeComponent();
                this.Load += (s, e) =>
                {
                    Task.Factory.StartNew(() =>
                    {
                        this.BeginInvoke(new Action(() =>
                        {
                            SetTextAndClick();
                            BandData();
                        }));
                    });
                };
            }
            private void BandData() //无论是否有值,都绑定之前的窗口
            {
                List<Model.BusinessSelectModel.ProjectExplorer.Project_Jurisdiction> list = com.selectJuridictionById(p_id);
                this.ckb_staff.EditValue = string.Join(",", list.Where(w => w.j_type.Equals(false)).Select(w => w.j_id));
                this.ckb_group.EditValue = string.Join(",", list.Where(w => w.j_type.Equals(true)).Select(w => w.j_id));
                this.ckb_staff.RefreshEditValue();
                this.ckb_group.RefreshEditValue();
            }
            public void SetTextAndClick()//保存按钮绑定的信息
            {
                this.ckb_staff.Properties.DataSource = com.ReturnStaffList();
                this.ckb_staff.Properties.DisplayMember = "lookname";
                this.ckb_staff.Properties.ValueMember = "lookvalue";
                this.ckb_staff.Properties.NullText = "";
                this.ckb_group.Properties.DataSource = com.ReturnGroupList();
                this.ckb_group.Properties.DisplayMember = "lookname";
                this.ckb_group.Properties.ValueMember = "lookvalue";
                this.ckb_group.Properties.NullText = "";
                this.btn_save.Click += (s, e) =>
                {
                    string staffs = this.ckb_staff.EditValue.ToSaleString();
                    string groups = this.ckb_group.EditValue.ToSaleString();
                    if (com.SetAndAddJurisdiction(p_id, staffs, groups))
                    {
                        XtraMessageBox.Show("设置成功", "提示消息");
                        this.Close();
                    }
                    else
                    {
                        XtraMessageBox.Show("设置失败", "提示消息");
                    }
                };
            }
    
        }
  • 相关阅读:
    微信JS SDK Demo
    微信JS SDK使用权限签名算法
    微信JS接口
    微信分享JS接口失效说明及解决方案
    微信支付开发(2) 扫码支付模式一
    不懂技术的人不要对懂技术的人说这很容易实现
    独立开发者经验分享
    微信公开课PRO版张小龙演讲全文
    RC4加密算法的原理及实现
    上传APP加入视频预览--精简点名
  • 原文地址:https://www.cnblogs.com/Tianxf815/p/8892258.html
Copyright © 2011-2022 走看看