private Boolean SaveData() { if (Mode.Equals("A")) { if (SaveToView()) { parentView.AddTxItem(vw, Idt); return(true); } return(false); } else if (Mode.Equals("E")) { if (vw.IsModified) { Boolean result = SaveToView(); if (result) { CTable o = actualView.GetDbObject(); o.CopyFrom(vw.GetDbObject()); actualView.NotifyAllPropertiesChanged(); return(true); } return(false); } return(true); } return(true); }
private void LoadData() { this.Title = Caption; CTable t = new CTable("INVENTORY_TX"); vw = new MInventoryTransaction(t); //vw.LocationObj = this.locationObj; vw.CreateDefaultValue(); DataContext = vw; CUtil.EnableForm(false, this); if (Mode.Equals("E")) { CTable newDB = actualView.GetDbObject().Clone(); vw.SetDbObject(newDB); vw.NotifyAllPropertiesChanged(); radUp.IsChecked = vw.UpSelected; radDown.IsChecked = vw.DownSelected; } else { vw.DownSelected = true; radDown.IsChecked = true; } vw.IsModified = false; CUtil.EnableForm(true, this); }
private void LoadData() { this.Title = Caption; CUtil.EnableForm(false, this); if (Mode.Equals("E")) { CTable newDB = actualView.GetDbObject().Clone(); vw.SetDbObject(newDB); vw.NotifyAllPropertiesChanged(); } vw.IsModified = false; CUtil.EnableForm(true, this); }