예제 #1
0
        /// <summary>
        /// 数据加载
        /// </summary>
        public void LoadData()
        {
            try
            {
                AppAccountMgn info = new AppAccountMgn();

                //info.ProjectName = this.projectNo.Text;

                pageInfo.ParamsSearch = info;

                //需要这个把 组件的分页信息赋值当前页面全局变量
                ObjectUtil.CopyPop(this.kenPage1.pageInfo, ref pageInfo);

                pageInfo = projectInfoBLL.SelectPage(pageInfo, null, $" SOURCE like '%{this.keyWord.Text}%'", WhereType.SQL);

                listData = pageInfo.Records;


                //this.showStrip.Text = string.Format("共{0}页({1}条记录)", pageInfo.CurrentPage, pageInfo.TotalPage);
                this.listDataGriddView.DataSource = listData;

                //分页部分
                var item = new MyWfControls.dto.PageInfo()
                {
                    CurrentPage = pageInfo.CurrentPage > 0? pageInfo.CurrentPage:1, CurrentCount = pageInfo.CurrentCount, PageSize = pageInfo.PageSize, TotalPage = pageInfo.TotalPage
                };
                this.kenPage1.pageInfo = item;
                this.kenPage1.SetShowText();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #2
0
        public void LoadData()
        {
            try
            {
                AppAccountMgn selectItem = new AppAccountMgn();
                selectItem.ID = appAccountMgn.ID;

                List <AppAccountMgn> lists = appAccountMgnBLL.SelectList(selectItem, null, "ID", WhereType.Columns);

                if (lists != null && lists.Count > 0)
                {
                    appAccountMgn = lists[0];
                    //加密码和管理密码不对外展示
                    ObjectUtil.CopyPop(appAccountMgn, ref selectItem, "ENCPWD", "MGNPWD");
                    FormHelp.SetControlsByEntity(selectItem, this.panel1);
                }
            }
            catch (Exception ex)
            {
                MessageHelper.ShowError(ex);
            }
        }
예제 #3
0
        private void txButton1_Click(object sender, EventArgs e)
        {
            try
            {
                OsZbPurchaseProjectInfo projectInfo = FormHelp.GetEntityByControls <OsZbPurchaseProjectInfo>(this.groupBox2);
                osZbPurchaseProjectInfo = osZbPurchaseProjectInfo ?? new OsZbPurchaseProjectInfo();

                ObjectUtil.CopyPop(projectInfo, ref osZbPurchaseProjectInfo, "Id");

                VerifyMessage verifyMessage = VerifyUtil.Verify(osZbPurchaseProjectInfo);

                if (!string.IsNullOrWhiteSpace(verifyMessage.ErrorInfo))
                {
                    MessageBox.Show(verifyMessage.ErrorInfo,
                                    "提示",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Warning);
                    return;
                }
                else if (!string.IsNullOrWhiteSpace(verifyMessage.PromptInfo))
                {
                    MessageBox.Show(verifyMessage.PromptInfo,
                                    "提示",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Warning);
                }


                R result = osZbPurchaseProjectInfoBLL.SaveOrUpdate(osZbPurchaseProjectInfo, null, true, null);

                if (!result.Successful)
                {
                    MessageBox.Show(result.ResultHint,
                                    "提示",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    MessageBox.Show("操作成功",
                                    "提示",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                    if (RefeshParentWindow != null)
                    {
                        RefeshParentWindow.Invoke();
                    }
                    this.Hide();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                log.AddLog(ex.Message, null);

                MessageBox.Show(ex.Message,
                                "提示",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
            }
        }