public DocumentScanatProcesView(int _CURENT_USER_ID, string conStr)
        {
            ProceseRepository pr = new ProceseRepository(_CURENT_USER_ID, conStr);

            this.TipDocumenteScanateProcese = (string[])pr.GetTipDocumenteScanatePocese().Result;
            this.CurDocumentScanatProces    = new DocumentScanatProcesExtended(new DocumentScanatProces(_CURENT_USER_ID, conStr));
        }
示例#2
0
        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();
                }
            }
        }
示例#3
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      = "";
            }
        }
        public DocumentScanatProcesView(int _CURENT_USER_ID, string conStr, int _ID_PROCES)
        {
            ProceseRepository pr = new ProceseRepository(_CURENT_USER_ID, conStr);

            this.TipDocumenteScanateProcese = (string[])pr.GetTipDocumenteScanatePocese().Result;
            Proces p = new Proces(_CURENT_USER_ID, conStr, _ID_PROCES);

            DocumentScanatProces[] dsps = (DocumentScanatProces[])p.GetDocumente().Result;
            this.Documente = new DocumentScanatProcesExtended[dsps.Length];
            for (int i = 0; i < dsps.Length; i++)
            {
                this.Documente[i] = new DocumentScanatProcesExtended(dsps[i]);
            }
            this.CurDocumentScanatProces = new DocumentScanatProcesExtended(new DocumentScanatProces(_CURENT_USER_ID, conStr));
        }