public ClassCollection SelectClass(string procedureName) { OpenConnection(); List<ClassTableModal> result = DbConnection.Query<ClassTableModal>(procedureName, commandType: System.Data.CommandType.StoredProcedure).ToList<ClassTableModal>(); ClassCollection collection = new ClassCollection(); foreach (ClassTableModal modal in result) { collection.Add(modal); } CloseConnection(); return collection; }
public BlockTraineeOperationViewModel(TraineeManagementBussiness trainees, TraineeOperationBussiness traineeOperation, BlockClassManagement blockClasses) : base(trainees) { _traineeOperation = traineeOperation; _traineeOperation.OperationEnableEvent += Enable; _blockClasses = blockClasses; _blockClasses.BlockClassCollection.ForEach(c => ClassCollection.Add(c.ClassName)); _blockClasses.BlockClassChangedEvent += (operation, regularClass, newIndex) => { ClassCollection.Clear(); _blockClasses.BlockClassCollection.ForEach(c => ClassCollection.Add(c.ClassName)); }; ClassComboWidth = 200; VisRemain = Visibility.Hidden; }
void GetOuterClasses(ClassCollection classes, IClass curClass) { if (curClass != null) { foreach (IClass c in curClass.InnerClasses) { if (c != null && c.Region != null && c.Region.IsInside(caretLine, caretColumn)) { if (c != GetInnermostClass()) { GetOuterClasses(classes, c); classes.Add(c); } break; } } } }
/// <remarks> /// Returns all (nestet) classes in which the carret currently is exept /// the innermost class, returns an empty collection if the carret is in /// no class or only in the innermost class. /// the most outer class is the last in the collection. /// </remarks> ClassCollection GetOuterClasses() { ClassCollection classes = new ClassCollection(); if (cu != null) { foreach (IClass c in cu.Classes) { if (c != null && c.Region != null && c.Region.IsInside(caretLine, caretColumn)) { if (c != GetInnermostClass()) { GetOuterClasses(classes, c); classes.Add(c); } break; } } } return(classes); }
public ClassCollection getClass(int line, int station, int department) { SqlConnection con = new SqlConnection(conStr); con.Open(); ClassCollection Class = new ClassCollection(); String qry = String.Empty; qry = @"SELECT id , description FROM class where line={0} and station = {1} and department={2} ORDER by id"; qry = String.Format(qry, line,station , department); SqlCommand cmd = new SqlCommand(qry, con); SqlDataReader dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); dr.Close(); cmd.Dispose(); for (int i = 0; i < dt.Rows.Count; i++) { Class.Add(new Class(department, (int)dt.Rows[i]["id"], (string)dt.Rows[i]["description"])); } con.Close(); con.Dispose(); return Class; }
/// <remarks> /// Returns all (nestet) classes in which the carret currently is exept /// the innermost class, returns an empty collection if the carret is in /// no class or only in the innermost class. /// the most outer class is the last in the collection. /// </remarks> ClassCollection GetOuterClasses() { ClassCollection classes = new ClassCollection(); if (cu != null) { foreach (IClass c in cu.Classes) { if (c != null && c.Region != null && c.Region.IsInside(caretLine, caretColumn)) { if (c != GetInnermostClass()) { GetOuterClasses(classes, c); classes.Add(c); } break; } } } return classes; }