public static List <RadiUBasic> vratiRadniOdnos(int idZaposlenog, int idProdavnice) { List <RadiUBasic> radi = new List <RadiUBasic>(); try { ISession s = DataLayer.GetSession(); IEnumerable <RadiU> rad = from o in s.Query <RadiU>() where o.Id.RadnikRadiU.Jbr == idZaposlenog where o.Id.RadiUProdavnica.Id == idProdavnice select o; foreach (RadiU r in rad) { RadiUIdBasic id = new RadiUIdBasic(); id.RadiUProdavnica = DTOManager.vratiProdavnicu(r.Id.RadiUProdavnica.Id); id.RadnikRadiU = DTOManager.vratiRadnika(r.Id.RadnikRadiU.Jbr); radi.Add(new RadiUBasic(id, r.DatumOd, r.DatumDo)); } s.Close(); } catch (Exception ec) { //handle exceptions } return(radi); }
public RadiUBasic(RadiUIdBasic id, DateTime datumOd, DateTime?datumDo) { this.Id = id; this.DatumOd = datumOd; this.DatumDo = datumDo; }