public static async Task <string> CreateNewLinkAsync(ossContext context, string sid, IratDto dto) { SessionBll.Check(context, sid); await CsoportDal.JogeAsync(context, JogKod.IRATMOD); await IratDal.Lock(context, dto.Iratkod, dto.Modositva); var entity = await IratDal.GetAsync(context, dto.Iratkod); var kikuldesikod = Guid.NewGuid().ToString(); var up = new FotozasParam { Particiokod = (int)context.CurrentSession.Particiokod, Iratkod = dto.Iratkod, Kikuldesikod = kikuldesikod }; entity.Kikuldesikod = kikuldesikod; entity.Kikuldesikodidopontja = DateTime.Now; await IratDal.UpdateAsync(context, entity); return(Link(up)); }
public static async Task <string> GetLinkAsync(ossContext context, string sid, IratDto dto) { SessionBll.Check(context, sid); await CsoportDal.JogeAsync(context, JogKod.IRATMOD); await IratDal.Lock(context, dto.Iratkod, dto.Modositva); var entity = await IratDal.GetAsync(context, dto.Iratkod); if (entity.Kikuldesikod == null) { throw new Exception("Ez az irat még nem kapott fotózás linket!"); } var Up = new FotozasParam { Particiokod = (int)context.CurrentSession.Particiokod, Iratkod = entity.Iratkod, Kikuldesikod = entity.Kikuldesikod }; return(Link(Up)); }
private static string Link(FotozasParam Fp) { // a cím elejét a kliens tudja return("fotozas?fp=" + HttpUtility.UrlEncode(StringCipher.Encrypt(JsonConvert.SerializeObject(Fp), edKey))); }