Beispiel #1
0
        public void SetStatus(TypStatusuZwrotu typ)
        {
            var status = StatusZwrotu.GetByTyp(this.DbContext, typ);

            if (status != null)
            {
                SetStatus(status);
            }
            else
            {
                throw new Exception("Nie istnieje status zwrotu dla typu " + typ.ToString());
            }
        }
Beispiel #2
0
        /*
         * public static StatusZwrotu GetByTyp(TypStatusuZwrotu typ)
         * {
         *  return ContextManager.WebContext.StatusyZwrotow.Where(sz => sz.Typ == (int)typ).FirstOrDefault();
         * }
         */

        public static StatusZwrotu GetByTyp(WebContext dc, TypStatusuZwrotu typ)
        {
            return(dc.StatusyZwrotow.Where(sz => sz.Typ == (int)typ).FirstOrDefault());
        }