Beispiel #1
0
        public static async Task ZoomCheckAsync(ossContext context, string sid, int ugyfelkod, string ugyfel)
        {
            SessionBll.Check(context, sid);
            await CsoportDal.JogeAsync(context, JogKod.UGYFELEK);

            await UgyfelDal.ZoomCheckAsync(context, ugyfelkod, ugyfel);
        }
Beispiel #2
0
        public static async Task <UgyfelDto> GetAsync(ossContext context, string sid, int key)
        {
            SessionBll.Check(context, sid);
            await CsoportDal.JogeAsync(context, JogKod.UGYFELEK);

            var entity = await UgyfelDal.GetAsync(context, key);

            return(Calc(entity));
        }
Beispiel #3
0
        public static async Task <int> AddAsync(ossContext context, string sid, UgyfelDto dto)
        {
            SessionBll.Check(context, sid);
            await CsoportDal.JogeAsync(context, JogKod.UGYFELEKMOD);

            var entity = ObjectUtils.Convert <UgyfelDto, Models.Ugyfel>(dto);
            await UgyfelDal.ExistsAsync(context, entity);

            return(await UgyfelDal.AddAsync(context, entity));
        }
Beispiel #4
0
        public static async Task DeleteAsync(ossContext context, string sid, UgyfelDto dto)
        {
            SessionBll.Check(context, sid);
            await CsoportDal.JogeAsync(context, JogKod.UGYFELEKMOD);

            await UgyfelDal.Lock(context, dto.Ugyfelkod, dto.Modositva);

            await UgyfelDal.CheckReferencesAsync(context, dto.Ugyfelkod);

            var entity = await UgyfelDal.GetAsync(context, dto.Ugyfelkod);

            await UgyfelDal.DeleteAsync(context, entity);
        }
Beispiel #5
0
        public static async Task <int> UpdateAsync(ossContext context, string sid, UgyfelDto dto)
        {
            SessionBll.Check(context, sid);
            await CsoportDal.JogeAsync(context, JogKod.UGYFELEKMOD);

            await UgyfelDal.Lock(context, dto.Ugyfelkod, dto.Modositva);

            var entity = await UgyfelDal.GetAsync(context, dto.Ugyfelkod);

            ObjectUtils.Update(dto, entity);
            await UgyfelDal.ExistsAnotherAsync(context, entity);

            return(await UgyfelDal.UpdateAsync(context, entity));
        }
Beispiel #6
0
        public static async Task <List <UgyfelDto> > ReadAsync(ossContext context, string sid, string maszk)
        {
            SessionBll.Check(context, sid);
            await CsoportDal.JogeAsync(context, JogKod.UGYFELEK);

            var entities = await UgyfelDal.ReadAsync(context, maszk);

            var result = new List <UgyfelDto>();

            foreach (var entity in entities)
            {
                result.Add(Calc(entity));
            }
            return(result);
        }
Beispiel #7
0
        // TODO
        public static async Task <string> vCardAsync(ossContext context, string sid, int ugyfelkod)
        {
            SessionBll.Check(context, sid);
            await CsoportDal.JogeAsync(context, JogKod.UGYFELEK);

            var entity = await UgyfelDal.GetAsync(context, ugyfelkod);

            var b = new StringBuilder();

            b.Append("BEGIN:VCARD\r\nVERSION:2.1\r\n");
            b.Append("FN;ENCODING=QUOTED-PRINTABLE;CHARSET=utf-8:").Append(entity.Nev).Append("\r\n");
            b.Append("N;ENCODING=QUOTED-PRINTABLE;CHARSET=utf-8:").Append(entity.Nev).Append(";;;\r\n");
            b.Append("END:VCARD\r\n");

            return(b.ToString());
        }
Beispiel #8
0
        public static async Task <UgyfelDto> UpdatePosAsync(ossContext context, string sid,
                                                            int Ugyfelkod, int X, int Y, DateTime UtolsoModositas)
        {
            SessionBll.Check(context, sid);
            await CsoportDal.JogeAsync(context, JogKod.UGYFELEKMOD);

            await UgyfelDal.Lock(context, Ugyfelkod, UtolsoModositas);

            var entity = await UgyfelDal.GetAsync(context, Ugyfelkod);

            entity.Halox = X;
            entity.Haloy = Y;
            await UgyfelDal.UpdateAsync(context, entity);

            return(await GetAsync(context, Ugyfelkod));
        }
Beispiel #9
0
        public static async Task <Tuple <List <UgyfelDto>, int> > SelectAsync(ossContext context, string sid, int rekordTol, int lapMeret,
                                                                              int csoport, List <SzMT> szmt)
        {
            SessionBll.Check(context, sid);
            await CsoportDal.JogeAsync(context, JogKod.UGYFELEK);

            var qry          = UgyfelDal.GetQuery(context, csoport, szmt);
            var osszesRekord = await qry.CountAsync();

            var entities = await qry.Skip(rekordTol).Take(lapMeret).ToListAsync();

            var result = new List <UgyfelDto>();

            foreach (var entity in entities)
            {
                result.Add(Calc(entity));
            }

            return(new Tuple <List <UgyfelDto>, int>(result, osszesRekord));
        }
Beispiel #10
0
        public static async Task <UgyfelDto> GetAsync(ossContext context, int key)
        {
            var entity = await UgyfelDal.GetAsync(context, key);

            return(Calc(entity));
        }