Пример #1
0
    public static string DeleteAttachment(int workRequestID, int id)
    {
        Dictionary <string, string> result = new Dictionary <string, string>()
        {
            { "deleted", "" }, { "id", "" }, { "error", "" }
        };

        bool   deleted = false;
        string errorMsg = string.Empty, ids = string.Empty;

        try
        {
            deleted = WorkRequest.Attachment_Delete(workRequestID: workRequestID, attachmentID: id, errorMsg: out errorMsg);
        }
        catch (Exception ex)
        {
            LogUtility.LogException(ex);
            errorMsg += ": " + ex.Message;
            deleted   = false;
        }

        result["deleted"] = deleted.ToString();
        result["id"]      = id.ToString();
        result["error"]   = errorMsg;

        return(JsonConvert.SerializeObject(result, Formatting.None));
    }