public BSurovinaJedla(jedlo_surovina js)
        {
            id_surovina = js.id_surovina;
            id_jedla = js.id_jedla;
            id_typu = js.id_typu;
            mnozstvo = js.mnozstvo;

            jedlo = new BJedlo(js.jedlo);
            surovina = new BSurovina(js.surovina);

            entityJedloSurovina = js;
        }
        public bool Save(risTabulky risContext)
        {
            bool success = false;

            try
            {
                if (id_jedla == -1 && id_surovina == -1) // INSERT
                {
                    this.FillEntity();
                    risContext.jedlo_surovina.Add(entityJedloSurovina);
                    risContext.SaveChanges();
                    this.FillBObject();
                    success = true;
                }
                else // UPDATE
                {
                    var temp = from a in risContext.jedlo_surovina where a.id_jedla == id_jedla && a.id_surovina==id_surovina select a;
                    entityJedloSurovina = temp.Single();
                    this.FillEntity();
                    risContext.SaveChanges();

                    success = true;
                }
            }
            catch (Exception ex)
            {
                throw new ApplicationException(String.Format("{0}.{1}", this.GetType(), "Save()"), ex);
            }

            return success;
        }
        public bool Get(risTabulky risContext, int id)
        {
            bool success = false;
            try
            {
                var temp = from a in risContext.jedlo_surovina where a.id_jedla == id_jedla && a.id_surovina == id_surovina select a;
                entityJedloSurovina = temp.Single();
                this.FillBObject();
                success = true;
            }
            catch (Exception ex)
            {
                throw new ApplicationException(String.Format("{0}.{1}", this.GetType(), "Get()"), ex);
            }

            return success;
        }