Ejemplo n.º 1
0
        public string DeleteSessionGeneratorResults(string sessionid, string generatorid)
        {
            Guid sessionGuid   = new Guid(sessionid);
            Guid generatorGuid = new Guid(generatorid);

            string output = "Failed to Delete Generator";

            try
            {
                output = DataMarshal.DeleteGenerator(generatorGuid) ? "Generator has been successfully deleted"
                    : output;
            }
            catch (Exception ex)
            {
                var msg = "Failed to Delete Generator: " + generatorid + ", UpdateException: "
                          + ex.Message + ", InnerException: " + ex.InnerException + ", StackTrace: " + ex.StackTrace.ToString();
                Debug.WriteLine(msg, "SessionResource.DeleteSessionGeneratorResults");
                var detail = new ErrorDetail(
                    ErrorDetail.Codes.DATAFORMAT_ERROR,
                    String.Format("Failed to Delete Generator")
                    );
                throw new WebFaultException <ErrorDetail>(detail, System.Net.HttpStatusCode.BadRequest);
            }

            return(output);
        }