示例#1
0
 private void DictEdit_Load(object sender, EventArgs e)
 {
     cmd             = new Xr.Common.Controls.OpaqueCommand(this);
     dcDict.DataType = typeof(DictEntity);
     if (dict != null)
     {
         dcDict.SetValue(dict);
     }
     else
     {
         dict = new DictEntity();
     }
 }
        private void repositoryItemButtonEdit1_Click(object sender, EventArgs e)
        {
            var selectedRow = gridView1.GetFocusedRow() as DictEntity;

            if (selectedRow == null)
            {
                return;
            }
            var        edit = new DictEdit();
            DictEntity dict = new DictEntity();

            dict.type        = selectedRow.type;
            dict.description = selectedRow.description;
            dict.sort        = selectedRow.sort;
            edit.dict        = dict;
            if (edit.ShowDialog() == DialogResult.OK)
            {
                Thread.Sleep(300);
                cmd.ShowOpaqueLayer();
                SearchData(pageControl1.CurrentPage, pageControl1.PageSize);
                MessageBoxUtils.Hint("添加成功!", MainForm);
            }
        }
示例#3
0
        private void ClientVersionQueryForm_Load(object sender, EventArgs e)
        {
            MainForm = (Form)this.Parent;
            pageControl1.MainForm = MainForm;
            cmd = new OpaqueCommand(AppContext.Session.waitControl);
            //cmd.ShowOpaqueLayer(0f);
            pageControl1.PageSize = Convert.ToInt32(AppContext.AppConfig.pagesize);
            String url = AppContext.AppConfig.serverUrl + "sys/sysDict/findByType?type=client_version_type";

            this.DoWorkAsync(500, (o) => //耗时逻辑处理(此处不能操作UI控件,因为是在异步中)
            {
                String data = HttpClass.httpPost(url);
                return(data);
            }, null, (r) => //显示结果(此处用于对上面结果的处理,比如显示到界面上)
            {
                JObject objT = JObject.Parse(r.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    List <DictEntity> dictList = objT["result"].ToObject <List <DictEntity> >();
                    DictEntity dict            = new DictEntity();
                    dict.label = "全部";
                    dict.value = "`";
                    dictList.Insert(0, dict);
                    lueType.Properties.DataSource    = dictList;
                    lueType.Properties.DisplayMember = "label";
                    lueType.Properties.ValueMember   = "value";
                    lueType.ItemIndex = 0;
                    SearchData(true, 1, pageControl1.PageSize);
                }
                else
                {
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK,
                                         MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MainForm);
                }
            });
        }