Beispiel #1
0
        public frmEdit_AMR_MST07(AMR_MST07 contact, IDXMenuManager menuManager)
        {
            InitializeComponent();
            this.contact = contact;
            this.bindingContact = contact.Clone();
            InitEditors();
            InitMenuManager(menuManager);


            teMST07IDE.DataBindings.Add("Text", bindingContact, "MST07IDE");
            teMST07NAM.DataBindings.Add("Text", bindingContact, "MST07NAM");
            
            UpdateCaption();
            InitValidationProvider();
        }
Beispiel #2
0
 public void Assign(AMR_MST07 info)
 {
     this.MST07IDE = info.MST07IDE;
     this.MST07NAM = info.MST07NAM;
 }
Beispiel #3
0
 public AMR_MST07(AMR_MST07 info)
 {
     this.Assign(info);
 }
Beispiel #4
0
        public void Assign(AMR_MST07 info)
        {
            this.MST07IDE = info.MST07IDE;
            this.MST07NAM = info.MST07NAM;


        }
Beispiel #5
0
 public AMR_MST07(AMR_MST07 info)
 {
     this.Assign(info);
 }
Beispiel #6
0
        protected internal override void ButtonClick(string tag) {
            switch(tag) {
                case TagResources.ContactList:
                    UpdateMainView(gridView1);
                    ClearSortingAndGrouping();
                    break;
                case TagResources.ContactAlphabetical:
                    UpdateMainView(gridView1);
                    ClearSortingAndGrouping();
                    colSno.Group();
                    break;
                //case TagResources.ContactByState:
                //    UpdateMainView(gridView1);
                //    ClearSortingAndGrouping();
                //    colUserName.Group();
                //    colCity.SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
                //    break;
                case TagResources.ContactCard:
                    UpdateMainView(layoutView1);
                    break;
                case TagResources.FlipLayout:
                    layoutControl1.Root.FlipLayout();
                    break;
                case TagResources.DeviceDelete:
                    if(CurrentContact == null) return;
                    int index = gridView1.FocusedRowHandle;
                    gidControlNetworkManage.MainView.BeginDataUpdate();
                    try
                    {
                        DataHelper.AMR_MST07s.Remove(CurrentContact);
                    }
                    finally
                    {
                        gidControlNetworkManage.MainView.EndDataUpdate();
                    }
                    if(index > gridView1.DataRowCount - 1) index--;
                    gridView1.FocusedRowHandle = index;
                    ShowInfo(gridView1);
                    break;
                case TagResources.DeviceNew:
                    AMR_MST07 contact = new AMR_MST07();
                    if(EditUser(contact) == DialogResult.OK) {
                        gidControlNetworkManage.MainView.BeginDataUpdate();
                        try
                        {
                            DataHelper.AMR_MST07s.Add(contact);
                        }
                        finally
                        {
                            gidControlNetworkManage.MainView.EndDataUpdate();
                        }
                        ColumnView view = gidControlNetworkManage.MainView as ColumnView;
                        if(view != null) {
                            GridHelper.GridViewFocusObject(view, contact);
                            ShowInfo(view);
                        }
                    }
                    break;
                case TagResources.DeviceEdit:
                    EditUser(CurrentContact);
                    break;

                case TagResources.ComSetup:
                    DialogResult ret = DialogResult.Cancel;
            Cursor.Current = Cursors.WaitCursor;
            using (frmEdit_COM_SET frm = new frmEdit_COM_SET())
            {
                ret = frm.ShowDialog(OwnerForm);
            }
            UpdateCurrentContact();
            Cursor.Current = Cursors.Default;
                    break;

            }
            UpdateCurrentContact();
            UpdateInfo();
        }
Beispiel #7
0
 DialogResult EditUser(AMR_MST07 contact)
 {
     if(contact == null) return DialogResult.Ignore;
     DialogResult ret = DialogResult.Cancel;
     Cursor.Current = Cursors.WaitCursor;
     using (frmEdit_AMR_MST07 frm = new frmEdit_AMR_MST07(contact, OwnerForm.Ribbon))
     {
         ret = frm.ShowDialog(OwnerForm);
     }
     UpdateCurrentContact();
     Cursor.Current = Cursors.Default;
     return ret;
 }