/// <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 Delete(Sentinta item) { return(item.Delete()); }