public static async Task <UgyfelterDto> UgyfelterCheckAsync(ossContext context, IHubContext <OssHub> hubcontext, IConfiguration config, string linkparam) { const string uh = "Ügyféltér hiba {0} - értesítse a GridSolar sales-t!"; UgyfelterParam up; try { up = JsonConvert.DeserializeObject <UgyfelterParam>(StringCipher.Decrypt(linkparam, edKey)); } catch { throw new Exception(string.Format(uh, 1)); } // adott particióban létezi-e az ügyfél a kiküldési kóddal await UgyfelDal.UgyfelterCheckAsync(context, up.Particiokod, up.Ugyfelkod, up.Kikuldesikod); var result = new UgyfelterDto(); try { result.sid = await LogonBll.BejelentkezesAsync(context, hubcontext, config.GetValue <string>("Ugyfelter:user"), Crypt.MD5Hash(config.GetValue <string>("Ugyfelter:password")), "", "", ""); } catch { throw new Exception(string.Format(uh, 2)); } // az Ügyféltér usernek az ügyfél particióját kell tudni választani var csoport = (await LogonBll.SzerepkorokAsync(context, result.sid)).Where(s => s.Particiokod == up.Particiokod).ToList(); if (csoport.Count != 1) { throw new Exception(string.Format(uh, 3)); } await LogonBll.SzerepkorValasztasAsync(context, result.sid, csoport[0].Particiokod, csoport[0].Csoportkod); // ügyféltér log await UgyfelterLogDal.AddAsync(context, new Models.Ugyfelterlog { Ugyfelkod = up.Ugyfelkod }); result.ugyfelDto = await UgyfelBll.GetAsync(context, result.sid, up.Ugyfelkod); result.lstProjektDto = (await ProjektBll.SelectAsync(context, result.sid, 0, int.MaxValue, 0, new List <SzMT> { new SzMT { Szempont = Szempont.UgyfelKod, Minta = up.Ugyfelkod.ToString() } })).Item1; return(result); }
public static async Task <FotozasDto> CheckAsync(ossContext context, IHubContext <OssHub> hubcontext, IConfiguration config, string linkparam) { string uh = "Ügyféltér hiba {0} - értesítse a GridSolar sales-t!"; FotozasParam Fp; try { Fp = JsonConvert.DeserializeObject <FotozasParam>(StringCipher.Decrypt(linkparam, edKey)); } catch { throw new Exception(string.Format(uh, 1)); } // adott particióban létezi-e az irat a kiküldési kóddal IratDal.FotozasCheck(context, Fp.Particiokod, Fp.Iratkod, Fp.Kikuldesikod); var result = new FotozasDto(); try { result.sid = await LogonBll.BejelentkezesAsync(context, hubcontext, config.GetValue <string>("Fotozas:user"), Crypt.MD5Hash(config.GetValue <string>("Fotozas:password")), "", "", ""); } catch { throw new Exception(string.Format(uh, 2)); } // az Fotózás usernek az irat particióját kell tudni választani var csoport = (await LogonBll.SzerepkorokAsync(context, result.sid)) .Where(s => s.Particiokod == Fp.Particiokod).ToList(); if (csoport.Count != 1) { throw new Exception(string.Format(uh, 3)); } await LogonBll.SzerepkorValasztasAsync(context, result.sid, csoport[0].Particiokod, csoport[0].Csoportkod); result.iratDto = (await IratBll.SelectAsync(context, result.sid, 0, 1, new List <SzMT> { new SzMT { Szempont = Szempont.Kod, Minta = Fp.Iratkod.ToString() } })).Item1; result.dokumentumDto = await DokumentumBll.SelectAsync(context, result.sid, Fp.Iratkod, true, 350); var projektKapcsolatDto = await ProjektKapcsolatBll.SelectByIratAsync(context, result.sid, Fp.Iratkod); if (projektKapcsolatDto.Count != 0) { result.projektDto = (await ProjektBll.SelectAsync(context, result.sid, 0, 1, 0, new List <SzMT> { new SzMT { Szempont = Szempont.Kod, Minta = projektKapcsolatDto[0].Projektkod.ToString() } })).Item1; } return(result); }