Exemplo n.º 1
0
        public response Update(int id, string fieldValueCollection)
        {
            //ProcesStadiu item = JsonConvert.DeserializeObject<ProcesStadiu>(Find(id).Message);
            ProcesStadiu item = (ProcesStadiu)(Find(id).Result);

            return(item.Update(fieldValueCollection));
        }
Exemplo n.º 2
0
        public response Update(string fieldValueCollection)
        {
            ProcesStadiu tmpItem = JsonConvert.DeserializeObject <ProcesStadiu>(fieldValueCollection); // sa vedem daca merge asa sau trebuie cu JObject

            //return JsonConvert.DeserializeObject<ProcesStadiu>(Find(Convert.ToInt32(tmpItem.ID)).Message).Update(fieldValueCollection);
            return(((ProcesStadiu)(Find(Convert.ToInt32(tmpItem.ID)).Result)).Update(fieldValueCollection));
        }
Exemplo n.º 3
0
 public string GetDenumireProcesStdiu()
 {
     try
     {
         ProcesStadiu toReturn = new ProcesStadiu(authenticatedUserId, connectionString, Convert.ToInt32(this.ID_PROCES_STADIU));
         return(((Stadiu)toReturn.GetStadiu().Result).DENUMIRE);
     }
     catch (Exception exp) { LogWriter.Log(exp); return(null); }
 }
Exemplo n.º 4
0
 public ProcesStadiuExtended(ProcesStadiu ps, bool _selected)
 {
     this.ProcesStadiu = ps;
     try { this.Stadiu = (Stadiu)ps.GetStadiu().Result; }
     catch { this.Stadiu = new Stadiu(); }
     try { this.Sentinta = (Sentinta)ps.GetSentinta().Result; }
     catch { this.Sentinta = new Sentinta(); }
     try { this.Documente = (DocumentScanatProces[])ps.GetDocumente().Result; }
     catch { this.Documente = null; }
     this.selected = _selected;
 }
Exemplo n.º 5
0
 public response Find(int _id)
 {
     try
     {
         ProcesStadiu item = new ProcesStadiu(authenticatedUserId, connectionString, _id);
         return(new response(true, JsonConvert.SerializeObject(item, CommonFunctions.JsonSerializerSettings), item, null, null));;
     }
     catch (Exception exp) { LogWriter.Log(exp); return(new response(false, exp.ToString(), null, null, new System.Collections.Generic.List <Error>()
         {
             new Error(exp)
         })); }
 }
Exemplo n.º 6
0
 public response GetProcesStadiu()
 {
     try
     {
         ProcesStadiu toReturn = new ProcesStadiu(authenticatedUserId, connectionString, Convert.ToInt32(this.ID_PROCES_STADIU));
         return(new response(true, JsonConvert.SerializeObject(toReturn, CommonFunctions.JsonSerializerSettings), toReturn, null, null));
     }
     catch (Exception exp) { LogWriter.Log(exp); return(new response(false, exp.ToString(), null, null, new List <Error>()
         {
             new Error(exp)
         })); }
 }
Exemplo n.º 7
0
        public ProcesExtended(Proces p, bool _selected, int?_ID_SOCIETATE)
        {
            this.Proces = p;
            //this.Dosar = (Dosar)p.GetDosar().Result;
            try { this.TipProces = (Nomenclator)p.GetTipProces().Result; }
            catch { this.TipProces = new Nomenclator(); }
            try { this.Instanta = (Nomenclator)p.GetInstanta().Result; }
            catch { this.Instanta = new Nomenclator(); }
            try { this.Complet = (Nomenclator)p.GetComplet().Result; }
            catch { this.Complet = new Nomenclator(); }
            try { this.Contract = (Contract)p.GetContract().Result; }
            catch { this.Contract = new Contract(); }
            try
            {
                ProcesStadiu ps = (ProcesStadiu)p.GetStadiuCurent().Result;
                this.StadiuCurent = new ProcesStadiuExtended(ps);
            }
            catch
            {
                this.StadiuCurent = new ProcesStadiuExtended(new ProcesStadiu());
            }

            /*
             * try
             * {
             *  ProcesStadiu[] pss = (ProcesStadiu[])p.GetStadii().Result;
             *  this.Stadii = new ProcesStadiuExtended[pss.Length];
             *  for (int i = 0; i < pss.Length; i++)
             *  {
             *      this.Stadii[i] = new ProcesStadiuExtended(pss[i]);
             *  }
             * }
             * catch
             * {
             *  this.StadiuCurent = new ProcesStadiuExtended(new ProcesStadiu());
             *  this.Stadii = null;
             * }
             */

            this.Reclamant = this.Proces.GetReclamant(_ID_SOCIETATE).Result;
            this.Parat     = this.Proces.GetParat(_ID_SOCIETATE).Result;
            this.Tert      = this.Proces.GetTert(_ID_SOCIETATE).Result;
            if (_ID_SOCIETATE != null)
            {
                this.Calitate = (Nomenclator)(this.Proces.GetCalitate(Convert.ToInt32(_ID_SOCIETATE)).Result);
            }
            this.selected = _selected;
        }
