public bool Save(risTabulky risContext) { bool success = false; try { if (kod_jazyka == "") // INSERT { this.FillEntity(); risContext.jazyk.Add(entityJazyk); risContext.SaveChanges(); success = true; } else // UPDATE { var temp = from a in risContext.jazyk where a.kod_jazyka == kod_jazyka select a; entityJazyk = temp.Single(); this.FillEntity(); risContext.SaveChanges(); success = true; } } catch (Exception ex) { throw new ApplicationException(String.Format("{0}.{1}", this.GetType(), "Save()"), ex); } return(success); }
private void Reset() { kod_jazyka = ""; nazov = ""; preklad = new List <BPreklad>(); entityJazyk = new jazyk(); }
public BJazyk(jazyk j) { kod_jazyka = j.kod_jazyka; nazov = j.nazov; preklad = new List <BPreklad>(); entityJazyk = j; }
public bool Get(risTabulky risContext, string kod) { bool success = false; try { var temp = from a in risContext.jazyk where a.kod_jazyka == kod select a; entityJazyk = temp.Single(); this.FillBObject(); success = true; } catch (Exception ex) { throw new ApplicationException(String.Format("{0}.{1}", this.GetType(), "Get()"), ex); } return(success); }