void buttonSave_Click(object sender, EventArgs e) { try { Page.Validate(); if (Page.IsValid) { DivisionType team = DivisionTypeBL.GetBy(base.DivisionTypeId, false); if (team == null) { // insert team = new DivisionType(); team.Name = TextName.Text; team.LeagueId = base.LeagueId; team.Description = TextDescription.Text; team = DivisionTypeBL.Insert(team); } else { // update team.Name = TextName.Text; team.Description = TextDescription.Text; team = DivisionTypeBL.Update(team); } if (team == null) { message.Text = "Save failed"; } else { _redirectToListUrl(); } } } catch (Exception ex) { message.Text = ex.Message; } }
public DivisionType Insert(DivisionType divisionType) { divisionType.Enabled = true; divisionType.ID = Guid.NewGuid(); divisionType.Created = DateTime.Now; divisionType.Modified = DateTime.Now; DataContextHelper.CurrentContext.DivisionTypes.InsertOnSubmit(divisionType); DataContextHelper.CurrentContext.SubmitChanges(); return divisionType; }
public static EquationBase CreateEquation(EquationContainer equationParent, DivisionType divType) { EquationBase equation = null; switch (divType) { case DivisionType.DivRegular: equation = new DivRegular(equationParent); break; case DivisionType.DivRegularSmall: equation = new DivRegularSmall(equationParent); break; case DivisionType.DivDoubleBar: equation = new DivDoubleBar(equationParent); break; case DivisionType.DivTripleBar: equation = new DivTripleBar(equationParent); break; case DivisionType.DivHoriz: equation = new DivHorizontal(equationParent); break; case DivisionType.DivHorizSmall: equation = new DivHorizSmall(equationParent); break; case DivisionType.DivMath: equation = new DivMath(equationParent); break; case DivisionType.DivMathWithTop: equation = new DivMathWithTop(equationParent); break; case DivisionType.DivSlanted: equation = new DivSlanted(equationParent); break; case DivisionType.DivSlantedSmall: equation = new DivSlantedSmall(equationParent); break; case DivisionType.DivMathInverted: equation = new DivMathInverted(equationParent); break; case DivisionType.DivInvertedWithBottom: equation = new DivMathWithBottom(equationParent); break; case DivisionType.DivTriangleFixed: equation = new DivTriangle(equationParent, true); break; case DivisionType.DivTriangleExpanding: equation = new DivTriangle(equationParent, false); break; } return equation; }
public DivisionType Update(DivisionType divisionType) { DivisionType value = DataContextHelper.CurrentContext.DivisionTypes.FirstOrDefault<DivisionType>(n => n.ID.Equals(divisionType.ID)); if (value != null) { value.Name = divisionType.Name.Trim(); value.Description = divisionType.Description.Trim(); value.Enabled = divisionType.Enabled; value.Modified = DateTime.Now; DataContextHelper.CurrentContext.SubmitChanges(); } return value; }
public void AddDivision(DivisionType division) { throw new NotImplementedException(); }
public static bool IsAllowed(DivisionType division, Object parent) { //for now, only plain coa are available return parent is CoatOfArms && division == DivisionType.PartyPlain; }
public void Delete(DivisionType divisionType) { DataContextHelper.CurrentContext.DivisionTypes.DeleteOnSubmit(divisionType); DataContextHelper.CurrentContext.SubmitChanges(); }
public static DivisionType Insert(DivisionType divisionType) { return new DivisionTypeDao().Insert(divisionType); }
public static void Delete(DivisionType divisionType) { new DivisionTypeDao().Delete(divisionType); }
public static DivisionType Update(DivisionType divisionType) { return new DivisionTypeDao().Update(divisionType); }
partial void DeleteDivisionType(DivisionType instance);
partial void UpdateDivisionType(DivisionType instance);
partial void InsertDivisionType(DivisionType instance);
private void detach_DivisionTypes(DivisionType entity) { this.SendPropertyChanging(); entity.League = null; }