public response Update(int id, string fieldValueCollection) { //Proces item = JsonConvert.DeserializeObject<Proces>(Find(id).Message); Proces item = (Proces)(Find(id).Result); return(item.Update(fieldValueCollection)); }
public response Update(string fieldValueCollection) { Proces tmpItem = JsonConvert.DeserializeObject <Proces>(fieldValueCollection); // sa vedem daca merge asa sau trebuie cu JObject //return JsonConvert.DeserializeObject<Proces>(Find(Convert.ToInt32(tmpItem.ID)).Message).Update(fieldValueCollection); return(((Proces)(Find(Convert.ToInt32(tmpItem.ID)).Result)).Update(fieldValueCollection)); }
public response GetAll() { try { DataAccess da = new DataAccess(authenticatedUserId, connectionString, CommandType.StoredProcedure, "PROCESEsp_select", new object[] { new MySqlParameter("_SORT", null), new MySqlParameter("_ORDER", null), new MySqlParameter("_FILTER", null), new MySqlParameter("_LIMIT", null) }); ArrayList aList = new ArrayList(); MySqlDataReader r = da.ExecuteSelectQuery(); while (r.Read()) { Proces a = new Proces(authenticatedUserId, connectionString, (IDataRecord)r); aList.Add(a); } r.Close(); r.Dispose(); Proces[] toReturn = new Proces[aList.Count]; for (int i = 0; i < aList.Count; i++) { toReturn[i] = (Proces)aList[i]; } 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 System.Collections.Generic.List <Error>() { new Error(exp) })); } }
/// <summary> /// Metoda pentru inserarea relatiei Dosar-stadiu curenta /// </summary> /// <returns>SOCISA.response = new object(bool = status, string = error message, int = id-ul cheie returnat)</returns> public response Insert() { response toReturn = Validare(); if (!toReturn.Status) { return(toReturn); } /* * if (this.Stadiu != null) * { * response toReturnS = this.Stadiu.Insert(); * if (toReturnS.Status && toReturnS.InsertedId != null) * this.ID_STADIU = Convert.ToInt32(toReturnS.InsertedId); * } */ PropertyInfo[] props = this.GetType().GetProperties(); ArrayList _parameters = new ArrayList(); var col = CommonFunctions.table_columns(authenticatedUserId, connectionString, "procese_stadii"); foreach (PropertyInfo prop in props) { if (col != null && col.ToUpper().IndexOf(prop.Name.ToUpper()) > -1) // ca sa includem in Array-ul de parametri doar coloanele tabelei, nu si campurile externe si/sau alte proprietati { string propName = prop.Name; string propType = prop.PropertyType.ToString(); object propValue = prop.GetValue(this, null); propValue = propValue == null ? DBNull.Value : propValue; if (propType != null) { if (propName.ToUpper() != "ID") // il vom folosi doar la Edit! { _parameters.Add(new MySqlParameter(String.Format("_{0}", propName.ToUpper()), propValue)); } } } } DataAccess da = new DataAccess(authenticatedUserId, connectionString, CommandType.StoredProcedure, "PROCESE_STADIIsp_insert", _parameters.ToArray()); toReturn = da.ExecuteInsertQuery(); if (toReturn.Status) { this.ID = toReturn.InsertedId; try { if (toReturn.Status) { Proces p = new Proces(authenticatedUserId, connectionString, Convert.ToInt32(this.ID_PROCES)); p.ChangeStadiuCurent(Convert.ToInt32(((ProcesStadiu)p.GetStadiuCurent().Result).ID)); Dosar d = new Dosar(authenticatedUserId, connectionString, Convert.ToInt32(p.ID_DOSAR)); d.SetDataUltimeiModificari(DateTime.Now); } } catch { } } return(toReturn); }
public response Find(int _id) { try { Proces item = new Proces(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) })); } }
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; }
/// <summary> /// Metoda pentru stergerea relatiei Dosare-stadii curente /// </summary> /// <returns>SOCISA.response = new object(bool = status, string = error message, int = id-ul cheie returnat)</returns> public response Delete() { response toReturn = new response(true, "", null, null, new List <Error>()); Sentinta sentinta = (Sentinta)this.GetSentinta().Result; if (sentinta.ID != null) { toReturn = sentinta.Delete(); } if (toReturn.Status) { DocumentScanatProces[] dsps = (DocumentScanatProces[])this.GetDocumente().Result; foreach (DocumentScanatProces dsp in dsps) { toReturn = dsp.Delete(); if (!toReturn.Status) { break; } } if (toReturn.Status) { ArrayList _parameters = new ArrayList(); _parameters.Add(new MySqlParameter("_ID", this.ID)); DataAccess da = new DataAccess(authenticatedUserId, connectionString, CommandType.StoredProcedure, "PROCESE_STADIIsp_soft_delete", _parameters.ToArray()); toReturn = da.ExecuteDeleteQuery(); if (toReturn.Status) { try { Proces p = new Proces(authenticatedUserId, connectionString, Convert.ToInt32(this.ID_PROCES)); p.ChangeStadiuCurent(Convert.ToInt32(((ProcesStadiu)p.GetStadiuCurent().Result).ID)); } catch { } } } } return(toReturn); }
public response GetChildrens(Proces item, string tableName) { return(item.GetChildrens(tableName)); }
public response Delete(Proces item, int _ID_DOSAR) { return(item.Delete(_ID_DOSAR)); }
public response Delete(Proces item) { return(item.Delete()); }
public response GetComplet(Proces item) { return(item.GetComplet()); }
public response Insert(Proces item) { return(item.Insert()); }
public ProcesExtended(Proces p, bool _selected) : this(p, _selected, null) { }
public ProcesExtended(Proces p) : this(p, false) { }
public response GetChildren(Proces item, string tableName, int childrenId) { return(item.GetChildren(tableName, childrenId)); }
/* * public response Insert(Proces item, int _ID_DOSAR) * { * return item.Insert(_ID_DOSAR); * } */ public response Update(Proces item) { return(item.Update()); }
public response GetInstanta(Proces item) { return(item.GetInstanta()); }
public response Update(Proces item, int _ID_DOSAR) { return(item.Update(_ID_DOSAR)); }
public response GetTipProces(Proces item) { return(item.GetTipProces()); }
public response Insert(Proces item, int _ID_DOSAR) { return(item.Insert(_ID_DOSAR)); }