Exemplo n.º 8
0
        public response GetFiltered(string _sort, string _order, string _filter, string _limit)
        {
            try
            {
                try
                {
                    string newFilter = Filtering.GenerateFilterFromJsonObject(typeof(ProcesStadiu), _filter, authenticatedUserId, connectionString);
                    _filter = newFilter == null ? _filter : newFilter;
                }
                catch { }
                DataAccess da = new DataAccess(authenticatedUserId, connectionString, CommandType.StoredProcedure, "PROCESE_STADIIsp_select", new object[] {
                    new MySqlParameter("_SORT", _sort),
                    new MySqlParameter("_ORDER", _order),
                    new MySqlParameter("_FILTER", _filter),
                    new MySqlParameter("_LIMIT", _limit)
                });

                /*
                 * ArrayList aList = new ArrayList();
                 * MySqlDataReader r = da.ExecuteSelectQuery();
                 * while (r.Read())
                 * {
                 *  ProcesStadiu a = new ProcesStadiu(authenticatedUserId, connectionString, (IDataRecord)r);
                 *  aList.Add(a);
                 * }
                 * r.Close(); r.Dispose(); da.CloseConnection();
                 * ProcesStadiu[] toReturn = new ProcesStadiu[aList.Count];
                 * for (int i = 0; i < aList.Count; i++)
                 *  toReturn[i] = (ProcesStadiu)aList[i];
                 * return new response(true, JsonConvert.SerializeObject(toReturn, CommonFunctions.JsonSerializerSettings), toReturn, null, null);
                 */
                List <ProcesStadiu> aList = new List <ProcesStadiu>();
                MySqlDataReader     r     = da.ExecuteSelectQuery();
                while (r.Read())
                {
                    ProcesStadiu a = new ProcesStadiu(authenticatedUserId, connectionString, (IDataRecord)r);
                    aList.Add(a);
                }
                r.Close(); r.Dispose(); da.CloseConnection();
                return(new response(true, JsonConvert.SerializeObject(aList.ToArray(), CommonFunctions.JsonSerializerSettings), aList.ToArray(), null, null));
            }
            catch (Exception exp) { LogWriter.Log(exp); return(new response(false, exp.ToString(), null, null, new System.Collections.Generic.List <Error>()
                {
                    new Error(exp)
                })); }
        }
Exemplo n.º 9
0
 public response GetChildren(ProcesStadiu item, string tableName, int childrenId)
 {
     return(item.GetChildren(tableName, childrenId));
 }
Exemplo n.º 10
0
 public response GetChildrens(ProcesStadiu item, string tableName)
 {
     return(item.GetChildrens(tableName));
 }
Exemplo n.º 11
0
 public response Delete(ProcesStadiu item)
 {
     return(item.Delete());
 }
Exemplo n.º 12
0
 public response Update(ProcesStadiu item)
 {
     return(item.Update());
 }
Exemplo n.º 13
0
 public response Insert(ProcesStadiu item)
 {
     return(item.Insert());
 }
Exemplo n.º 14
0
 public ProcesStadiuExtended(ProcesStadiu ps) : this(ps, false)
 {
 }