Beispiel #1
0
        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      = "";
            }
        }