public void NavigateToDirectory(MVOrgChart dir) { if (dir.ParentDirectoryID.Equals("")) { currentPath.Clear(); } else { ArrayList arr = new ArrayList(); foreach (MVOrgChart vd in currentPath) { arr.Add(vd); if (vd.ParentDirectoryID.Equals(dir.ParentDirectoryID)) { break; } } currentPath.Clear(); foreach (MVOrgChart vd in arr) { currentPath.Add(vd); } } NotifyPropertyChanged("CurrentPath"); NotifyPropertyChanged("IsMoveUpAble"); }
private void CmdAction_Click(object sender, RoutedEventArgs e) { Button btn = sender as Button; currentViewObj = (MVOrgChart)btn.Tag; btn.ContextMenu.IsOpen = true; }
private void LsvMain_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (lsvMain.SelectedItems.Count == 1) { MVOrgChart obj = (MVOrgChart)lsvMain.SelectedItems[0]; vw.AddDirectoryPath(obj); vw.CurrentDirectory.ParentDirectoryID = obj.DirectoryID; QueryData(vw.CurrentDirectory.GetDbObject()); } }
private void UPathLabels_DirectoryClicked(object sender, RoutedEventArgs e) { TextBlock tb = (TextBlock)sender; MVOrgChart obj = (MVOrgChart)tb.Tag; obj.ParentDirectoryID = obj.DirectoryID; vw.NavigateToDirectory(obj); vw.CurrentDirectory.ParentDirectoryID = obj.DirectoryID; QueryData(vw.CurrentDirectory.GetDbObject()); }
protected override MBaseModel createObject() { MVOrgChart mv = new MVOrgChart(new CTable("")); int cnt = currentPaths.Count; if ((currentPaths != null) && (cnt > 0)) { MVOrgChart p = (MVOrgChart)currentPaths[cnt - 1]; mv.ParentDirectoryID = p.DirectoryID; } mv.Category = category; return(mv); }
public void QueryData(CTable tb) { ArrayList itemsList = submitCommand(tb); if (itemsList == null) { return; } vw.CurrentItemSource.Clear(); foreach (CTable o in itemsList) { MVOrgChart v = new MVOrgChart(o); vw.CurrentItemSource.Add(v); } }
private void CmdUp_Click(object sender, RoutedEventArgs e) { vw.ChangeDirectoryUp(); int last = vw.CurrentPath.Count - 1; if (last < 0) { vw.CurrentDirectory.ParentDirectoryID = ""; } else { MVOrgChart obj = vw.CurrentPath[last]; vw.CurrentDirectory.ParentDirectoryID = obj.DirectoryID; } QueryData(vw.CurrentDirectory.GetDbObject()); }
private void setCurrentProperties() { String cat = currentCategory.MasterID; if (cat.Equals("1")) { currentDir = departmentDir; currentName = CLanguage.getValue("department"); currentPath = departmentPath; currentItemSources = departmentItems; } else if (cat.Equals("2")) { currentDir = positionDir; currentName = CLanguage.getValue("position"); currentPath = positionPath; currentItemSources = positionItems; } }
public void AddDirectoryPath(MVOrgChart dir) { currentPath.Add(dir); NotifyPropertyChanged("CurrentPath"); NotifyPropertyChanged("IsMoveUpAble"); }