public ProcesView(int _CURENT_USER_ID, string conStr, string predefinedFilter) { NomenclatoareRepository tpr = new NomenclatoareRepository(_CURENT_USER_ID, conStr); this.TipuriProcese = (Nomenclator[])tpr.GetAll("tip_procese").Result; this.Instante = (Nomenclator[])tpr.GetAll("instante").Result; this.Complete = (Nomenclator[])tpr.GetAll("complete").Result; //ContracteRepository cr = new ContracteRepository(_CURENT_USER_ID, conStr); //this.Contracte = (Contract[])cr.GetAll().Result; ProceseRepository pr = new ProceseRepository(_CURENT_USER_ID, conStr); this.TipDocumenteScanateProcese = (string[])pr.GetTipDocumenteScanatePocese().Result; //PartiRepository par = new PartiRepository(_CURENT_USER_ID, conStr); //this.Parti = (Parte[])par.GetAll().Result; this.Calitati = (Nomenclator[])tpr.GetAll("calitati").Result; //Utilizator u = new Utilizator(_CURENT_USER_ID, conStr, _CURENT_USER_ID); //this.Societate = (SocietateAsigurare)u.GetSocietatiAsigurare().Result; this.Societate = new SocietateAsigurare(_CURENT_USER_ID, conStr, Convert.ToInt32(HttpContext.Current.Session["ID_SOCIETATE"])); //this.CurProces = new ProcesExtended(new Proces()); //this.procesJson = new ProcesJson(); StadiiRepository sr = new StadiiRepository(_CURENT_USER_ID, conStr); this.Stadii = (StadiuCombo[])sr.GetCombo().Result; this.Procese = null; this.CurProces = new ProcesExtended(new Proces()); this.FilteredRowsCount = 0; this.procesJson = new ProcesJson(); if (predefinedFilter != "empty") { try { //daca vrem sa aducem din start inregistrari !!! string initFilter = String.Format(" ((PROCESE.ID_DOSAR IS NULL AND (PROCESE.ID_RECLAMANT={0} OR PROCESE.ID_PARAT={0} OR PROCESE.ID_TERT={0})) OR (PROCESE.ID_DOSAR IS NOT NULL AND (DOSARE.ID_SOCIETATE_CASCO={0} OR DOSARE.ID_SOCIETATE_RCA={0}))) ", Convert.ToInt32(HttpContext.Current.Session["ID_SOCIETATE"])); ProceseRepository prep = new ProceseRepository(_CURENT_USER_ID, conStr); string filter = String.IsNullOrWhiteSpace(predefinedFilter) ? initFilter : predefinedFilter; string limit = String.Format(" LIMIT 0, {0} ", (CommonFunctions.ROWS_BLOCK_SIZE).ToString()); /* * this.Procese = (ProcesExtended[])prep.GetFilteredExtended(null, null, filter, limit).Result; * this.CurProces = this.Procese[0]; */ this.Procese = (Proces[])prep.GetFiltered(null, null, filter, limit).Result; this.CurProces = new ProcesExtended(this.Procese[0]); this.FilteredRowsCount = Convert.ToInt32(prep.CountFiltered(null, null, filter, null).Result); this.procesJson = new ProcesJson(); } catch { this.Procese = null; this.CurProces = new ProcesExtended(new Proces()); this.FilteredRowsCount = 0; this.procesJson = new ProcesJson(); } } }
public ProcesView(int _CURENT_USER_ID, string conStr, int?_ID_DOSAR, int?_ID_PROCES) { NomenclatoareRepository tpr = new NomenclatoareRepository(_CURENT_USER_ID, conStr); this.TipuriProcese = (Nomenclator[])tpr.GetAll("tip_procese").Result; this.Instante = (Nomenclator[])tpr.GetAll("instante").Result; this.Complete = (Nomenclator[])tpr.GetAll("complete").Result; //ContracteRepository cr = new ContracteRepository(_CURENT_USER_ID, conStr); //this.Contracte = (Contract[])cr.GetAll().Result; ProceseRepository pr = new ProceseRepository(_CURENT_USER_ID, conStr); this.TipDocumenteScanateProcese = (string[])pr.GetTipDocumenteScanatePocese().Result; //PartiRepository par = new PartiRepository(_CURENT_USER_ID, conStr); //this.Parti = (Parte[])par.GetAll().Result; this.Calitati = (Nomenclator[])tpr.GetAll("calitati").Result; ////Utilizator u = new Utilizator(_CURENT_USER_ID, conStr, _CURENT_USER_ID); ////this.Societate = (SocietateAsigurare)u.GetSocietatiAsigurare().Result; this.Societate = new SocietateAsigurare(_CURENT_USER_ID, conStr, Convert.ToInt32(HttpContext.Current.Session["ID_SOCIETATE"])); StadiiRepository sr = new StadiiRepository(_CURENT_USER_ID, conStr); this.Stadii = (StadiuCombo[])sr.GetCombo().Result; this.CurProces = new ProcesExtended(new Proces()); this.procesJson = new ProcesJson(); if (_ID_DOSAR != null && _ID_PROCES == null) { this.ID_DOSAR = Convert.ToInt32(_ID_DOSAR); this.ID_PROCES = null; Dosar d = new Dosar(_CURENT_USER_ID, conStr, Convert.ToInt32(_ID_DOSAR)); //this.Dosar = d; this.Procese = (Proces[])d.GetProcese().Result; /* * Proces[] ps = (Proces[])d.GetProcese().Result; * this.Procese = new ProcesExtended[ps.Length]; * for (int i = 0; i < ps.Length; i++) * { * this.Procese[i] = new ProcesExtended(ps[i]); * } */ this.procesJson = new ProcesJson(); this.procesJson.Calitate = d.ID_SOCIETATE_CASCO == Societate.ID ? "RECLAMANT" : "PARAT"; SocietateAsigurare cealaltaSocietate = new SocietateAsigurare(_CURENT_USER_ID, conStr, Convert.ToInt32(d.ID_SOCIETATE_CASCO == Societate.ID ? d.ID_SOCIETATE_RCA : d.ID_SOCIETATE_CASCO)); this.procesJson.Reclamant = d.ID_SOCIETATE_CASCO == Societate.ID ? Societate.DENUMIRE : cealaltaSocietate.DENUMIRE; this.procesJson.Parat = d.ID_SOCIETATE_CASCO == Societate.ID ? cealaltaSocietate.DENUMIRE : Societate.DENUMIRE; this.procesJson.Tert = ""; } if (_ID_DOSAR == null && _ID_PROCES != null) { this.ID_PROCES = Convert.ToInt32(_ID_PROCES); this.ID_DOSAR = null; this.procesJson.Reclamant = ""; this.procesJson.Parat = ""; this.procesJson.Tert = ""; } }
public DosarView(int _CURENT_USER_ID, string conStr) { SocietatiAsigurareRepository sar = new SocietatiAsigurareRepository(_CURENT_USER_ID, conStr); //this.SocietatiCASCO = this.SocietatiRCA = (SocietateAsigurare[])sar.GetAll().Result; this.SocietatiAsigurare = (SocietateAsigurare[])sar.GetAll().Result; NomenclatoareRepository nr = new NomenclatoareRepository(_CURENT_USER_ID, conStr); this.TipuriCaz = (Nomenclator[])nr.GetAll("tip_caz").Result; this.TipuriDosar = (Nomenclator[])nr.GetAll("tip_dosare").Result; this.StatusDosare = SOCISA.CommonFunctions.STATUS_DOSARE; this.DosareResult = null; this.Dosar = new Dosar(); Dosar.ID_SOCIETATE_CASCO = Convert.ToInt32(HttpContext.Current.Session["ID_SOCIETATE"]); this.dosarJson = new DosarJson(); this.FilteredRowsCount = 0; }
public PlataView(int _CURENT_USER_ID, int _ID_DOSAR, string conStr) { this.ID_DOSAR = _ID_DOSAR; NomenclatoareRepository tpr = new NomenclatoareRepository(_CURENT_USER_ID, conStr); this.TipuriPlati = (Nomenclator[])tpr.GetAll("tip_plata").Result; Dosar d = new Dosar(_CURENT_USER_ID, conStr, _ID_DOSAR); this.Plati = (Plata[])d.GetPlati().Result; }
public DosarView(int _CURENT_USER_ID, int _ID_SOCIETATE, Dosar dosar, string conStr) { if (HttpContext.Current.Session["TOKEN"] == null) // nu e request din link email notificare { this.Dosar = dosar; this.dosarJson = new DosarJson(_CURENT_USER_ID, _ID_SOCIETATE, conStr); SocietatiAsigurareRepository sar = new SocietatiAsigurareRepository(_CURENT_USER_ID, conStr); //this.SocietatiCASCO = this.SocietatiRCA = (SocietateAsigurare[])sar.GetAll().Result; this.SocietatiAsigurare = (SocietateAsigurare[])sar.GetAll().Result; NomenclatoareRepository nr = new NomenclatoareRepository(_CURENT_USER_ID, conStr); this.TipuriCaz = (Nomenclator[])nr.GetAll("tip_caz").Result; this.TipuriDosar = (Nomenclator[])nr.GetAll("tip_dosare").Result; this.StatusDosare = SOCISA.CommonFunctions.STATUS_DOSARE; //daca vrem sa aducem din start inregistrari !!! DosareRepository dr = new DosareRepository(_CURENT_USER_ID, conStr); string filter = String.Format(" DOSARE.ID_SOCIETATE_CASCO = {0} ", HttpContext.Current.Session["ID_SOCIETATE"]); string limit = String.Format(" LIMIT 0, {0} ", (SOCISA.CommonFunctions.ROWS_BLOCK_SIZE).ToString()); this.DosareResult = (Dosar[])dr.GetFiltered(null, null, filter, limit).Result; this.FilteredRowsCount = Convert.ToInt32(dr.CountFiltered(null, null, filter, null).Result); } else // request din link email notificare - doar un dosar { SocietatiAsigurareRepository sar = new SocietatiAsigurareRepository(_CURENT_USER_ID, conStr); //this.SocietatiCASCO = this.SocietatiRCA = (SocietateAsigurare[])sar.GetAll().Result; this.SocietatiAsigurare = (SocietateAsigurare[])sar.GetAll().Result; NomenclatoareRepository nr = new NomenclatoareRepository(_CURENT_USER_ID, conStr); this.TipuriCaz = (Nomenclator[])nr.GetAll("tip_caz").Result; this.TipuriDosar = (Nomenclator[])nr.GetAll("tip_dosare").Result; this.StatusDosare = SOCISA.CommonFunctions.STATUS_DOSARE; this.Dosar = dosar; DosareResult = new Dosar[] { dosar }; this.dosarJson = new DosarJson(_CURENT_USER_ID, _ID_SOCIETATE, conStr); this.FilteredRowsCount = 1; } }
public UtilizatorView(int CURENT_USER_ID, string conStr) { SocietatiAsigurareRepository sar = new SocietatiAsigurareRepository(CURENT_USER_ID, conStr); SocietatiAsigurare = GetFromBase((SocietateAsigurare[])sar.GetCombo().Result); SocietatiAsigurareAdministrate = GetFromBase((SocietateAsigurare[])sar.GetAllAdministrate().Result); DrepturiRepository dr = new DrepturiRepository(CURENT_USER_ID, conStr); Drepturi = GetFromBase((Drept[])dr.GetAll().Result); ActionsRepository ar = new ActionsRepository(CURENT_USER_ID, conStr); Actions = GetFromBase((SOCISA.Models.Action[])ar.GetAll().Result); NomenclatoareRepository nr = new NomenclatoareRepository(CURENT_USER_ID, conStr); TipuriUtilizator = (Nomenclator[])nr.GetAll("tip_utilizatori").Result; //HttpContext.Current.Session["l"] = new Dictionary<int, Utilizator>(); UtilizatorJson = new UtilizatorJson(CURENT_USER_ID, conStr, CURENT_USER_ID); UtilizatorJson.UtilizatoriSubordonati = UtilizatorJson.GetUtilizatoriSubordonati(CURENT_USER_ID, conStr); }
public PlataView(int _CURENT_USER_ID, string conStr) { NomenclatoareRepository tpr = new NomenclatoareRepository(_CURENT_USER_ID, conStr); this.TipuriPlati = (Nomenclator[])tpr.GetAll("tip_plata").Result; }
public DosarView(int _CURENT_USER_ID, int _ID_SOCIETATE, string conStr, string predefinedFilter) { if (HttpContext.Current.Session["TOKEN"] == null) // nu e request din link email notificare { SocietatiAsigurareRepository sar = new SocietatiAsigurareRepository(_CURENT_USER_ID, conStr); //this.SocietatiCASCO = this.SocietatiRCA = (SocietateAsigurare[])sar.GetAll().Result; this.SocietatiAsigurare = (SocietateAsigurare[])sar.GetAll().Result; NomenclatoareRepository nr = new NomenclatoareRepository(_CURENT_USER_ID, conStr); this.TipuriCaz = (Nomenclator[])nr.GetAll("tip_caz").Result; this.TipuriDosar = (Nomenclator[])nr.GetAll("tip_dosare").Result; this.StatusDosare = SOCISA.CommonFunctions.STATUS_DOSARE; try { //daca vrem sa aducem din start inregistrari !!! DosareRepository dr = new DosareRepository(_CURENT_USER_ID, conStr); //string filter = String.Format(" DOSARE.ID_SOCIETATE_CASCO = {0} ", HttpContext.Current.Session["ID_SOCIETATE"]); string filter = String.IsNullOrWhiteSpace(predefinedFilter) ? String.Format(" DOSARE.ID_SOCIETATE_CASCO = {0} ", HttpContext.Current.Session["ID_SOCIETATE"]) : predefinedFilter; string limit = String.Format(" LIMIT 0, {0} ", (SOCISA.CommonFunctions.ROWS_BLOCK_SIZE).ToString()); this.DosareResult = (Dosar[])dr.GetFiltered(null, null, filter, limit).Result; this.Dosar = DosareResult[0]; this.dosarJson = new DosarJson(_CURENT_USER_ID, _ID_SOCIETATE, conStr); this.FilteredRowsCount = Convert.ToInt32(dr.CountFiltered(null, null, filter, null).Result); } catch { this.DosareResult = null; this.Dosar = new Dosar(); Dosar.ID_SOCIETATE_CASCO = Convert.ToInt32(HttpContext.Current.Session["ID_SOCIETATE"]); this.dosarJson = new DosarJson(); this.FilteredRowsCount = 0; } } else // request din link email notificare - doar un dosar { SocietatiAsigurareRepository sar = new SocietatiAsigurareRepository(_CURENT_USER_ID, conStr); //this.SocietatiCASCO = this.SocietatiRCA = (SocietateAsigurare[])sar.GetAll().Result; this.SocietatiAsigurare = (SocietateAsigurare[])sar.GetAll().Result; NomenclatoareRepository nr = new NomenclatoareRepository(_CURENT_USER_ID, conStr); this.TipuriCaz = (Nomenclator[])nr.GetAll("tip_caz").Result; this.TipuriDosar = (Nomenclator[])nr.GetAll("tip_dosare").Result; this.StatusDosare = SOCISA.CommonFunctions.STATUS_DOSARE; try { string token = HttpContext.Current.Session["TOKEN"].ToString(); int id_dosar = Convert.ToInt32(token.Substring(token.LastIndexOf('|') + 1)); Dosar d = new Dosar(_CURENT_USER_ID, conStr, id_dosar); DosareResult = new Dosar[] { d }; Dosar = d; this.dosarJson = new DosarJson(_CURENT_USER_ID, _ID_SOCIETATE, conStr); this.FilteredRowsCount = 1; } catch { DosareResult = null; Dosar = new Dosar(); Dosar.ID_SOCIETATE_CASCO = Convert.ToInt32(HttpContext.Current.Session["ID_SOCIETATE"]); dosarJson = new DosarJson(); FilteredRowsCount = 0; } } }