Beispiel #1
0
 private void btnUserEdit_Click(object sender, EventArgs e)
 {
     if (this.dgvUser.Rows.Count == 0)
     {
         return;
     }
     using (FrmEditor frm = new FrmEditor())
     {
         var editor = new ucTWindowUserEditor();
         editor.Dock = DockStyle.Fill;
         frm.Content = editor;
         frm.BLL     = this.winUserBll;
         if (this.userModel == null)
         {
             return;
         }
         frm.Model   = this.userModel;
         frm.Operate = OperateType.Save;
         frm.Icon    = System.Drawing.Icon.FromHandle(Resources.修改.GetHicon());
         if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             this.btnRefresh2.PerformClick();
         }
     }
 }
 private void EditOwnServer_1()
 {
     using (var frmEdit = new FrmEditor())
     {
         frmEdit.Model = (OwnList)listBoxOwnServers.SelectedItem;
         if (frmEdit.ShowDialog() == DialogResult.OK)
         {
             UpdateBindings();
         }
     }
 }
 //versions
 #region api v1
 private void AddOwnServer_1()
 {
     using (var frmEdit = new FrmEditor())
     {
         var abc = new OwnList();
         frmEdit.Model = abc;
         if (frmEdit.ShowDialog() == DialogResult.OK)
         {
             _model1.Data.OwnList.Add(abc);
             UpdateBindings();
             //  this.....Add(abc);
         }
     }
 }
Beispiel #4
0
 private void btnBusiNew_Click(object sender, EventArgs e)
 {
     using (FrmEditor frm = new FrmEditor())
     {
         var editor = new ucTWindowBusinessEditor();
         editor.Dock = DockStyle.Fill;
         frm.Content = editor;
         frm.BLL     = this.winBusiBll;
         var m = new TWindowBusinessModel();
         m.WindowID  = winId;
         frm.Model   = m;
         frm.Operate = OperateType.Save;
         frm.Icon    = System.Drawing.Icon.FromHandle(Resources.增加.GetHicon());
         if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             this.btnRefresh.PerformClick();
         }
     }
 }
Beispiel #5
0
 private void btnUserView_Click(object sender, EventArgs e)
 {
     if (this.dgvUser.Rows.Count == 0)
     {
         return;
     }
     using (FrmEditor frm = new FrmEditor())
     {
         var editor = new ucTWindowUserEditor();
         editor.Dock = DockStyle.Fill;
         frm.Content = editor;
         frm.BLL     = this.winUserBll;
         if (this.userModel == null)
         {
             return;
         }
         frm.Model   = this.userModel;
         frm.Operate = OperateType.View;
         frm.Icon    = System.Drawing.Icon.FromHandle(Resources.查找.GetHicon());
         frm.ShowDialog();
     }
 }