Ejemplo n.º 1
0
        /// <summary>
        /// 打开查看窗体
        /// </summary>
        private void OpenViewForm()
        {
            CustomerDataSet.BasicInfoRow basicRow = GetSelectedRow();
            if (basicRow == null)
            {
                MsgBoxUtility.ShowError("请选择一条记录!");
                return;
            }

            DemoCustomerDetailForm frm = new DemoCustomerDetailForm(FormState.View, basicRow, null);

            frm.ShowDialog();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 新增按钮单击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolBtnAdd_Click(object sender, EventArgs e)
        {
            DemoCustomerDetailForm frm = new DemoCustomerDetailForm(FormState.Add, null, this.CustomerService);

            //绑定窗体新增成功事件
            frm.AddSucceed += (obj, args) =>
            {
                // 记住分页信息的查询客户信息操作然后绑定客户信息
                this.RemeberPagerQueryAndBind();

                //发布滚动消息
                this.MessageDisplayer.Display("customerview" + DateTime.Now.ToString(), string.Format("{0}客户新增成功!", args.Args.Name), "客户新增成功消息内容", DateTime.Now.AddDays(-1));
            };
            frm.ShowDialog();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 编辑按钮单击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolBtnEdit_Click(object sender, EventArgs e)
        {
            CustomerDataSet.BasicInfoRow basicRow = GetSelectedRow();
            if (basicRow == null)
            {
                MsgBoxUtility.ShowError("请选择一条记录!");
                return;
            }

            DemoCustomerDetailForm frm = new DemoCustomerDetailForm(FormState.Edit, basicRow, this.CustomerService);

            //绑定窗体更新成功事件
            frm.UpdateSucceed += (obj, args) =>
            {
                // 记住分页信息的查询客户信息操作然后绑定客户信息
                this.RemeberPagerQueryAndBind();
            };
            frm.ShowDialog();
        }