public WTPComponent AddComponent(IWTPCOMPONENT row, WTPComponent ParentComponent) { Plan.Components.FillRow(row); WTPComponent newComponent = Plan.Components.Add(row, false); newComponent.Parent = ParentComponent; return(newComponent); }
public WTPRow AddRow(IWTPROW row, WTPComponent ParentComponent) { Plan.Rows.FillRow(row); WTPRow newRow = Plan.Rows.Add(row, false); newRow.Component = ParentComponent; return(newRow); }
public WTPRowGroup AddRowGroup(IWTPROWGROUP rowGroup, WTPComponent ParentComponent) { Plan.RowGroups.FillRow(rowGroup); WTPRowGroup newRowGroup = Plan.RowGroups.Add(rowGroup, false); newRowGroup.Component = ParentComponent; return(newRowGroup); }
private WTPComponent CreateComponent(Hashtable WTPs, IWTPCOMPONENT WTPComponent) { Wtp plan = (Wtp)WTPs[WTPComponent.WTP_ID.Value]; WTPComponent newComponent = plan.Components.Add(WTPComponent, true); return(newComponent); }
private void SetComponentParent(Hashtable Components) { foreach (DictionaryEntry de in Components) { WTPComponent component = (WTPComponent)de.Value; if (component.DataRow.WTPCOMPONENT_PARENTID.HasValue) { component.Parent = (WTPComponent)Components[component.DataRow.WTPCOMPONENT_PARENTID.Value]; } } }
public WTPRow AddWTPROW(XElement planRow, WTPComponent ParentComponent, int VariationID) //для дисциплин по выбору { Int64 discipId = _presenter.GetStudDisciplineByName(planRow.Attribute("Дисциплина").Value, "", 1); var SortIndex = int.Parse(planRow.Attribute("Порядок").Value); var Number = int.Parse(planRow.Attribute("Номер").Value); var Index = planRow.Attribute("ДисциплинаКод").Value; var ChairID = _presenter.GetChairByCode(planRow.Attribute("КодКафедры").Value); var discipline = _presenter.Plan.Rows. Where(r => r.DataRow.WTPROW_SORTINDEX == SortIndex). Where(r => r.DataRow.WTPROW_NUMBER == Number). Where(r => r.DataRow.STUDDISCIPLINE_ID == discipId). Where(r => r.DataRow.WTPROW_VARIATIONID == VariationID). Where(r => r.DataRow.CHAIR_ID == ChairID). Where(r => r.DataRow.WTPROW_INDEX == Index); WTPRow discipRow; if (discipline.Count() == 0) { var newrow = _presenter.CreateNewRow(); newrow.CHAIR_ID = _presenter.GetChairByCode(planRow.Attribute("КодКафедры").Value); newrow.STUDDISCIPLINE_ID = discipId; newrow.WTPROW_SORTINDEX = SortIndex; newrow.WTPROW_NUMBER = Number; newrow.WTPROW_INDEX = Index; newrow.WTPROW_VARIATIONID = VariationID; discipRow = _presenter.AddRow(newrow, ParentComponent); } else { discipRow = discipline.First(); } return(discipRow); //Int64 discipId = _presenter.GetStudDisciplineByName(planRow.Attribute("Дисциплина").Value, "", 1); //var newrow = _presenter.CreateNewRow(); ////newrow.CHAIR_ID = presenter.GetChairByCode(planRow.Attribute("КодКафедры").Value); //newrow.STUDDISCIPLINE_ID = discipId; //newrow.WTPROW_SORTINDEX = int.Parse(planRow.Attribute("Порядок").Value); //newrow.WTPROW_NUMBER = int.Parse(planRow.Attribute("Номер").Value); //newrow.WTPROW_VARIATIONID = VariationID; //var discipRow = _presenter.AddRow(newrow, ParentComponent); //return discipRow; }
public void AddComponent(WTPComponent ParentComponent) { IWTPCOMPONENT newRow = DbManager.CreateRow <IWTPCOMPONENT>(); AddComponent(newRow, ParentComponent); }
//public WTPGridRow(WTPComponent parentComponent, WTPComponent childComponent, WTPRow row, List<WTPRowValue> values) //{ // string block = ""; // if (parentComponent.DataRow.WTPCOMPONENT_CODE == "Б1") block = "Блок 1."; // if (parentComponent.DataRow.WTPCOMPONENT_CODE == "Б2") block = "Блок 2."; // if (parentComponent.DataRow.WTPCOMPONENT_CODE == "Б3") block = "Блок 3."; // if (parentComponent.DataRow.WTPCOMPONENT_CODE == "ФТД") block = "ФТД."; // ParentCycle = block + parentComponent.DataRow.WTPCOMPONENT_NAME; // ChildCycle = childComponent.DataRow.WTPCOMPONENT_NAME; // Discip_Name = row.DataRow.STUDDISCIPLINE_NAME; // Code = row.DataRow.WTPROW_INDEX; // SortIndex = row.DataRow.WTPROW_SORTINDEX; // Number = row.DataRow.WTPROW_NUMBER; // foreach (WTPRowValue value in values) // { // switch (value.DataRow.WTPPARAM_ID) // { // case 16: // Exams = value.DataRow.WTPROWVALUES_VALUE; // break; // case 17: // MidTerms = value.DataRow.WTPROWVALUES_VALUE; // break; // case 7: // Lections = value.DataRow.WTPROWVALUES_VALUE; // break; // case 10: // Practics = value.DataRow.WTPROWVALUES_VALUE; // break; // case 12: // LabWorks = value.DataRow.WTPROWVALUES_VALUE; // break; // case 14: // Referats = value.DataRow.WTPROWVALUES_VALUE; // break; // case 13: // CalcGraphWorks = value.DataRow.WTPROWVALUES_VALUE; // break; // case 18: // CoursProjects = value.DataRow.WTPROWVALUES_VALUE; // break; // case 19: // CoursWorks = value.DataRow.WTPROWVALUES_VALUE; // break; // case 34: // TotalHours = value.DataRow.WTPROWVALUES_VALUE; // break; // case 28: // IndependentWork = value.DataRow.WTPROWVALUES_VALUE; // break; // case 24: // KSR = value.DataRow.WTPROWVALUES_VALUE; // break; // case 5: // ZE = value.DataRow.WTPROWVALUES_VALUE; // break; // default: // continue; // } // } //} ////public WTPGridRow(WTPComponent parentComponent, WTPComponent childComponent, WTPComponent module, WTPRow row, List<WTPRowValue> values, long? sem_num) //{ // string block = ""; // if (parentComponent.DataRow.WTPCOMPONENT_CODE == "Б1") block = "Блок 1."; // if (parentComponent.DataRow.WTPCOMPONENT_CODE == "Б2") block = "Блок 2."; // if (parentComponent.DataRow.WTPCOMPONENT_CODE == "Б3") block = "Блок 3."; // if (parentComponent.DataRow.WTPCOMPONENT_CODE == "ФТД") block = "ФТД."; // ParentCycle = block + parentComponent.DataRow.WTPCOMPONENT_NAME; // ChildCycle = childComponent.DataRow.WTPCOMPONENT_NAME; // Discip_Name = row.DataRow.STUDDISCIPLINE_NAME; // SemNum = sem_num; // Code = row.DataRow.WTPROW_INDEX; // SortIndex = row.DataRow.WTPROW_SORTINDEX; // Number = row.DataRow.WTPROW_NUMBER; // foreach (WTPRowValue value in values) // { // switch (value.DataRow.WTPPARAM_ID) // { // case 16: // Exams = value.DataRow.WTPROWVALUES_VALUE; // break; // case 17: // MidTerms = value.DataRow.WTPROWVALUES_VALUE; // break; // case 7: // Lections = value.DataRow.WTPROWVALUES_VALUE; // break; // case 10: // Practics = value.DataRow.WTPROWVALUES_VALUE; // break; // case 12: // LabWorks = value.DataRow.WTPROWVALUES_VALUE; // break; // case 14: // Referats = value.DataRow.WTPROWVALUES_VALUE; // break; // case 13: // CalcGraphWorks = value.DataRow.WTPROWVALUES_VALUE; // break; // case 18: // CoursProjects = value.DataRow.WTPROWVALUES_VALUE; // break; // case 19: // CoursWorks = value.DataRow.WTPROWVALUES_VALUE; // break; // case 34: // TotalHours = value.DataRow.WTPROWVALUES_VALUE; // break; // case 28: // IndependentWork = value.DataRow.WTPROWVALUES_VALUE; // break; // case 24: // KSR = value.DataRow.WTPROWVALUES_VALUE; // break; // case 5: // ZE = value.DataRow.WTPROWVALUES_VALUE; // break; // default: // continue; // } // } //} public WTPGridRow(WTPComponent parentComponent, WTPComponent childComponent, WTPRow row, List <WTPRowValue> values, long?sem_num) { string block = ""; if (parentComponent.DataRow.WTPCOMPONENT_CODE == "Б1") { block = "Блок 1."; } if (parentComponent.DataRow.WTPCOMPONENT_CODE == "Б2") { block = "Блок 2."; } if (parentComponent.DataRow.WTPCOMPONENT_CODE == "Б3") { block = "Блок 3."; } if (parentComponent.DataRow.WTPCOMPONENT_CODE == "ФТД") { block = "ФТД."; } ParentCycle = block + parentComponent.DataRow.WTPCOMPONENT_NAME; ChildCycle = childComponent.DataRow.WTPCOMPONENT_NAME; Discip_Name = row.DataRow.STUDDISCIPLINE_NAME; SemNum = sem_num; Code = row.DataRow.WTPROW_INDEX; SortIndex = row.DataRow.WTPROW_SORTINDEX; Number = row.DataRow.WTPROW_NUMBER; foreach (WTPRowValue value in values) { switch (value.DataRow.WTPPARAM_ID) { case 16: Exams = value.DataRow.WTPROWVALUES_VALUE; break; case 17: MidTerms = value.DataRow.WTPROWVALUES_VALUE; break; case 7: Lections = value.DataRow.WTPROWVALUES_VALUE; break; case 10: Practics = value.DataRow.WTPROWVALUES_VALUE; break; case 12: LabWorks = value.DataRow.WTPROWVALUES_VALUE; break; case 14: Referats = value.DataRow.WTPROWVALUES_VALUE; break; case 13: CalcGraphWorks = value.DataRow.WTPROWVALUES_VALUE; break; case 18: CoursProjects = value.DataRow.WTPROWVALUES_VALUE; break; case 19: CoursWorks = value.DataRow.WTPROWVALUES_VALUE; break; case 34: TotalHours = value.DataRow.WTPROWVALUES_VALUE; break; case 28: IndependentWork = value.DataRow.WTPROWVALUES_VALUE; break; case 24: KSR = value.DataRow.WTPROWVALUES_VALUE; break; case 5: ZE = value.DataRow.WTPROWVALUES_VALUE; break; default: continue; } } }